mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
gst/base/gstcollectpads.c (gst_collectpads_chain): Slight cleanup.
Original commit message from CVS: 2005-10-17 Andy Wingo <wingo@pobox.com> * gst/base/gstcollectpads.c (gst_collectpads_chain): Slight cleanup. * gst/Makefile.am (gstenumtypes.c): Threadsafe now. * gst/gstevent.c (gst_event_new, gst_event_finalize): LOG. * gst/gstelement.c (gst_element_get_state_func): s/INFO/DEBUG/. (gst_element_get_state_func): Better debug message. (gst_element_commit_state): s/INFO/DEBUG/. (gst_element_lost_state, gst_element_change_state): * gst/gstmessage.c (gst_message_init): s/INFO/LOG/. (gst_message_new_custom): s/INFO/LOG/.
This commit is contained in:
parent
2992b384a6
commit
839de99850
7 changed files with 43 additions and 29 deletions
17
ChangeLog
17
ChangeLog
|
@ -1,3 +1,20 @@
|
|||
2005-10-17 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* gst/base/gstcollectpads.c (gst_collectpads_chain): Slight
|
||||
cleanup.
|
||||
|
||||
* gst/Makefile.am (gstenumtypes.c): Threadsafe now.
|
||||
|
||||
* gst/gstevent.c (gst_event_new, gst_event_finalize): LOG.
|
||||
|
||||
* gst/gstelement.c (gst_element_get_state_func): s/INFO/DEBUG/.
|
||||
(gst_element_get_state_func): Better debug message.
|
||||
(gst_element_commit_state): s/INFO/DEBUG/.
|
||||
(gst_element_lost_state, gst_element_change_state):
|
||||
|
||||
* gst/gstmessage.c (gst_message_init): s/INFO/LOG/.
|
||||
(gst_message_new_custom): s/INFO/LOG/.
|
||||
|
||||
2005-10-17 Michael Smith <msmith@fluendo.com>
|
||||
|
||||
* gst/base/gstbasesink.c: (gst_base_sink_do_sync):
|
||||
|
|
|
@ -230,7 +230,7 @@ gstenumtypes.c: $(gst_headers)
|
|||
glib-mkenums \
|
||||
--fhead "#include \"gst_private.h\"\n#include <gst/gst.h>" \
|
||||
--fprod "\n/* enumerations from \"@filename@\" */" \
|
||||
--vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const G@Type@Value values[] = {" \
|
||||
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
|
||||
--vtail " { 0, NULL, NULL }\n };\n etype = g_@type@_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
|
||||
--vhead "static void\nregister_@enum_name@ (GType* id)\n{\n static const G@Type@Value values[] = {" \
|
||||
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
|
||||
--vtail " { 0, NULL, NULL }\n };\n *id = g_@type@_register_static (\"@EnumName@\", values);\n}\nGType\n@enum_name@_get_type (void)\n{\n static GType id;\n static GOnce once = G_ONCE_INIT;\n\n g_once (&once, (GThreadFunc)register_@enum_name@, &id);\n return id;\n}\n" \
|
||||
$^ > gstenumtypes.c
|
||||
|
|
|
@ -609,10 +609,8 @@ gst_collectpads_chain (GstPad * pad, GstBuffer * buffer)
|
|||
goto not_started;
|
||||
|
||||
/* Call the collected callback until a pad with a buffer is popped. */
|
||||
while (((pads->queuedpads + pads->eospads) == pads->numpads) &&
|
||||
pads->func != NULL) {
|
||||
while (((pads->queuedpads + pads->eospads) == pads->numpads) && pads->func)
|
||||
ret = pads->func (pads, pads->user_data);
|
||||
}
|
||||
|
||||
/* queue buffer on this pad, block if filled */
|
||||
while (data->buffer != NULL) {
|
||||
|
|
|
@ -1611,7 +1611,7 @@ gst_element_get_state_func (GstElement * element,
|
|||
GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE;
|
||||
GstState old_pending;
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "getting state");
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "getting state");
|
||||
|
||||
GST_STATE_LOCK (element);
|
||||
ret = GST_STATE_RETURN (element);
|
||||
|
@ -1645,26 +1645,27 @@ gst_element_get_state_func (GstElement * element,
|
|||
} else {
|
||||
timeval = NULL;
|
||||
}
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "wait for pending");
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
"waiting for element to commit state");
|
||||
/* we have a pending state change, wait for it to complete */
|
||||
if (!GST_STATE_TIMED_WAIT (element, timeval)) {
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "timeout");
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "timed out");
|
||||
/* timeout triggered */
|
||||
ret = GST_STATE_CHANGE_ASYNC;
|
||||
} else {
|
||||
/* could be success or failure */
|
||||
if (old_pending == GST_STATE (element)) {
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "got success");
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "got success");
|
||||
ret = GST_STATE_CHANGE_SUCCESS;
|
||||
} else {
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "got failure");
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "got failure");
|
||||
ret = GST_STATE_CHANGE_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* if nothing is pending anymore we can return SUCCESS */
|
||||
if (GST_STATE_PENDING (element) == GST_STATE_VOID_PENDING) {
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "nothing pending");
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_STATES, element, "nothing pending");
|
||||
ret = GST_STATE_CHANGE_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1674,7 +1675,7 @@ done:
|
|||
if (pending)
|
||||
*pending = GST_STATE_PENDING (element);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||
"state current: %s, pending: %s, result: %d",
|
||||
gst_element_state_get_name (GST_STATE (element)),
|
||||
gst_element_state_get_name (GST_STATE_PENDING (element)), ret);
|
||||
|
@ -1828,7 +1829,7 @@ gst_element_commit_state (GstElement * element)
|
|||
|
||||
GST_STATE_RETURN (element) = ret;
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||
"committing state from %s to %s, pending %s",
|
||||
gst_element_state_get_name (old_state),
|
||||
gst_element_state_get_name (next),
|
||||
|
@ -1844,7 +1845,7 @@ gst_element_commit_state (GstElement * element)
|
|||
/* calc new next state */
|
||||
next = GST_STATE_GET_NEXT (current, pending);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||
"continue state change %s to %s, final %s",
|
||||
gst_element_state_get_name (current),
|
||||
gst_element_state_get_name (next),
|
||||
|
@ -1895,7 +1896,7 @@ gst_element_lost_state (GstElement * element)
|
|||
|
||||
current_state = GST_STATE (element);
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||
"lost state of %s", gst_element_state_get_name (current_state));
|
||||
|
||||
GST_STATE_NEXT (element) = current_state;
|
||||
|
@ -2051,7 +2052,7 @@ gst_element_change_state (GstElement * element, GstStateChange transition)
|
|||
gst_element_abort_state (element);
|
||||
break;
|
||||
case GST_STATE_CHANGE_ASYNC:
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||
"element will change state ASYNC");
|
||||
|
||||
/* if we go upwards, we give the app a change to wait for
|
||||
|
@ -2070,14 +2071,14 @@ gst_element_change_state (GstElement * element, GstStateChange transition)
|
|||
ret = gst_element_commit_state (element);
|
||||
break;
|
||||
case GST_STATE_CHANGE_SUCCESS:
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||
"element changed state SUCCESS");
|
||||
/* we can commit the state now which will proceeed to
|
||||
* the next state */
|
||||
ret = gst_element_commit_state (element);
|
||||
break;
|
||||
case GST_STATE_CHANGE_NO_PREROLL:
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
|
||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||
"element changed state NO_PREROLL");
|
||||
/* we can commit the state now which will proceeed to
|
||||
* the next state */
|
||||
|
@ -2092,7 +2093,7 @@ gst_element_change_state (GstElement * element, GstStateChange transition)
|
|||
exit:
|
||||
GST_STATE_RETURN (element) = ret;
|
||||
|
||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element, "exit state change %d", ret);
|
||||
GST_CAT_LOG_OBJECT (GST_CAT_STATES, element, "exit state change %d", ret);
|
||||
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ gst_event_finalize (GstEvent * event)
|
|||
g_return_if_fail (event != NULL);
|
||||
g_return_if_fail (GST_IS_EVENT (event));
|
||||
|
||||
GST_CAT_INFO (GST_CAT_EVENT, "freeing event %p type %s", event,
|
||||
GST_CAT_LOG (GST_CAT_EVENT, "freeing event %p type %s", event,
|
||||
gst_event_type_get_name (GST_EVENT_TYPE (event)));
|
||||
|
||||
if (GST_EVENT_SRC (event)) {
|
||||
|
@ -226,7 +226,7 @@ gst_event_new (GstEventType type)
|
|||
|
||||
event = (GstEvent *) gst_mini_object_new (GST_TYPE_EVENT);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_EVENT, "creating new event %p %s", event,
|
||||
GST_CAT_DEBUG (GST_CAT_EVENT, "creating new event %p %s", event,
|
||||
gst_event_type_get_name (type));
|
||||
|
||||
event->type = type;
|
||||
|
|
|
@ -182,7 +182,7 @@ gst_message_init (GTypeInstance * instance, gpointer g_class)
|
|||
{
|
||||
GstMessage *message = GST_MESSAGE (instance);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_MESSAGE, "new message %p", message);
|
||||
GST_CAT_LOG (GST_CAT_MESSAGE, "new message %p", message);
|
||||
GST_MESSAGE_TIMESTAMP (message) = GST_CLOCK_TIME_NONE;
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ gst_message_finalize (GstMessage * message)
|
|||
{
|
||||
g_return_if_fail (message != NULL);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_MESSAGE, "finalize message %p", message);
|
||||
GST_CAT_LOG (GST_CAT_MESSAGE, "finalize message %p", message);
|
||||
|
||||
if (GST_MESSAGE_SRC (message)) {
|
||||
gst_object_unref (GST_MESSAGE_SRC (message));
|
||||
|
@ -215,7 +215,7 @@ _gst_message_copy (GstMessage * message)
|
|||
{
|
||||
GstMessage *copy;
|
||||
|
||||
GST_CAT_INFO (GST_CAT_MESSAGE, "copy message %p", message);
|
||||
GST_CAT_LOG (GST_CAT_MESSAGE, "copy message %p", message);
|
||||
|
||||
copy = (GstMessage *) gst_mini_object_new (GST_TYPE_MESSAGE);
|
||||
|
||||
|
@ -263,7 +263,7 @@ gst_message_new_custom (GstMessageType type, GstObject * src,
|
|||
|
||||
message = (GstMessage *) gst_mini_object_new (GST_TYPE_MESSAGE);
|
||||
|
||||
GST_CAT_INFO (GST_CAT_MESSAGE, "creating new message %p %s", message,
|
||||
GST_CAT_LOG (GST_CAT_MESSAGE, "creating new message %p %s", message,
|
||||
gst_message_type_get_name (type));
|
||||
|
||||
message->type = type;
|
||||
|
|
|
@ -609,10 +609,8 @@ gst_collectpads_chain (GstPad * pad, GstBuffer * buffer)
|
|||
goto not_started;
|
||||
|
||||
/* Call the collected callback until a pad with a buffer is popped. */
|
||||
while (((pads->queuedpads + pads->eospads) == pads->numpads) &&
|
||||
pads->func != NULL) {
|
||||
while (((pads->queuedpads + pads->eospads) == pads->numpads) && pads->func)
|
||||
ret = pads->func (pads, pads->user_data);
|
||||
}
|
||||
|
||||
/* queue buffer on this pad, block if filled */
|
||||
while (data->buffer != NULL) {
|
||||
|
|
Loading…
Reference in a new issue