mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
media-factory: add media-configure signal
Add signal to allow the application to configure the media after it was created from the factory.
This commit is contained in:
parent
b66fe25869
commit
8684fc5c69
2 changed files with 12 additions and 0 deletions
|
@ -39,6 +39,7 @@ enum
|
|||
enum
|
||||
{
|
||||
SIGNAL_MEDIA_CONSTRUCTED,
|
||||
SIGNAL_MEDIA_CONFIGURE,
|
||||
SIGNAL_LAST
|
||||
};
|
||||
|
||||
|
@ -124,6 +125,12 @@ gst_rtsp_media_factory_class_init (GstRTSPMediaFactoryClass * klass)
|
|||
media_constructed), NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, GST_TYPE_RTSP_MEDIA);
|
||||
|
||||
gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONFIGURE] =
|
||||
g_signal_new ("media-configure", G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstRTSPMediaFactoryClass,
|
||||
media_configure), NULL, NULL, g_cclosure_marshal_VOID__OBJECT,
|
||||
G_TYPE_NONE, 1, GST_TYPE_RTSP_MEDIA);
|
||||
|
||||
klass->gen_key = default_gen_key;
|
||||
klass->get_element = default_get_element;
|
||||
klass->construct = default_construct;
|
||||
|
@ -576,6 +583,10 @@ gst_rtsp_media_factory_construct (GstRTSPMediaFactory * factory,
|
|||
if (klass->configure)
|
||||
klass->configure (factory, media);
|
||||
|
||||
g_signal_emit (factory,
|
||||
gst_rtsp_media_factory_signals[SIGNAL_MEDIA_CONFIGURE], 0, media,
|
||||
NULL);
|
||||
|
||||
/* check if we can cache this media */
|
||||
if (gst_rtsp_media_is_shared (media)) {
|
||||
/* insert in the hashtable, takes ownership of the key */
|
||||
|
|
|
@ -103,6 +103,7 @@ struct _GstRTSPMediaFactoryClass {
|
|||
|
||||
/* signals */
|
||||
void (*media_constructed) (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
|
||||
void (*media_configure) (GstRTSPMediaFactory *factory, GstRTSPMedia *media);
|
||||
};
|
||||
|
||||
GType gst_rtsp_media_factory_get_type (void);
|
||||
|
|
Loading…
Reference in a new issue