]> www.infradead.org Git - pidgin-chime.git/commitdiff
Fix outbound screenshare dropouts
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 22 Nov 2019 21:02:55 +0000 (21:02 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 22 Nov 2019 21:02:55 +0000 (21:02 +0000)
I think I've found the reason, along with the reason I could never
reproduce it on demand. The videorate element insists on producing
precisely one output frame for every third of the second... since the
epoch (when GStreamer started up). Not from the start of the call.

So if you've only been running Pidgin for a few seconds and you make
a test call, and it's the first GStreamer pipeline, it all works fine.

Hang up, wait an hour and then share another screen, and it'll send
10800 duplicate copies of the first frame before it ever sends anything
else.

prpl/chat.c

index 54cfe5aaff7e250ede530e2877fddc57c81cc1b6..e20cc95273baf2d560469778dee14e55286dda69 100644 (file)
@@ -576,7 +576,7 @@ static void share_screen(gpointer _chat, PurpleMediaElementInfo *info)
        }
 
        gchar *sinkname = g_strdup_printf("chime_screen_sink_%p", chat->call);
-       gchar *sinkpipe = g_strdup_printf("videorate ! video/x-raw,framerate=3/1 ! videoconvert ! vp8enc min-quantizer=15 max-quantizer=25 target-bitrate=256000 deadline=1 ! appsink name=%s async=false", sinkname);
+       gchar *sinkpipe = g_strdup_printf("videorate drop-only=1 max-rate=3 ! videoconvert ! vp8enc min-quantizer=15 max-quantizer=25 target-bitrate=256000 deadline=1 ! appsink name=%s async=false", sinkname);
        PurpleMediaCandidate *cand =
                purple_media_candidate_new(NULL, 1,
                                           PURPLE_MEDIA_CANDIDATE_TYPE_HOST,