[gstreamermm] Gst::AudioCdSrc: rename CddaBaseSrc to AudioCdSrc



commit 5f9a259a21b1d3d303f8f32a265952e5bae416c7
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Mon May 16 20:21:17 2016 +0200

    Gst::AudioCdSrc: rename CddaBaseSrc to AudioCdSrc
    
        * gstreamer/src/audiocdsrc.{ccg|hg}:
        * gstreamer/src/cddabasesrc.{ccg|hg}:
        * gstreamer/src/filelist.am:
        * gstreamer/src/gst_vfuncs.defs:
        * tools/extra_defs_gen/generate_plugin_gmmproc_file.cc:
        * tools/m4/convert_gst.m4: rename CddaBaseSrc class to AudioCdSrc
          class.

 .gitignore                                         |    4 +-
 gstreamer/src/audiocdsrc.ccg                       |   42 ++++++
 gstreamer/src/{cddabasesrc.hg => audiocdsrc.hg}    |   54 +++-----
 gstreamer/src/cddabasesrc.ccg                      |  147 --------------------
 gstreamer/src/filelist.am                          |    1 +
 gstreamer/src/gst_vfuncs.defs                      |   12 +-
 .../extra_defs_gen/generate_plugin_gmmproc_file.cc |    2 +-
 tools/m4/convert_gst.m4                            |    1 +
 8 files changed, 74 insertions(+), 189 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index b242e9e..854ef22 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,8 +79,8 @@ gstreamer/gstreamermm/caps.cc
 gstreamer/gstreamermm/caps.h
 gstreamer/gstreamermm/capsfeatures.cc
 gstreamer/gstreamermm/capsfeatures.h
-gstreamer/gstreamermm/cddabasesrc.cc
-gstreamer/gstreamermm/cddabasesrc.h
+gstreamer/gstreamermm/audiocdsrc.cc
+gstreamer/gstreamermm/audiocdsrc.h
 gstreamer/gstreamermm/childproxy.cc
 gstreamer/gstreamermm/childproxy.h
 gstreamer/gstreamermm/clock.cc
diff --git a/gstreamer/src/audiocdsrc.ccg b/gstreamer/src/audiocdsrc.ccg
new file mode 100644
index 0000000..bc9732b
--- /dev/null
+++ b/gstreamer/src/audiocdsrc.ccg
@@ -0,0 +1,42 @@
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2016 The gstreamermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <gstreamermm/buffer.h>
+_PINCLUDE(gstreamermm/private/pushsrc_p.h)
+
+namespace Gst
+{
+
+bool AudioCdSrc::add_track(guint num, guint start, guint end, bool is_audio,
+  const Gst::TagList& tags)
+{
+  GstAudioCdSrcTrack track;
+
+  track.num = num;
+  track.start = start;
+  track.end = end;
+  track.is_audio = is_audio;
+
+  if (tags)
+    track.tags = tags.gobj_copy();
+
+  return gst_audio_cd_src_add_track(gobj(), &track);
+}
+
+} // namespace Gst
diff --git a/gstreamer/src/cddabasesrc.hg b/gstreamer/src/audiocdsrc.hg
similarity index 71%
rename from gstreamer/src/cddabasesrc.hg
rename to gstreamer/src/audiocdsrc.hg
index 314f4ee..913c6aa 100644
--- a/gstreamer/src/cddabasesrc.hg
+++ b/gstreamer/src/audiocdsrc.hg
@@ -1,6 +1,6 @@
 /* gstreamermm - a C++ wrapper for gstreamer
  *
- * Copyright 2008 The gstreamermm Development Team
+ * Copyright 2016 The gstreamermm Development Team
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  
-#include <gst/cdda/gstcddabasesrc.h>
+#include <gst/audio/gstaudiocdsrc.h>
 #include <gstreamermm/pushsrc.h>
 #include <gstreamermm/taglist.h>
 #include <glibmm/arrayhandle.h>
@@ -27,13 +27,13 @@ _DEFS(gstreamermm,gst)
 namespace Gst
 {
 
-_WRAP_ENUM(CddaBaseSrcMode,GstCddaBaseSrcMode)
+_WRAP_ENUM(AudioCdSrcMode,GstAudioCdSrcMode)
 
-/** A base class for CD digital audio (CDDA) sources.
- * Provides a base class for CDDA sources, which handles things like seeking,
- * querying, discid calculation, tags, and buffer timestamping.
+/** A base class for CD digital audio (CDDA) sources, which handles
+ * things like seeking, querying, discid calculation, tags, and buffer
+ * timestamping.
  *
- * Gst::CddaBaseSrc registers two Gst::Formats of its own, namely the
+ * Gst::AudioCdSrc registers two Gst::Formats of its own, namely the
  * "track" format and the "sector" format. Applications will usually only find
  * the "track" format interesting. You can retrieve that Gst::Format for use in
  * seek events or queries with Gst::get_format("track").
@@ -60,11 +60,20 @@ _WRAP_ENUM(CddaBaseSrcMode,GstCddaBaseSrcMode)
  * Gst::TAG_CDDA_MUSICBRAINZ_DISCID, Gst::TAG_CDDA_MUSICBRAINZ_DISCID_FULL,
  * among others.
  *
+ * Applications will be informed of the available tracks via a TOC message
+ * on the pipeline's Gst::Bus. The Gst::Toc will contain a Gst::TocEntry for
+ * each track, with information about each track. The duration for each
+ * track can be retrieved via the Gst::TAG_DURATION tag from each entry's
+ * tag list, or calculated via Gst::TocEntry::get_start_stop_times().
+ * The track entries in the TOC will be sorted by track number.
+ *
+ * Last reviewed on 2016-05-16 (1.8.0)
+ *
  * @ingroup GstBaseClasses
  */
-class CddaBaseSrc : public Gst::PushSrc
+class AudioCdSrc : public Gst::PushSrc
 {
-  _CLASS_GOBJECT(CddaBaseSrc, GstCddaBaseSrc, GST_CDDA_BASE_SRC, Gst::PushSrc, GstPushSrc)
+  _CLASS_GOBJECT(AudioCdSrc, GstAudioCdSrc, GST_AUDIO_CD_SRC, Gst::PushSrc, GstPushSrc)
 
 public:
   /** CDDA sources use this function from their start vfunc to announce the
@@ -79,15 +88,15 @@ public:
    */
   bool add_track(guint num, guint start, guint end, bool is_audio = true,
     const Gst::TagList& tags = Gst::TagList());
-  _IGNORE(gst_cdda_base_src_add_track)
+  _IGNORE(gst_audio_cd_src_add_track)
 
   _WRAP_PROPERTY("device", std::string)
-  _WRAP_PROPERTY("mode", CddaBaseSrcMode)
+  _WRAP_PROPERTY("mode", AudioCdSrcMode)
   _WRAP_PROPERTY("track", guint)
 
   /** Virtual function to open a CD device.
    */
-   virtual bool open_vfunc(std::string& device);
+  _WRAP_VFUNC(bool open(const std::string& device), "open")
 
   /** Virtual function to close the device.
    */
@@ -96,27 +105,6 @@ public:
   /** Virtual function to read one sector (LBA).
    */
   _WRAP_VFUNC(Glib::RefPtr<Gst::Buffer> read_sector(gint sector), "read_sector")
-
-  /** Virtual function to get default device.  It is optional and may return
-   * an empty string.
-   */
-  _WRAP_VFUNC(std::string get_default_device() const, "get_default_device")
-
-  /** Virtual function to return array of CD devices.  It is optional and may
-   * return an empty array.
-   */
-  virtual Glib::ArrayHandle<std::string> probe_devices_vfunc();
-
-protected:
-#m4begin
-  _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
-  klass->open = &open_vfunc_callback;
-  klass->probe_devices = &probe_devices_vfunc_callback;
-  _SECTION(SECTION_PH_VFUNCS)
-  static gboolean open_vfunc_callback(GstCddaBaseSrc* self, const gchar* device);
-  static gchar** probe_devices_vfunc_callback(GstCddaBaseSrc* self);
-  _POP()
-#m4end
 };
 
 } // namespace Gst
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index f40a9cf..5868546 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -28,6 +28,7 @@ files_hg  =                     \
         allocator.hg            \
         audiobasesink.hg        \
         audiobasesrc.hg         \
+       audiocdsrc.hg           \
         audioclock.hg           \
         audiofilter.hg          \
         audioformat.hg          \
diff --git a/gstreamer/src/gst_vfuncs.defs b/gstreamer/src/gst_vfuncs.defs
index f455a80..f3dcda5 100644
--- a/gstreamer/src/gst_vfuncs.defs
+++ b/gstreamer/src/gst_vfuncs.defs
@@ -654,10 +654,10 @@
   )
 )
 
-; GstCddaBaseSrc
+; GstAudioCdSrc
 
 (define-vfunc open
-  (of-object "GstCddaBaseSrc")
+  (of-object "GstAudioCdSrc")
   (return-type "gboolean")
   (parameters
    '("const-gchar*" "device")
@@ -665,12 +665,12 @@
 )
 
 (define-vfunc close
-  (of-object "GstCddaBaseSrc")
+  (of-object "GstAudioCdSrc")
   (return-type "void")
 )
 
 (define-vfunc read_sector
-  (of-object "GstCddaBaseSrc")
+  (of-object "GstAudioCdSrc")
   (return-type "GstBuffer*")
   (parameters
    '("gint" "sector")
@@ -678,12 +678,12 @@
 )
 
 (define-vfunc get_default_device
-  (of-object "GstCddaBaseSrc")
+  (of-object "GstAudioCdSrc")
   (return-type "gchar*")
 )
 
 (define-vfunc probe_devices
-  (of-object "GstCddaBaseSrc")
+  (of-object "GstAudioCdSrc")
   (return-type "gchar**")
 )
 
diff --git a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc 
b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
index 8c97616..2a490dd 100644
--- a/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
+++ b/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
@@ -892,7 +892,7 @@ int main(int argc, char** argv)
       cppParentTypeName.compare("BaseSrc") == 0 ||
       cppParentTypeName.compare("BaseTransform") == 0 ||
       cppParentTypeName.compare("Bin") == 0 ||
-      cppParentTypeName.compare("CddaBaseSrc") == 0 ||
+      cppParentTypeName.compare("AudioCdSrc") == 0 ||
       cppParentTypeName.compare("Element") == 0 ||
       cppParentTypeName.compare("Object") == 0 ||
       cppParentTypeName.compare("Pipeline") == 0 ||
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index d2c51c0..d4b768f 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -2,6 +2,7 @@ dnl Copyright 2008 The gstreamermm Development Team
 
 dnl Enums
 _CONV_ENUM(Gst,AssocFlags)
+_CONV_ENUM(Gst,AudioCdSrcMode)
 _CONV_ENUM(Gst,AutoplugSelectResult)
 _CONV_ENUM(Gst,AudioBaseSinkSlaveMethod)
 _CONV_ENUM(Gst,AudioBaseSinkDiscontReason)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]