mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-13 12:51:16 +00:00
media: emit prepared signal when prepared
Make a 'prepared' signal and emit it when we successfully prepared the element. This signal can be used to configure the media object after it has been prepared for streaming.
This commit is contained in:
parent
7dfb91e289
commit
1ea450179e
2 changed files with 9 additions and 0 deletions
|
@ -46,6 +46,7 @@ enum
|
|||
|
||||
enum
|
||||
{
|
||||
SIGNAL_PREPARED,
|
||||
SIGNAL_UNPREPARED,
|
||||
SIGNAL_LAST
|
||||
};
|
||||
|
@ -103,6 +104,11 @@ gst_rtsp_media_class_init (GstRTSPMediaClass * klass)
|
|||
"Send an EOS event to the pipeline before unpreparing",
|
||||
DEFAULT_EOS_SHUTDOWN, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_rtsp_media_signals[SIGNAL_PREPARED] =
|
||||
g_signal_new ("prepared", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstRTSPMediaClass, prepared), NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0, G_TYPE_NONE);
|
||||
|
||||
gst_rtsp_media_signals[SIGNAL_UNPREPARED] =
|
||||
g_signal_new ("unprepared", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (GstRTSPMediaClass, unprepared), NULL, NULL,
|
||||
|
@ -1592,6 +1598,8 @@ gst_rtsp_media_prepare (GstRTSPMedia * media)
|
|||
if (status == GST_RTSP_MEDIA_STATUS_ERROR)
|
||||
goto state_failed;
|
||||
|
||||
g_signal_emit (media, gst_rtsp_media_signals[SIGNAL_PREPARED], 0, NULL);
|
||||
|
||||
GST_INFO ("object %p is prerolled", media);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -250,6 +250,7 @@ struct _GstRTSPMediaClass {
|
|||
gboolean (*unprepare) (GstRTSPMedia *media);
|
||||
|
||||
/* signals */
|
||||
gboolean (*prepared) (GstRTSPMedia *media);
|
||||
gboolean (*unprepared) (GstRTSPMedia *media);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue