From: Wim Taymans Date: Wed, 10 Jun 2009 13:48:35 +0000 (+0200) Subject: message: add step-start message X-Git-Tag: RELEASE-0.10.24~118 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e969b3a3994cbe14143b6773ab104286ded61328;p=platform%2Fupstream%2Fgstreamer.git message: add step-start message --- diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt index df5fb4c..007015a 100644 --- a/docs/gst/gstreamer-sections.txt +++ b/docs/gst/gstreamer-sections.txt @@ -1146,6 +1146,8 @@ gst_message_new_latency gst_message_new_async_start gst_message_parse_async_start gst_message_new_async_done +gst_message_new_step_start +gst_message_parse_step_start GstStructureChangeType gst_message_new_structure_change diff --git a/gst/gstmessage.c b/gst/gstmessage.c index 4bc185d..c8f042b 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -110,6 +110,7 @@ static GstMessageQuarks message_quarks[] = { {GST_MESSAGE_ASYNC_START, "async-start", 0}, {GST_MESSAGE_ASYNC_DONE, "async-done", 0}, {GST_MESSAGE_REQUEST_STATE, "request-state", 0}, + {GST_MESSAGE_STEP_START, "step-start", 0}, {0, NULL, 0} }; @@ -1723,3 +1724,28 @@ gst_message_parse_step_done (GstMessage * message, GstFormat * format, g_value_get_uint64 (gst_structure_id_get_value (message->structure, GST_QUARK (DURATION))); } + +GstMessage * +gst_message_new_step_start (GstObject * src, gboolean active) +{ + GstMessage *message; + GstStructure *structure; + + structure = gst_structure_id_new (GST_QUARK (MESSAGE_STEP_START), + GST_QUARK (ACTIVE), G_TYPE_BOOLEAN, active, NULL); + message = gst_message_new_custom (GST_MESSAGE_STEP_START, src, structure); + + return message; +} + +void +gst_message_parse_step_start (GstMessage * message, gboolean * active) +{ + g_return_if_fail (GST_IS_MESSAGE (message)); + g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_STEP_START); + + if (active) + *active = + g_value_get_boolean (gst_structure_id_get_value (message->structure, + GST_QUARK (ACTIVE))); +} diff --git a/gst/gstmessage.h b/gst/gstmessage.h index 12284a9..9103669 100644 --- a/gst/gstmessage.h +++ b/gst/gstmessage.h @@ -84,6 +84,7 @@ typedef struct _GstMessageClass GstMessageClass; * @GST_MESSAGE_REQUEST_STATE: Posted by elements when they want the pipeline to * change state. This message is a suggestion to the application which can * decide to perform the state change on (part of) the pipeline. Since: 0.10.23. + * @GST_MESSAGE_STEP_START: A stepping operation was started. * @GST_MESSAGE_ANY: mask for all of the above messages. * * The different message types that are available. @@ -117,6 +118,7 @@ typedef enum GST_MESSAGE_ASYNC_START = (1 << 20), GST_MESSAGE_ASYNC_DONE = (1 << 21), GST_MESSAGE_REQUEST_STATE = (1 << 22), + GST_MESSAGE_STEP_START = (1 << 23), GST_MESSAGE_ANY = ~0 } GstMessageType; @@ -463,6 +465,10 @@ const GValue * gst_message_get_stream_status_object (GstMessage *message); GstMessage * gst_message_new_request_state (GstObject * src, GstState state); void gst_message_parse_request_state (GstMessage * message, GstState *state); +/* STEP_START */ +GstMessage * gst_message_new_step_start (GstObject * src, gboolean active); +void gst_message_parse_step_start (GstMessage * message, gboolean *active); + /* custom messages */ GstMessage * gst_message_new_custom (GstMessageType type, GstObject * src, diff --git a/gst/gstquark.c b/gst/gstquark.c index 6f8fa93..6a898b3 100644 --- a/gst/gstquark.c +++ b/gst/gstquark.c @@ -47,7 +47,7 @@ static const gchar *_quark_strings[] = { "GstQueryPosition", "GstQueryDuration", "GstQueryLatency", "GstQueryConvert", "GstQuerySegment", "GstQuerySeeking", "GstQueryFormats", "GstQueryBuffering", "GstQueryURI", "GstEventStep", "GstMessageStepDone", "amount", "flush", - "intermediate" + "intermediate", "GstMessageStepStart", "active" }; GQuark _priv_gst_quark_table[GST_QUARK_MAX]; diff --git a/gst/gstquark.h b/gst/gstquark.h index 5688858..ec48893 100644 --- a/gst/gstquark.h +++ b/gst/gstquark.h @@ -114,8 +114,10 @@ typedef enum _GstQuarkId GST_QUARK_AMOUNT = 85, GST_QUARK_FLUSH = 86, GST_QUARK_INTERMEDIATE = 87, + GST_QUARK_MESSAGE_STEP_START = 88, + GST_QUARK_ACTIVE = 89, - GST_QUARK_MAX = 88 + GST_QUARK_MAX = 90 } GstQuarkId; extern GQuark _priv_gst_quark_table[GST_QUARK_MAX]; diff --git a/win32/common/libgstreamer.def b/win32/common/libgstreamer.def index 7abab52..f45cab3 100644 --- a/win32/common/libgstreamer.def +++ b/win32/common/libgstreamer.def @@ -493,6 +493,7 @@ EXPORTS gst_message_new_state_changed gst_message_new_state_dirty gst_message_new_step_done + gst_message_new_step_start gst_message_new_stream_status gst_message_new_structure_change gst_message_new_tag @@ -512,6 +513,7 @@ EXPORTS gst_message_parse_segment_start gst_message_parse_state_changed gst_message_parse_step_done + gst_message_parse_step_start gst_message_parse_stream_status gst_message_parse_structure_change gst_message_parse_tag