105
105
{GST_MESSAGE_QOS, "qos", 0},
106
106
{GST_MESSAGE_PROGRESS, "progress", 0},
107
107
{GST_MESSAGE_TOC, "toc", 0},
108
{GST_MESSAGE_STREAM_START, "stream-start", 0},
198
199
gst_structure_free (structure);
201
g_slice_free1 (GST_MINI_OBJECT_SIZE (message), message);
202
g_slice_free1 (sizeof (GstMessageImpl), message);
205
gst_message_init (GstMessageImpl * message, gsize size, GstMessageType type,
206
gst_message_init (GstMessageImpl * message, GstMessageType type,
206
207
GstObject * src);
208
209
static GstMessage *
218
219
copy = g_slice_new0 (GstMessageImpl);
220
gst_message_init (copy, sizeof (GstMessageImpl), GST_MESSAGE_TYPE (message),
221
gst_message_init (copy, GST_MESSAGE_TYPE (message),
221
222
GST_MESSAGE_SRC (message));
223
224
GST_MESSAGE_TIMESTAMP (copy) = GST_MESSAGE_TIMESTAMP (message);
239
gst_message_init (GstMessageImpl * message, gsize size, GstMessageType type,
240
gst_message_init (GstMessageImpl * message, GstMessageType type,
242
gst_mini_object_init (GST_MINI_OBJECT_CAST (message), _gst_message_type,
245
message->message.mini_object.copy =
246
(GstMiniObjectCopyFunction) _gst_message_copy;
247
message->message.mini_object.free =
248
(GstMiniObjectFreeFunction) _gst_message_free;
243
gst_mini_object_init (GST_MINI_OBJECT_CAST (message), 0, _gst_message_type,
244
(GstMiniObjectCopyFunction) _gst_message_copy, NULL,
245
(GstMiniObjectFreeFunction) _gst_message_free);
250
247
GST_MESSAGE_TYPE (message) = type;
289
286
&message->message.mini_object.refcount))
292
gst_message_init (message, sizeof (GstMessageImpl), type, src);
289
gst_message_init (message, type, src);
294
291
GST_MESSAGE_STRUCTURE (message) = structure;
508
499
* The application must be prepared to receive BUFFERING messages in the
509
500
* PREROLLING state and may only set the pipeline to PLAYING after receiving a
510
501
* message with @percent set to 100, which can happen after the pipeline
511
* completed prerolling.
502
* completed prerolling.
515
506
* Returns: (transfer full): The new buffering message.
520
509
gst_message_new_buffering (GstObject * src, gint percent)
522
511
GstMessage *message;
523
512
GstStructure *structure;
513
gint64 buffering_left;
525
515
g_return_val_if_fail (percent >= 0 && percent <= 100, NULL);
517
buffering_left = (percent == 100 ? 0 : -1);
527
519
structure = gst_structure_new_id (GST_QUARK (MESSAGE_BUFFERING),
528
520
GST_QUARK (BUFFER_PERCENT), G_TYPE_INT, percent,
529
521
GST_QUARK (BUFFERING_MODE), GST_TYPE_BUFFERING_MODE, GST_BUFFERING_STREAM,
530
522
GST_QUARK (AVG_IN_RATE), G_TYPE_INT, -1,
531
523
GST_QUARK (AVG_OUT_RATE), G_TYPE_INT, -1,
532
GST_QUARK (BUFFERING_LEFT), G_TYPE_INT64, G_GINT64_CONSTANT (-1),
533
GST_QUARK (ESTIMATED_TOTAL), G_TYPE_INT64, G_GINT64_CONSTANT (-1), NULL);
524
GST_QUARK (BUFFERING_LEFT), G_TYPE_INT64, buffering_left, NULL);
534
525
message = gst_message_new_custom (GST_MESSAGE_BUFFERING, src, structure);
557
548
GstMessage *message;
558
549
GstStructure *structure;
560
structure = gst_structure_new_id (GST_QUARK (MESSAGE_STATE),
551
structure = gst_structure_new_id (GST_QUARK (MESSAGE_STATE_CHANGED),
561
552
GST_QUARK (OLD_STATE), GST_TYPE_STATE, (gint) oldstate,
562
553
GST_QUARK (NEW_STATE), GST_TYPE_STATE, (gint) newstate,
563
554
GST_QUARK (PENDING_STATE), GST_TYPE_STATE, (gint) pending, NULL);
871
860
* gst_message_new_async_done:
872
861
* @src: (transfer none): The object originating the message.
873
* @reset_time: if the running_time should be reset
862
* @running_time: the desired running_time
875
864
* The message is posted when elements completed an ASYNC state change.
876
* @reset_time is set to TRUE when the element requests a new running_time
877
* before going to PLAYING.
865
* @running_time contains the time of the desired running_time when this
866
* elements goes to PLAYING. A value of #GST_CLOCK_TIME_NONE for @running_time
867
* means that the element has no clock interaction and thus doesn't care about
868
* the running_time of the pipeline.
879
870
* Returns: (transfer full): The new async_done message.
884
gst_message_new_async_done (GstObject * src, gboolean reset_time)
875
gst_message_new_async_done (GstObject * src, GstClockTime running_time)
886
877
GstMessage *message;
887
878
GstStructure *structure;
889
880
structure = gst_structure_new_id (GST_QUARK (MESSAGE_ASYNC_DONE),
890
GST_QUARK (RESET_TIME), G_TYPE_BOOLEAN, reset_time, NULL);
881
GST_QUARK (RUNNING_TIME), G_TYPE_UINT64, running_time, NULL);
891
882
message = gst_message_new_custom (GST_MESSAGE_ASYNC_DONE, src, structure);
1543
1518
* gst_message_parse_async_done:
1544
1519
* @message: A valid #GstMessage of type GST_MESSAGE_ASYNC_DONE.
1545
* @reset_time: (out): Result location for the reset_time or NULL
1520
* @running_time: (out): Result location for the running_time or NULL
1547
* Extract the reset_time from the async_done message.
1522
* Extract the running_time from the async_done message.
1552
gst_message_parse_async_done (GstMessage * message, gboolean * reset_time)
1527
gst_message_parse_async_done (GstMessage * message, GstClockTime * running_time)
1554
1529
GstStructure *structure;
1557
1532
g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_ASYNC_DONE);
1559
1534
structure = GST_MESSAGE_STRUCTURE (message);
1562
g_value_get_boolean (gst_structure_id_get_value (structure,
1563
GST_QUARK (RESET_TIME)));
1537
g_value_get_uint64 (gst_structure_id_get_value (structure,
1538
GST_QUARK (RUNNING_TIME)));
2177
2118
* gst_message_new_toc:
2178
2119
* @src: the object originating the message.
2179
* @toc: #GstToc structure for the message.
2120
* @toc: (transfer none): #GstToc structure for the message.
2180
2121
* @updated: whether TOC was updated or not.
2182
2123
* Create a new TOC message. The message is posted by elements
2183
2124
* that discovered or updated a TOC.
2185
* Returns: a new TOC message.
2126
* Returns: (transfer full): a new TOC message.
2192
2131
gst_message_new_toc (GstObject * src, GstToc * toc, gboolean updated)
2196
2135
g_return_val_if_fail (toc != NULL, NULL);
2198
toc_struct = __gst_toc_to_structure (toc);
2137
toc_struct = gst_structure_new_id (GST_QUARK (MESSAGE_TOC),
2138
GST_QUARK (TOC), GST_TYPE_TOC, toc,
2139
GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL);
2200
if (G_LIKELY (toc_struct != NULL)) {
2201
__gst_toc_structure_set_updated (toc_struct, updated);
2202
return gst_message_new_custom (GST_MESSAGE_TOC, src, toc_struct);
2141
return gst_message_new_custom (GST_MESSAGE_TOC, src, toc_struct);
2208
2145
* gst_message_parse_toc:
2209
2146
* @message: a valid #GstMessage of type GST_MESSAGE_TOC.
2210
* @toc: (out): return location for the TOC.
2147
* @toc: (out) (transfer full): return location for the TOC.
2211
2148
* @updated: (out): return location for the updated flag.
2213
2150
* Extract thef TOC from the #GstMessage. The TOC returned in the
2214
2151
* output argument is a copy; the caller must free it with
2215
* gst_toc_free() when done.
2152
* gst_toc_unref() when done.
2222
2157
gst_message_parse_toc (GstMessage * message, GstToc ** toc, gboolean * updated)
2225
2160
g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_TOC);
2226
2161
g_return_if_fail (toc != NULL);
2228
*toc = __gst_toc_from_structure (GST_MESSAGE_STRUCTURE (message));
2230
if (updated != NULL)
2232
__gst_toc_structure_get_updated (GST_MESSAGE_STRUCTURE (message));
2163
gst_structure_id_get (GST_MESSAGE_STRUCTURE (message),
2164
GST_QUARK (TOC), GST_TYPE_TOC, toc,
2165
GST_QUARK (UPDATED), G_TYPE_BOOLEAN, updated, NULL);
2169
* gst_message_new_reset_time:
2170
* @src: (transfer none): The object originating the message.
2171
* @running_time: the requested running-time
2173
* This message is posted when the pipeline running-time should be reset to
2174
* @running_time, like after a flushing seek.
2176
* Returns: (transfer full): The new reset_time message.
2181
gst_message_new_reset_time (GstObject * src, GstClockTime running_time)
2183
GstMessage *message;
2184
GstStructure *structure;
2186
structure = gst_structure_new_id (GST_QUARK (MESSAGE_RESET_TIME),
2187
GST_QUARK (RUNNING_TIME), G_TYPE_UINT64, running_time, NULL);
2188
message = gst_message_new_custom (GST_MESSAGE_RESET_TIME, src, structure);
2194
* gst_message_parse_reset_time:
2195
* @message: A valid #GstMessage of type GST_MESSAGE_RESET_TIME.
2196
* @running_time: (out): Result location for the running_time or NULL
2198
* Extract the running-time from the RESET_TIME message.
2203
gst_message_parse_reset_time (GstMessage * message, GstClockTime * running_time)
2205
GstStructure *structure;
2207
g_return_if_fail (GST_IS_MESSAGE (message));
2208
g_return_if_fail (GST_MESSAGE_TYPE (message) == GST_MESSAGE_RESET_TIME);
2210
structure = GST_MESSAGE_STRUCTURE (message);
2213
g_value_get_uint64 (gst_structure_id_get_value (structure,
2214
GST_QUARK (RUNNING_TIME)));
2218
* gst_message_new_stream_start:
2219
* @src: (transfer none): The object originating the message.
2221
* Create a new stream_start message. This message is generated and posted in
2222
* the sink elements of a GstBin. The bin will only forward the STREAM_START
2223
* message to the application if all sinks have posted an STREAM_START message.
2225
* Returns: (transfer full): The new stream_start message.
2230
gst_message_new_stream_start (GstObject * src)
2232
GstMessage *message;
2234
message = gst_message_new_custom (GST_MESSAGE_STREAM_START, src, NULL);