gst/base/gstbasesink.c: Add comment.
authorTim-Philipp Müller <tim@centricular.net>
Fri, 2 Sep 2005 23:17:26 +0000 (23:17 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Fri, 2 Sep 2005 23:17:26 +0000 (23:17 +0000)
Original commit message from CVS:
* gst/base/gstbasesink.c: (gst_base_sink_pad_buffer_alloc):
Add comment.
* gst/elements/gstfakesink.c: (gst_fake_sink_init),
(gst_fake_sink_change_state):
Make state change function thread-safe.
* gst/gstpad.c: (gst_pad_alloc_buffer):
Set offset on generic buffer allocated by fallback.

ChangeLog
gst/base/gstbasesink.c
gst/elements/gstfakesink.c
gst/gstpad.c
libs/gst/base/gstbasesink.c
plugins/elements/gstfakesink.c

index ea9534a..e3207a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-09-03  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/base/gstbasesink.c: (gst_base_sink_pad_buffer_alloc):
+         Add comment.
+         
+       * gst/elements/gstfakesink.c: (gst_fake_sink_init),
+       (gst_fake_sink_change_state):
+         Make state change function thread-safe.
+         
+       * gst/gstpad.c: (gst_pad_alloc_buffer):
+         Set offset on generic buffer allocated by fallback.
+
 2005-09-03  Stefan Kost  <ensonic@users.sf.net>
 
        * docs/gst/gstreamer-sections.txt:
index 97af7b8..b8964c8 100644 (file)
@@ -221,7 +221,7 @@ gst_base_sink_pad_buffer_alloc (GstPad * pad, guint64 offset, guint size,
   if (bclass->buffer_alloc)
     result = bclass->buffer_alloc (bsink, offset, size, caps, buf);
   else
-    *buf = NULL;
+    *buf = NULL;                /* fallback in gstpad.c will allocate generic buffer */
 
   gst_object_unref (bsink);
 
index 9bbdc92..22741cc 100644 (file)
@@ -64,7 +64,6 @@ enum
 #define DEFAULT_SYNC FALSE
 #define DEFAULT_SIGNAL_HANDOFFS FALSE
 #define DEFAULT_LAST_MESSAGE NULL
-#define DEFAULT_LAST_MESSAGE NULL
 #define DEFAULT_CAN_ACTIVATE_PUSH TRUE
 #define DEFAULT_CAN_ACTIVATE_PULL FALSE
 
@@ -220,7 +219,7 @@ gst_fake_sink_init (GstFakeSink * fakesink, GstFakeSinkClass * g_class)
   fakesink->silent = DEFAULT_SILENT;
   fakesink->dump = DEFAULT_DUMP;
   fakesink->sync = DEFAULT_SYNC;
-  fakesink->last_message = DEFAULT_LAST_MESSAGE;
+  fakesink->last_message = g_strdup (DEFAULT_LAST_MESSAGE);
   fakesink->state_error = DEFAULT_STATE_ERROR;
   fakesink->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
 }
@@ -402,6 +401,13 @@ gst_fake_sink_change_state (GstElement * element, GstStateChange transition)
       if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PAUSED_PLAYING)
         goto error;
       break;
+    default:
+      break;
+  }
+
+  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+  switch (transition) {
     case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
       if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PLAYING_PAUSED)
         goto error;
@@ -420,8 +426,6 @@ gst_fake_sink_change_state (GstElement * element, GstStateChange transition)
       break;
   }
 
-  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
-
   return ret;
 
 error:
index a8e1f73..78e2c40 100644 (file)
@@ -2418,6 +2418,7 @@ fallback:
     GST_CAT_DEBUG (GST_CAT_PADS,
         "%s:%s fallback buffer alloc", GST_DEBUG_PAD_NAME (pad));
     *buf = gst_buffer_new_and_alloc (size);
+    GST_BUFFER_OFFSET (*buf) = offset;
     gst_buffer_set_caps (*buf, caps);
 
     ret = GST_FLOW_OK;
index 97af7b8..b8964c8 100644 (file)
@@ -221,7 +221,7 @@ gst_base_sink_pad_buffer_alloc (GstPad * pad, guint64 offset, guint size,
   if (bclass->buffer_alloc)
     result = bclass->buffer_alloc (bsink, offset, size, caps, buf);
   else
-    *buf = NULL;
+    *buf = NULL;                /* fallback in gstpad.c will allocate generic buffer */
 
   gst_object_unref (bsink);
 
index 9bbdc92..22741cc 100644 (file)
@@ -64,7 +64,6 @@ enum
 #define DEFAULT_SYNC FALSE
 #define DEFAULT_SIGNAL_HANDOFFS FALSE
 #define DEFAULT_LAST_MESSAGE NULL
-#define DEFAULT_LAST_MESSAGE NULL
 #define DEFAULT_CAN_ACTIVATE_PUSH TRUE
 #define DEFAULT_CAN_ACTIVATE_PULL FALSE
 
@@ -220,7 +219,7 @@ gst_fake_sink_init (GstFakeSink * fakesink, GstFakeSinkClass * g_class)
   fakesink->silent = DEFAULT_SILENT;
   fakesink->dump = DEFAULT_DUMP;
   fakesink->sync = DEFAULT_SYNC;
-  fakesink->last_message = DEFAULT_LAST_MESSAGE;
+  fakesink->last_message = g_strdup (DEFAULT_LAST_MESSAGE);
   fakesink->state_error = DEFAULT_STATE_ERROR;
   fakesink->signal_handoffs = DEFAULT_SIGNAL_HANDOFFS;
 }
@@ -402,6 +401,13 @@ gst_fake_sink_change_state (GstElement * element, GstStateChange transition)
       if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PAUSED_PLAYING)
         goto error;
       break;
+    default:
+      break;
+  }
+
+  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+  switch (transition) {
     case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
       if (fakesink->state_error == FAKE_SINK_STATE_ERROR_PLAYING_PAUSED)
         goto error;
@@ -420,8 +426,6 @@ gst_fake_sink_change_state (GstElement * element, GstStateChange transition)
       break;
   }
 
-  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
-
   return ret;
 
 error: