/**
* gst_message_new_eos:
*
- * Create a new eos message.
+ * Create a new eos message. This message is generated and posted in
+ * the sink elements of a GstBin. The bin will only forward the EOS
+ * message to the application if all sinks have posted an EOS message.
*
* Returns: The new eos message.
*
* @debug: A debugging string for something or other.
*
* Create a new error message. The message will copy @error and
- * @debug.
+ * @debug. This message is posted by element when a fatal event
+ * occured. The pipeline will probably (partially) stop.
*
* Returns: The new error message.
*
* @tag_list: The tag list for the message.
*
* Create a new tag message. The message will take ownership of the tag list.
+ * The message is posted by elements that discovered a new taglist.
*
* Returns: The new tag message.
*
* @old: The previous state.
* @new: The new (current) state.
*
- * Create a state change message.
+ * Create a state change message. This message is posted whenever an element changed
+ * its state.
*
* Returns: The new state change message.
*
}
/**
- * gst_message_new_cistom:
+ * gst_message_new_segment_start:
+ * @src: The object originating the message.
+ * @timestamp: The timestamp of the segment being played
+ *
+ * Create a new segment message. This message is posted by elements that
+ * start playback of a segment as a result of a segment seek. This message
+ * is not received by the application but is used for maintenance reasons in
+ * container elements.
+ *
+ * Returns: The new segment start message.
+ *
+ * MT safe.
+ */
+GstMessage *
+gst_message_new_segment_start (GstObject * src, GstClockTime timestamp)
+{
+ GstMessage *message;
+ GstStructure *s;
+
+ message = gst_message_new (GST_MESSAGE_SEGMENT_START, src);
+
+ s = gst_structure_new ("GstMessageSegmentStart", "timestamp", G_TYPE_INT64,
+ (gint64) timestamp, NULL);
+ gst_structure_set_parent_refcount (s, &message->mini_object.refcount);
+ message->structure = s;
+
+ return message;
+}
+
+/**
+ * gst_message_new_segment_done:
+ * @src: The object originating the message.
+ * @timestamp: The timestamp of the segment being played
+ *
+ * Create a new segment done message. This message is posted by elements that
+ * finish playback of a segment as a result of a segment seek. This message
+ * is received by the application after all elements that posted a segment_start
+ * have posted the segment_done.
+ *
+ * Returns: The new segment done message.
+ *
+ * MT safe.
+ */
+GstMessage *
+gst_message_new_segment_done (GstObject * src, GstClockTime timestamp)
+{
+ GstMessage *message;
+ GstStructure *s;
+
+ message = gst_message_new (GST_MESSAGE_SEGMENT_DONE, src);
+
+ s = gst_structure_new ("GstMessageSegmentDone", "timestamp", G_TYPE_INT64,
+ (gint64) timestamp, NULL);
+ gst_structure_set_parent_refcount (s, &message->mini_object.refcount);
+ message->structure = s;
+
+ return message;
+}
+
+/**
+ * gst_message_new_custom:
* @src: The object originating the message.
* @structure: The structure for the message. The message will take ownership of
* the structure.
*debug = g_strdup (gst_structure_get_string (message->structure, "debug"));
}
+
+/**
+ * gst_message_parse_segment_start:
+ * @message: A valid #GstMessage of type GST_MESSAGE_SEGMENT_START.
+ *
+ * Extracts the timestamp from the segment start message.
+ *
+ * MT safe.
+ */
+void
+gst_message_parse_segment_start (GstMessage * message, GstClockTime * timestamp)
+{
+ const GValue *time_gvalue;
+
+ g_return_if_fail (GST_IS_MESSAGE (message));
+ g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_SEGMENT_START);
+
+ time_gvalue = gst_structure_get_value (message->structure, "timstamp");
+ g_return_if_fail (time_gvalue != NULL);
+ g_return_if_fail (G_VALUE_TYPE (time_gvalue) == G_TYPE_INT64);
+
+ if (timestamp)
+ *timestamp = (GstClockTime) g_value_get_int64 (time_gvalue);
+}
+
+/**
+ * gst_message_parse_segment_done:
+ * @message: A valid #GstMessage of type GST_MESSAGE_SEGMENT_DONE.
+ *
+ * Extracts the timestamp from the segment done message.
+ *
+ * MT safe.
+ */
+void
+gst_message_parse_segment_done (GstMessage * message, GstClockTime * timestamp)
+{
+ const GValue *time_gvalue;
+
+ g_return_if_fail (GST_IS_MESSAGE (message));
+ g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_SEGMENT_DONE);
+
+ time_gvalue = gst_structure_get_value (message->structure, "timstamp");
+ g_return_if_fail (time_gvalue != NULL);
+ g_return_if_fail (G_VALUE_TYPE (time_gvalue) == G_TYPE_INT64);
+
+ if (timestamp)
+ *timestamp = (GstClockTime) g_value_get_int64 (time_gvalue);
+}
GstMessage * gst_message_new_tag (GstObject * src, GstTagList * tag_list);
GstMessage * gst_message_new_state_changed (GstObject * src, GstElementState old_state,
GstElementState new_state);
+GstMessage * gst_message_new_segment_start (GstObject * src, GstClockTime timestamp);
+GstMessage * gst_message_new_segment_done (GstObject * src, GstClockTime timestamp);
GstMessage * gst_message_new_custom (GstMessageType type,
GstObject * src,
GstStructure * structure);
void gst_message_parse_tag (GstMessage *message, GstTagList **tag_list);
void gst_message_parse_state_changed (GstMessage *message, GstElementState *old_state,
GstElementState *new_state);
+void gst_message_parse_segment_start (GstMessage *message, GstClockTime *timestamp);
+void gst_message_parse_segment_done (GstMessage *message, GstClockTime *timestamp);
+
const GstStructure * gst_message_get_structure (GstMessage *message);
G_END_DECLS
GstDPMUpdateMethod update_method);
static GstDParamWrapper *gst_dpman_get_wrapper (GstDParamManager * dpman,
const gchar * dparam_name);
-static void gst_dpman_state_change (GstElement * element, gint old_state,
+static void gst_dpman_state_changed (GstElement * element, gint old_state,
gint new_state, GstDParamManager * dpman);
static gboolean gst_dpman_preprocess_synchronous (GstDParamManager * dpman,
guint frames, gint64 timestamp);
g_hash_table_insert (_element_registry, parent, dpman);
gst_object_set_parent (GST_OBJECT (dpman), GST_OBJECT (parent));
- g_signal_connect (G_OBJECT (parent), "state_change",
- G_CALLBACK (gst_dpman_state_change), dpman);
+ g_signal_connect (G_OBJECT (parent), "state_changed",
+ G_CALLBACK (gst_dpman_state_changed), dpman);
}
/**
static void
-gst_dpman_state_change (GstElement * element, gint old_state, gint new_state,
+gst_dpman_state_changed (GstElement * element, gint old_state, gint new_state,
GstDParamManager * dpman)
{
GList *dwraps;