avfvideosrc: Report latency when doing screen capture
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 16 Dec 2022 19:31:00 +0000 (01:01 +0530)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 16 Dec 2022 23:58:07 +0000 (23:58 +0000)
There is no `device` when doing screen capture, but there is always an
`input`, so use that to decide when we can reply to a latency query.
Without this, the latency query just fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3589>

subprojects/gst-plugins-bad/sys/applemedia/avfvideosrc.m

index 97f7e42..04057a9 100644 (file)
@@ -966,7 +966,7 @@ checked:
   BOOL result = NO;
 
   if (GST_QUERY_TYPE (query) == GST_QUERY_LATENCY) {
-    if (device != nil && caps != NULL) {
+    if (input != nil && caps != NULL) {
       GstClockTime min_latency, max_latency;
 
       min_latency = max_latency = latency;