+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:
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);
#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
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;
}
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;
break;
}
- ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
-
return ret;
error:
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;
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);
#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
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;
}
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;
break;
}
- ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
-
return ret;
error: