mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-19 20:46:22 +00:00
docs/gst/gstreamer-sections.txt: add new API and fix the build
Original commit message from CVS: * docs/gst/gstreamer-sections.txt: add new API and fix the build * gst/gstbin.c: (gst_bin_recalc_state): * gst/gstelement.c: (gst_element_message_full), (gst_element_get_state_func), (gst_element_set_state_func): use new API and improve logging * gst/gstutils.c: (gst_element_state_change_return_get_name): * gst/gstutils.h: API: add function to get StateChangereturn names to improve logs
This commit is contained in:
parent
0cb5bf5dd9
commit
894b7f9f4a
6 changed files with 79 additions and 9 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
||||||
|
2006-11-06 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
|
* docs/gst/gstreamer-sections.txt:
|
||||||
|
add new API and fix the build
|
||||||
|
|
||||||
|
* gst/gstbin.c: (gst_bin_recalc_state):
|
||||||
|
* gst/gstelement.c: (gst_element_message_full),
|
||||||
|
(gst_element_get_state_func), (gst_element_set_state_func):
|
||||||
|
use new API and improve logging
|
||||||
|
|
||||||
|
* gst/gstutils.c: (gst_element_state_change_return_get_name):
|
||||||
|
* gst/gstutils.h:
|
||||||
|
API: add function to get StateChangereturn names to improve logs
|
||||||
|
|
||||||
2006-11-04 Thomas Vander Stichele <thomas at apestaart dot org>
|
2006-11-04 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||||
|
|
||||||
* plugins/elements/gstfilesrc.c: (gst_file_src_start):
|
* plugins/elements/gstfilesrc.c: (gst_file_src_start):
|
||||||
|
|
|
@ -490,6 +490,7 @@ gst_element_abort_state
|
||||||
gst_element_continue_state
|
gst_element_continue_state
|
||||||
gst_element_lost_state
|
gst_element_lost_state
|
||||||
gst_element_state_get_name
|
gst_element_state_get_name
|
||||||
|
gst_element_state_change_return_get_name
|
||||||
gst_element_sync_state_with_parent
|
gst_element_sync_state_with_parent
|
||||||
|
|
||||||
<SUBSECTION element-tags>
|
<SUBSECTION element-tags>
|
||||||
|
@ -1339,6 +1340,7 @@ GST_PAD_IS_SINK
|
||||||
|
|
||||||
GST_PAD_IS_IN_GETCAPS
|
GST_PAD_IS_IN_GETCAPS
|
||||||
GST_PAD_MODE_ACTIVATE
|
GST_PAD_MODE_ACTIVATE
|
||||||
|
GST_PAD_BLOCK_BROADCAST
|
||||||
GST_PAD_BLOCK_GET_COND
|
GST_PAD_BLOCK_GET_COND
|
||||||
GST_PAD_BLOCK_SIGNAL
|
GST_PAD_BLOCK_SIGNAL
|
||||||
GST_PAD_BLOCK_WAIT
|
GST_PAD_BLOCK_WAIT
|
||||||
|
|
|
@ -1417,7 +1417,8 @@ done:
|
||||||
goto unknown_state;
|
goto unknown_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_CAT_INFO_OBJECT (GST_CAT_STATES, bin, "bin RETURN is now %d", ret);
|
GST_CAT_INFO_OBJECT (GST_CAT_STATES, bin, "bin RETURN is now %s",
|
||||||
|
gst_element_state_change_return_get_name (ret));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -1558,8 +1558,8 @@ void gst_element_message_full
|
||||||
}
|
}
|
||||||
gst_element_post_message (element, message);
|
gst_element_post_message (element, message);
|
||||||
|
|
||||||
GST_CAT_INFO_OBJECT (GST_CAT_ERROR_SYSTEM, element, "posted message: %s",
|
GST_CAT_INFO_OBJECT (GST_CAT_ERROR_SYSTEM, element, "posted %s message: %s",
|
||||||
sent_text);
|
(type == GST_MESSAGE_ERROR ? "error" : "warning"), sent_text);
|
||||||
|
|
||||||
/* cleanup */
|
/* cleanup */
|
||||||
g_error_free (gerror);
|
g_error_free (gerror);
|
||||||
|
@ -1774,9 +1774,10 @@ done:
|
||||||
*pending = GST_STATE_PENDING (element);
|
*pending = GST_STATE_PENDING (element);
|
||||||
|
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||||
"state current: %s, pending: %s, result: %d",
|
"state current: %s, pending: %s, result: %s",
|
||||||
gst_element_state_get_name (GST_STATE (element)),
|
gst_element_state_get_name (GST_STATE (element)),
|
||||||
gst_element_state_get_name (GST_STATE_PENDING (element)), ret);
|
gst_element_state_get_name (GST_STATE_PENDING (element)),
|
||||||
|
gst_element_state_change_return_get_name (ret));
|
||||||
GST_OBJECT_UNLOCK (element);
|
GST_OBJECT_UNLOCK (element);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2146,10 +2147,11 @@ gst_element_set_state_func (GstElement * element, GstState state)
|
||||||
GST_STATE_PENDING (element) = state;
|
GST_STATE_PENDING (element) = state;
|
||||||
|
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
|
||||||
"current %s, old_pending %s, next %s, old return %d",
|
"current %s, old_pending %s, next %s, old return %s",
|
||||||
gst_element_state_get_name (current),
|
gst_element_state_get_name (current),
|
||||||
gst_element_state_get_name (old_pending),
|
gst_element_state_get_name (old_pending),
|
||||||
gst_element_state_get_name (next), old_ret);
|
gst_element_state_get_name (next),
|
||||||
|
gst_element_state_change_return_get_name (old_ret));
|
||||||
|
|
||||||
/* if the element was busy doing a state change, we just update the
|
/* if the element was busy doing a state change, we just update the
|
||||||
* target state, it'll get to it async then. */
|
* target state, it'll get to it async then. */
|
||||||
|
@ -2194,7 +2196,8 @@ gst_element_set_state_func (GstElement * element, GstState state)
|
||||||
|
|
||||||
GST_STATE_UNLOCK (element);
|
GST_STATE_UNLOCK (element);
|
||||||
|
|
||||||
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "returned %d", ret);
|
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, "returned %s",
|
||||||
|
gst_element_state_change_return_get_name (ret));
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
|
@ -987,7 +987,7 @@ gst_element_get_compatible_pad (GstElement * element, GstPad * pad,
|
||||||
*
|
*
|
||||||
* Returns: a string with the name of the state.
|
* Returns: a string with the name of the state.
|
||||||
*/
|
*/
|
||||||
const gchar *
|
G_CONST_RETURN gchar *
|
||||||
gst_element_state_get_name (GstState state)
|
gst_element_state_get_name (GstState state)
|
||||||
{
|
{
|
||||||
switch (state) {
|
switch (state) {
|
||||||
|
@ -1033,6 +1033,55 @@ gst_element_state_get_name (GstState state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_element_state_change_return_get_name:
|
||||||
|
* @state_ret: a #GstStateChangeReturn to get the name of.
|
||||||
|
*
|
||||||
|
* Gets a string representing the given state change result.
|
||||||
|
*
|
||||||
|
* Returns: a string with the name of the state change result.
|
||||||
|
*/
|
||||||
|
G_CONST_RETURN gchar *
|
||||||
|
gst_element_state_change_return_get_name (GstStateChangeReturn state_ret)
|
||||||
|
{
|
||||||
|
switch (state_ret) {
|
||||||
|
#ifdef GST_DEBUG_COLOR
|
||||||
|
case GST_STATE_CHANGE_FAILURE:
|
||||||
|
return "\033[01;31mFAILURE\033[00m";
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_SUCCESS:
|
||||||
|
return "\033[01;32mSUCCESS\033[00m";
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_ASYNC:
|
||||||
|
return "\033[01;33mASYNC\033[00m";
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_NO_PREROLL:
|
||||||
|
return "\033[01;34mNO PREROLL\033[00m";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* This is a memory leak */
|
||||||
|
return g_strdup_printf ("\033[01;35;41mUNKNOWN!\033[00m(%d)", state_ret);
|
||||||
|
#else
|
||||||
|
case GST_STATE_CHANGE_FAILURE:
|
||||||
|
return "FAILURE";
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_SUCCESS:
|
||||||
|
return "SUCCESS";
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_ASYNC:
|
||||||
|
return "ASYNC";
|
||||||
|
break;
|
||||||
|
case GST_STATE_CHANGE_NO_PREROLL:
|
||||||
|
return "NO PREROLL";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
/* This is a memory leak */
|
||||||
|
return g_strdup_printf ("UNKNOWN!(%d)", state_ret);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_element_factory_can_src_caps :
|
* gst_element_factory_can_src_caps :
|
||||||
* @factory: factory to query
|
* @factory: factory to query
|
||||||
|
|
|
@ -514,6 +514,7 @@ GstPad* gst_element_get_compatible_pad (GstElement *element, Gs
|
||||||
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
|
GstPadTemplate* gst_element_get_compatible_pad_template (GstElement *element, GstPadTemplate *compattempl);
|
||||||
|
|
||||||
G_CONST_RETURN gchar* gst_element_state_get_name (GstState state);
|
G_CONST_RETURN gchar* gst_element_state_get_name (GstState state);
|
||||||
|
G_CONST_RETURN gchar * gst_element_state_change_return_get_name (GstStateChangeReturn state_ret);
|
||||||
|
|
||||||
gboolean gst_element_link (GstElement *src, GstElement *dest);
|
gboolean gst_element_link (GstElement *src, GstElement *dest);
|
||||||
gboolean gst_element_link_many (GstElement *element_1,
|
gboolean gst_element_link_many (GstElement *element_1,
|
||||||
|
|
Loading…
Reference in a new issue