Fix "Could not find v4l2 muxer"

The AVOutputFormat name is a comma-separated list. In theory, possible
names for V4L2 are:

    - "video4linux2,v4l2"
    - "v4l2,video4linux2"
    - "v4l2"
    - "video4linux2"

To find the muxer in all cases, we must request exactly one muxer name
at a time.

PR #2718 <https://github.com/Genymobile/scrcpy/pull/2718>

Co-authored-by: Romain Vimont <rom@rom1v.com>
Signed-off-by: Romain Vimont <rom@rom1v.com>
pull/2595/merge
zhongkaizhu 3 years ago committed by Romain Vimont
parent 07d75eb336
commit 46d3e35c30

@ -183,8 +183,11 @@ sc_v4l2_sink_open(struct sc_v4l2_sink *vs) {
goto error_mutex_destroy;
}
// FIXME
const AVOutputFormat *format = find_muxer("video4linux2,v4l2");
const AVOutputFormat *format = find_muxer("v4l2");
if (!format) {
// Alternative name
format = find_muxer("video4linux2");
}
if (!format) {
LOGE("Could not find v4l2 muxer");
goto error_cond_destroy;

Loading…
Cancel
Save