Commit 7865cafe authored by Giorgio Vazzana's avatar Giorgio Vazzana Committed by Michael Niedermayer

lavd/v4l2: simplify list_framesizes()

We can avoid passing file descriptor fd explicitely.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 55cf7d97
...@@ -238,12 +238,12 @@ static int first_field(const struct video_data *s) ...@@ -238,12 +238,12 @@ static int first_field(const struct video_data *s)
} }
#if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE #if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE
static void list_framesizes(AVFormatContext *ctx, int fd, uint32_t pixelformat) static void list_framesizes(AVFormatContext *ctx, uint32_t pixelformat)
{ {
const struct video_data *s = ctx->priv_data; const struct video_data *s = ctx->priv_data;
struct v4l2_frmsizeenum vfse = { .pixel_format = pixelformat }; struct v4l2_frmsizeenum vfse = { .pixel_format = pixelformat };
while(!v4l2_ioctl(fd, VIDIOC_ENUM_FRAMESIZES, &vfse)) { while(!v4l2_ioctl(s->fd, VIDIOC_ENUM_FRAMESIZES, &vfse)) {
switch (vfse.type) { switch (vfse.type) {
case V4L2_FRMSIZE_TYPE_DISCRETE: case V4L2_FRMSIZE_TYPE_DISCRETE:
av_log(ctx, AV_LOG_INFO, " %ux%u", av_log(ctx, AV_LOG_INFO, " %ux%u",
...@@ -296,7 +296,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type) ...@@ -296,7 +296,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type)
av_log(ctx, AV_LOG_INFO, " Emulated :"); av_log(ctx, AV_LOG_INFO, " Emulated :");
#endif #endif
#if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE #if HAVE_STRUCT_V4L2_FRMIVALENUM_DISCRETE
list_framesizes(ctx, fd, vfd.pixelformat); list_framesizes(ctx, vfd.pixelformat);
#endif #endif
av_log(ctx, AV_LOG_INFO, "\n"); av_log(ctx, AV_LOG_INFO, "\n");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment