gst/base/gstbasesink.c: Add comment.

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.
This commit is contained in:
Tim-Philipp Müller 2005-09-02 23:17:26 +00:00
parent 64a74152c2
commit 46616180d1
6 changed files with 31 additions and 10 deletions

View file

@ -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:

View 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);

View 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:

View 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;

View 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);

View 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: