gnomemm r1450 - in gstreamermm/trunk: examples/ogg_player gstreamer/src



Author: jaalburqu
Date: Fri Apr 11 00:11:06 2008
New Revision: 1450
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1450&view=rev

Log:
2008-04-10  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/pad.ccg: Modified the add_{data,event,buffer}_probe()
	methods to delete copy of slot when probe is removed (disconnected)

	* examples/ogg_player/main.cc: Corrected whitespace

Modified:
   gstreamermm/trunk/examples/ogg_player/main.cc
   gstreamermm/trunk/gstreamer/src/pad.ccg

Modified: gstreamermm/trunk/examples/ogg_player/main.cc
==============================================================================
--- gstreamermm/trunk/examples/ogg_player/main.cc	(original)
+++ gstreamermm/trunk/examples/ogg_player/main.cc	Fri Apr 11 00:11:06 2008
@@ -41,7 +41,7 @@
     && pipeline->query_duration(fmt, len)) {
 
     Glib::RefPtr<Gst::QueryPosition> posQuery =
-        Glib::RefPtr<Gst::QueryPosition>::cast_dynamic(query);
+      Glib::RefPtr<Gst::QueryPosition>::cast_dynamic(query);
 
     posQuery->parse(fmt, pos);
 
@@ -107,10 +107,10 @@
 bool on_sink_pad_have_data(const Glib::RefPtr<Gst::Pad>& pad,
         const Glib::RefPtr<Gst::MiniObject>& data)
 {
-    std::cout << "Sink pad '" << pad->get_name() << "' has received data;";
-    std::cout << " will now remove sink data probe id: " << data_probe_id << std::endl;
-    pad->remove_data_probe(data_probe_id);
-    return true;
+  std::cout << "Sink pad '" << pad->get_name() << "' has received data;";
+  std::cout << " will now remove sink data probe id: " << data_probe_id << std::endl;
+  pad->remove_data_probe(data_probe_id);
+  return true;
 }
 
 int main(int argc, char* argv[])
@@ -158,11 +158,12 @@
     return -1;
   }
 
-    data_probe_id = sink->get_pad("sink")->add_data_probe(
-            sigc::ptr_fun(&on_sink_pad_have_data));
-    std::cout << "sink data probe id = " << data_probe_id << std::endl;
+  data_probe_id = sink->get_pad("sink")->add_data_probe(
+    sigc::ptr_fun(&on_sink_pad_have_data));
+  std::cout << "sink data probe id = " << data_probe_id << std::endl;
 
 
+  // //eireuo
   // Set filename property on the file source. Also add a message handler:
   source->set_property("location", std::string(argv[1]));
 

Modified: gstreamermm/trunk/gstreamer/src/pad.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/pad.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/pad.ccg	Fri Apr 11 00:11:06 2008
@@ -73,7 +73,7 @@
   #endif //GLIBMM_EXCEPTIONS_ENABLED
 }
 
-static void Pad_Data_gstreamermm_callback_disconnect(void* data, GClosure* closure)
+static void Pad_Data_gstreamermm_callback_disconnect(void* data)
 {
   Gst::Pad::SlotData* the_slot = static_cast<Gst::Pad::SlotData*>(data);
 
@@ -177,24 +177,21 @@
 {
   SlotData* slot_copy = new SlotData(slot);
 
-  //return gst_pad_add_data_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
-  return gst_pad_add_data_probe(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy);
+  return gst_pad_add_data_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
 }
 
 gulong Pad::add_buffer_probe(const SlotData& slot)
 {
   SlotData* slot_copy = new SlotData(slot);
 
-  //return gst_pad_add_buffer_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
-  return gst_pad_add_buffer_probe(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy);
+  return gst_pad_add_buffer_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
 }
 
 gulong Pad::add_event_probe(const SlotData& slot)
 {
   SlotData* slot_copy = new SlotData(slot);
 
-  //return gst_pad_add_event_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
-  return gst_pad_add_event_probe(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy);
+  return gst_pad_add_event_probe_full(gobj(), G_CALLBACK (Pad_Data_gstreamermm_callback), slot_copy, &Pad_Data_gstreamermm_callback_disconnect);
 }
 
 } //namespace Gst



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