gnomemm r1814 - in gstreamermm/trunk: . examples/ogg_player gstreamer/src tools/extra_defs_gen



Author: jaalburqu
Date: Fri Nov 28 06:11:09 2008
New Revision: 1814
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1814&view=rev

Log:
2008-11-28  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/element.hg: Commented out set_clock() vfunc wrap
	because of problems with generated plug-ins that rely on the
	underlying GstElement base class to always have a set_clock() vfunc
	implementation (see comments in .hg file).

	* examples/ogg_player/main.cc: Use Gst::FileSrc and its property to
	ensure that (generated) plug-in wrapper works correctly.  May be a
	good idea to not require additional includes for plug-ins (just
	include them in gstreamermm.h (or gstreamerbasemm.h).

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/examples/ogg_player/main.cc
   gstreamermm/trunk/gstreamer/src/element.hg
   gstreamermm/trunk/tools/extra_defs_gen/   (props changed)

Modified: gstreamermm/trunk/examples/ogg_player/main.cc
==============================================================================
--- gstreamermm/trunk/examples/ogg_player/main.cc	(original)
+++ gstreamermm/trunk/examples/ogg_player/main.cc	Fri Nov 28 06:11:09 2008
@@ -20,6 +20,7 @@
  */
 
 #include <gstreamermm.h>
+#include <gstreamermm/filesrc.h>
 #include <iostream>
 #include <iomanip>
 
@@ -123,6 +124,9 @@
 
 int main(int argc, char* argv[])
 {
+  // Initialize Gstreamermm:
+  Gst::init(argc, argv);
+
   // Check input arguments:
   if (argc < 2)
   {
@@ -132,9 +136,6 @@
 
   const std::string filename = argv[1];
 
-  // Initialize Gstreamermm:
-  Gst::init(argc, argv);
-
   mainloop = Glib::MainLoop::create();
 
   // Create the pipeline:
@@ -143,7 +144,7 @@
   // Create the elements:
 
   // filsrc reads the file from disk:
-  Glib::RefPtr<Gst::Element> source = Gst::ElementFactory::create_element("filesrc");
+  Glib::RefPtr<Gst::FileSrc> source = Gst::FileSrc::create();
   if(!source)
     std::cerr << "filesrc element could not be created." << std::endl;
 
@@ -179,10 +180,7 @@
     data_probe_id = pad->add_data_probe( sigc::ptr_fun(&on_sink_pad_have_data) );
   //std::cout << "sink data probe id = " << data_probe_id << std::endl;
 
-
-  // Set the filename property on the file source.
-  // TODO: Create a FileSrc class that we can dynamic_cast<> to, so we can use property_location()?
-  source->set_property("location", filename);
+  source->property_location() = filename;
 
   // Get the bus from the pipeline, 
   // and add a bus watch to the default main context with the default priority:

Modified: gstreamermm/trunk/gstreamer/src/element.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/element.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/element.hg	Fri Nov 28 06:11:09 2008
@@ -306,9 +306,25 @@
    */
   _WRAP_VFUNC(Glib::RefPtr<Clock> provide_clock(), "provide_clock")
 
-  /** Set the Gst::Clock on the element.
-   */
-  _WRAP_VFUNC(bool set_clock(const Glib::RefPtr<Clock>& clock), "set_clock")
+  //TODO: Wrapping this vfunc causes problems for generated plug-ins because
+  //the underlying C base class (GstElement) does not have a default set_clock
+  //(gst_element_set_clock_func) implementation and when a pipeline tries to
+  //set a clock for our derived gtkmm wrapper (in gst_bin_set_clock_func by
+  //calling gst_element_set_clock on all its children),
+  //set_clock_vfunc_callback returns false because when it tries to call the
+  //(*base->set_clock)() function, there is none (for a GstElement) and the
+  //callback winds up typedefing RType to gboolean and returning RType() which
+  //is false thus triggering a failure when setting the clock for one of our
+  //gtkmm plug-in wrappers. I think the reason that there is no default
+  //set_clock() implementation in GStreamer is that it depends on if an element
+  //requires a clock (see gst_element_requires_clock) so a possible fix would
+  //be to add an optional parameter to _WRAP_VFUNC parameter specifying what to
+  //return in that last vfunc callback return statement.  This would also fix
+  //bug #530416 so I may submit a patch for this in hopes that it fixes both
+  //problems.
+  // /** Set the Gst::Clock on the element.
+  //  */
+  //_WRAP_VFUNC(bool set_clock(const Glib::RefPtr<Clock>& clock), "set_clock")
 
   /** Get a Gst::Index on the element.
    */



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