mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-09-26 21:03:43 +08:00
v4l2: use always channel 0 if driver does not return it. Always ignore device select / set errors
This commit is contained in:
@@ -980,8 +980,11 @@ static int v4l2_read_header(AVFormatContext *ctx)
|
||||
/* get current video input */
|
||||
if (v4l2_ioctl(s->fd, VIDIOC_G_INPUT, &s->channel) < 0) {
|
||||
res = AVERROR(errno);
|
||||
av_log(ctx, AV_LOG_ERROR, "ioctl(VIDIOC_G_INPUT): %s\n", av_err2str(res));
|
||||
av_log(ctx, (s->ignore_input_error) ? AV_LOG_WARNING : AV_LOG_ERROR, "ioctl(VIDIOC_G_INPUT): %s\n", av_err2str(res));
|
||||
if (!s->ignore_input_error)
|
||||
goto fail;
|
||||
else
|
||||
s->channel = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1216,7 +1219,7 @@ static const AVOption options[] = {
|
||||
{ "pixel_format", "set preferred pixel format", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
||||
{ "input_format", "set preferred pixel format (for raw video) or codec name", OFFSET(pixel_format), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
||||
{ "framerate", "set frame rate", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
|
||||
{ "ignore_input_error", "ignore input error", OFFSET(ignore_input_error), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, DEC },
|
||||
{ "ignore_input_error", "ignore input error", OFFSET(ignore_input_error), AV_OPT_TYPE_BOOL, {.i64 = 1 }, 0, 1, DEC },
|
||||
|
||||
{ "list_formats", "list available formats and exit", OFFSET(list_format), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, DEC, "list_formats" },
|
||||
{ "all", "show all available formats", OFFSET(list_format), AV_OPT_TYPE_CONST, {.i64 = V4L_ALLFORMATS }, 0, INT_MAX, DEC, "list_formats" },
|
||||
|
Reference in New Issue
Block a user