mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-12 11:26:39 +00:00
wasapi2, mfvideosrc: Update "dispatcher" property to be only writable
Disallow getting dispatcher pointer, since it doesn't seem to be useful and might not be safe. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1480>
This commit is contained in:
parent
265128e7f7
commit
fc49886c61
3 changed files with 36 additions and 19 deletions
|
@ -144,13 +144,23 @@ gst_mf_video_src_class_init (GstMFVideoSrcClass * klass)
|
||||||
G_PARAM_READWRITE | GST_PARAM_MUTABLE_READY |
|
G_PARAM_READWRITE | GST_PARAM_MUTABLE_READY |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
#if GST_MF_WINAPI_APP
|
#if GST_MF_WINAPI_APP
|
||||||
|
/**
|
||||||
|
* GstMFVideoSrc:dispatcher:
|
||||||
|
*
|
||||||
|
* ICoreDispatcher COM object used for activating device from UI thread.
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_DISPATCHER,
|
g_object_class_install_property (gobject_class, PROP_DISPATCHER,
|
||||||
g_param_spec_pointer ("dispatcher", "Dispatcher",
|
g_param_spec_pointer ("dispatcher", "Dispatcher",
|
||||||
"ICoreDispatcher COM object to use. In order for application to ask "
|
"ICoreDispatcher COM object to use. In order for application to ask "
|
||||||
"permission of capture device, device activation should be running "
|
"permission of capture device, device activation should be running "
|
||||||
"on UI thread via ICoreDispatcher",
|
"on UI thread via ICoreDispatcher. This element will increase "
|
||||||
|
"the reference count of given ICoreDispatcher and release it after "
|
||||||
|
"use. Therefore, caller does not need to consider additional "
|
||||||
|
"reference count management",
|
||||||
GST_PARAM_CONDITIONALLY_AVAILABLE | GST_PARAM_MUTABLE_READY |
|
GST_PARAM_CONDITIONALLY_AVAILABLE | GST_PARAM_MUTABLE_READY |
|
||||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_element_class_set_static_metadata (element_class,
|
gst_element_class_set_static_metadata (element_class,
|
||||||
|
@ -212,11 +222,6 @@ gst_mf_video_src_get_property (GObject * object, guint prop_id, GValue * value,
|
||||||
case PROP_DEVICE_INDEX:
|
case PROP_DEVICE_INDEX:
|
||||||
g_value_set_int (value, self->device_index);
|
g_value_set_int (value, self->device_index);
|
||||||
break;
|
break;
|
||||||
#if GST_MF_WINAPI_APP
|
|
||||||
case PROP_DISPATCHER:
|
|
||||||
g_value_set_pointer (value, self->dispatcher);
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -159,13 +159,22 @@ gst_wasapi2_sink_class_init (GstWasapi2SinkClass * klass)
|
||||||
GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE |
|
GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstWasapi2Sink:dispatcher:
|
||||||
|
*
|
||||||
|
* ICoreDispatcher COM object used for activating device from UI thread.
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_DISPATCHER,
|
g_object_class_install_property (gobject_class, PROP_DISPATCHER,
|
||||||
g_param_spec_pointer ("dispatcher", "Dispatcher",
|
g_param_spec_pointer ("dispatcher", "Dispatcher",
|
||||||
"ICoreDispatcher COM object to use. In order for application to ask "
|
"ICoreDispatcher COM object to use. In order for application to ask "
|
||||||
"permission of audio device, device activation should be running "
|
"permission of audio device, device activation should be running "
|
||||||
"on UI thread via ICoreDispatcher",
|
"on UI thread via ICoreDispatcher. This element will increase "
|
||||||
GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE |
|
"the reference count of given ICoreDispatcher and release it after "
|
||||||
G_PARAM_STATIC_STRINGS));
|
"use. Therefore, caller does not need to consider additional "
|
||||||
|
"reference count management",
|
||||||
|
GST_PARAM_MUTABLE_READY | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gst_element_class_add_static_pad_template (element_class, &sink_template);
|
gst_element_class_add_static_pad_template (element_class, &sink_template);
|
||||||
gst_element_class_set_static_metadata (element_class, "Wasapi2Sink",
|
gst_element_class_set_static_metadata (element_class, "Wasapi2Sink",
|
||||||
|
@ -271,9 +280,6 @@ gst_wasapi2_sink_get_property (GObject * object, guint prop_id,
|
||||||
case PROP_VOLUME:
|
case PROP_VOLUME:
|
||||||
g_value_set_double (value, gst_wasapi2_sink_get_volume (self));
|
g_value_set_double (value, gst_wasapi2_sink_get_volume (self));
|
||||||
break;
|
break;
|
||||||
case PROP_DISPATCHER:
|
|
||||||
g_value_set_pointer (value, self->dispatcher);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -156,13 +156,22 @@ gst_wasapi2_src_class_init (GstWasapi2SrcClass * klass)
|
||||||
GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE |
|
GST_PARAM_MUTABLE_PLAYING | G_PARAM_READWRITE |
|
||||||
G_PARAM_STATIC_STRINGS));
|
G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GstWasapi2Src:dispatcher:
|
||||||
|
*
|
||||||
|
* ICoreDispatcher COM object used for activating device from UI thread.
|
||||||
|
*
|
||||||
|
* Since: 1.18
|
||||||
|
*/
|
||||||
g_object_class_install_property (gobject_class, PROP_DISPATCHER,
|
g_object_class_install_property (gobject_class, PROP_DISPATCHER,
|
||||||
g_param_spec_pointer ("dispatcher", "Dispatcher",
|
g_param_spec_pointer ("dispatcher", "Dispatcher",
|
||||||
"ICoreDispatcher COM object to use. In order for application to ask "
|
"ICoreDispatcher COM object to use. In order for application to ask "
|
||||||
"permission of audio device, device activation should be running "
|
"permission of audio device, device activation should be running "
|
||||||
"on UI thread via ICoreDispatcher",
|
"on UI thread via ICoreDispatcher. This element will increase "
|
||||||
GST_PARAM_MUTABLE_READY | G_PARAM_READWRITE |
|
"the reference count of given ICoreDispatcher and release it after "
|
||||||
G_PARAM_STATIC_STRINGS));
|
"use. Therefore, caller does not need to consider additional "
|
||||||
|
"reference count management",
|
||||||
|
GST_PARAM_MUTABLE_READY | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
gst_element_class_add_static_pad_template (element_class, &src_template);
|
gst_element_class_add_static_pad_template (element_class, &src_template);
|
||||||
gst_element_class_set_static_metadata (element_class, "Wasapi2Src",
|
gst_element_class_set_static_metadata (element_class, "Wasapi2Src",
|
||||||
|
@ -268,9 +277,6 @@ gst_wasapi2_src_get_property (GObject * object, guint prop_id,
|
||||||
case PROP_VOLUME:
|
case PROP_VOLUME:
|
||||||
g_value_set_double (value, gst_wasapi2_src_get_volume (self));
|
g_value_set_double (value, gst_wasapi2_src_get_volume (self));
|
||||||
break;
|
break;
|
||||||
case PROP_DISPATCHER:
|
|
||||||
g_value_set_pointer (value, self->dispatcher);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue