avfvideosrc: use a dedicated queue for AVFoundation calls

Replace the main queue with a dedicated queue for AVFoundation calls
so the execution on this queue won't block if the main queue
is not running.
This commit is contained in:
Matthieu Bouron 2013-10-28 18:22:13 +00:00 committed by Andoni Morales Alastruey
parent 5d612768a4
commit 7f807270fa

View file

@ -151,9 +151,10 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
deviceIndex = DEFAULT_DEVICE_INDEX;
mainQueue = dispatch_get_main_queue ();
mainQueue =
dispatch_queue_create ("org.freedesktop.gstreamer.avfvideosrc.main", NULL);
workerQueue =
dispatch_queue_create ("org.freedesktop.gstreamer.avfvideosrc", NULL);
dispatch_queue_create ("org.freedesktop.gstreamer.avfvideosrc.output", NULL);
gst_base_src_set_live (baseSrc, TRUE);
gst_base_src_set_format (baseSrc, GST_FORMAT_TIME);
@ -164,6 +165,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
- (void)finalize
{
dispatch_release (mainQueue);
mainQueue = NULL;
dispatch_release (workerQueue);
workerQueue = NULL;