mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-13 12:51:16 +00:00
avfdeviceprovider: Fix debug category initialization
The device monitor calls into avfvideosrc functions without initializing the debug category, which causes multiple criticals. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7192>
This commit is contained in:
parent
5929829131
commit
65ff618bb6
3 changed files with 16 additions and 2 deletions
|
@ -48,6 +48,8 @@ gst_avf_device_provider_class_init (GstAVFDeviceProviderClass * klass)
|
|||
// https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/886
|
||||
dm_class->probe = gst_avf_device_provider_probe;
|
||||
|
||||
gst_avf_video_src_debug_init ();
|
||||
|
||||
gst_device_provider_class_set_static_metadata (dm_class,
|
||||
"AVF Device Provider", "Source/Video",
|
||||
"List and provide AVF source devices",
|
||||
|
|
|
@ -83,6 +83,7 @@ struct _GstAVFVideoSrcClass
|
|||
|
||||
GType gst_avf_video_src_get_type (void);
|
||||
|
||||
void gst_avf_video_src_debug_init (void);
|
||||
GstCaps *gst_av_capture_device_get_caps (AVCaptureDevice *device, AVCaptureVideoDataOutput *output, GstAVFVideoSourceOrientation orientation);
|
||||
|
||||
G_END_DECLS
|
||||
|
|
|
@ -1181,6 +1181,18 @@ static gboolean gst_avf_video_src_decide_allocation (GstBaseSrc * bsrc,
|
|||
static void gst_avf_video_src_set_context (GstElement * element,
|
||||
GstContext * context);
|
||||
|
||||
void
|
||||
gst_avf_video_src_debug_init (void)
|
||||
{
|
||||
static gsize _init = 0;
|
||||
|
||||
if (g_once_init_enter (&_init)) {
|
||||
GST_DEBUG_CATEGORY_INIT (gst_avf_video_src_debug, "avfvideosrc",
|
||||
0, "iOS/MacOS AVFoundation video source");
|
||||
g_once_init_leave (&_init, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_avf_video_src_class_init (GstAVFVideoSrcClass * klass)
|
||||
{
|
||||
|
@ -1277,8 +1289,7 @@ gst_avf_video_src_class_init (GstAVFVideoSrcClass * klass)
|
|||
0, G_MAXUINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
#endif
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (gst_avf_video_src_debug, "avfvideosrc",
|
||||
0, "iOS/MacOS AVFoundation video source");
|
||||
gst_avf_video_src_debug_init ();
|
||||
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_AVF_VIDEO_SOURCE_POSITION, 0);
|
||||
gst_type_mark_as_plugin_api (GST_TYPE_AVF_VIDEO_SOURCE_ORIENTATION, 0);
|
||||
|
|
Loading…
Reference in a new issue