From patchwork Sat Sep 2 22:26:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgQsWTc2No?= X-Patchwork-Id: 4960 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1821217jao; Sat, 2 Sep 2017 15:26:50 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6+ulR7BxCUHXahBrU6yATwJvxCk1rTdkWnQd82gb+e5mSV+eu7Y2fBrPFxS4XTBiSFZWaP X-Received: by 10.28.185.12 with SMTP id j12mr1226367wmf.100.1504391210465; Sat, 02 Sep 2017 15:26:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504391210; cv=none; d=google.com; s=arc-20160816; b=hVlCfXQFxPUiUhR3HZ4EvUeDG5y5jsHOhejgQZqZcrYU5xWJcUDZI5ibmSEFE7DsBF krVQiJHth0fTXNmVMvJ1Bs5BPC9owEqn0EwDWxvtQ8KBto9AkIDhM1+CFUUUWLtbRqgh bg2OY6urmc9fna/uCgCAziE1IkCf7bSOtWW3bvErVqTQdlLyY2N8ziTwJ9JmnHeYuh/e bRvbeJTy54cF+lpptKyjtmr/sDGy3CoOJG5mNT+2c4iFfbFtP2IqI02I2h4wZRmPWijJ +U6ukSJtLSghqtSGz8zafZAAP1s8ilFFQ9qUL2k4xKkwAiBKLL0Mfb+1M3H4HFEK+dtp lSzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from :domainkey-signature:dkim-signature:delivered-to :arc-authentication-results; bh=TU8fFln/+LiTa+xkkf31wrj6r6XYjJIYBLx0nX2XAdE=; b=fl4cHTR5yRGjd0gPxbzBx7WKCTjg73oQbP5fwx5ZCqZwDpxkiIbp1KbF5xcIJV0tc+ 4aqYR5W32PbrMUVOxvVT3HbAlVY8N0JwfVuRuB1E00xDcJ7R45OLJGqTCGRoAA0OUJUy GpAen27DZVED1ZidaW9p1iUq+gLwGd4qhlD8JltVivtpVXV4ROYcsO1NL1TK8aTCcGWz CTvswcPB8hcVceCJjUxm1xgE3iZ5QAVEFl2fvivq5okS7ymt+bZiOE84W9q9ezwXhjxX nnzjeRH3gLeIaAp9HCIk0bjgIKYPrb11QLihOub6O5XiN9nPYgGvwcn89vnGgIaCCjVH u8GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=Vg6+OqST; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id m127si2398269wmm.141.2017.09.02.15.26.49; Sat, 02 Sep 2017 15:26:50 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@pkh.me header.s=selector1 header.b=Vg6+OqST; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0C108689EC6; Sun, 3 Sep 2017 01:26:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from golem.pkh.me (LStLambert-657-1-117-164.w92-154.abo.wanadoo.fr [92.154.28.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7DDD9689BE2 for ; Sun, 3 Sep 2017 01:26:40 +0300 (EEST) Received: from golem.pkh.me (localhost.localdomain [127.0.0.1]) by golem.pkh.me (OpenSMTPD) with ESMTP id 30cef1f2 for ; Sat, 2 Sep 2017 22:26:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pkh.me; h=from:to:cc :subject:date:message-id; s=selector1; bh=syVolLwlj3pNba1ys6NpyU HRbak=; b=Vg6+OqSTRp94Lb6XJ3/mozwOpnSNwN/p3WEVbTrfuXPQDsTAgs/5Sq gKNTC4jgbplxDGRmKkej6MSulKhjXFyCJqD3wwsa+D6hFZFDlICpLfPAeRZdMSVV qAax2g9JoDAohmbRIr3bIQVGSOzJhx9ocNHbrd/s0DUfjdMscOSzDjp1rUQFTCq7 J+52LGVVItacKHQLcR3rGLSbeWELb9FBbOifATpFMlIX4POnPY5lYf9qK8sRTdDX ckIFWYNHwh68yIXEyckIxgt3Sj7LiDx2QDIAdhU2VAsupp+JTLJ7JkpJ1JjBQrIU xaFsxGKf+I0Oknri1N0QCOX5H9qpqH/w== DomainKey-Signature: a=rsa-sha1; c=nofws; d=pkh.me; h=from:to:cc:subject :date:message-id; q=dns; s=selector1; b=IFrZc8twjpIFYKCxuBd1u/a4 1GSiy+wbnbHQwuZdiWSiptwF9HVeZ+DH++8m/8R4QG2wEwS0BhKSCQnMg/fBHI/2 nKFK2ZPKMpyASqn3uGdMDYzefcju4FdQ7GmvhaiykLIgJ1Ng6RJ3YhwZd0IJIkb8 WKlpos9C3qZHHiSsUbUg1tUdxINAOju6ESPkaxAD3UNnA8W80fOGgQvAKfx/9JCn qonGUUJU/vchSlB021s5UjusWUlCFBkY+tPIVvb5p3+iWk42Uk5oI50hiunOU9VP Fd1hioRr4wxrNYPtC9L9Bp6S57c5CC9ga4ChMvIpWNV4NNy1QhpZ1SdBapYOqw== Received: from localhost (golem.pkh.me [local]) by golem.pkh.me (OpenSMTPD) with ESMTPA id d30a2d80; Sat, 2 Sep 2017 22:26:41 +0000 (UTC) From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= To: ffmpeg-devel@ffmpeg.org Date: Sun, 3 Sep 2017 00:26:40 +0200 Message-Id: <20170902222640.23974-1-u@pkh.me> X-Mailer: git-send-email 2.14.1 Subject: [FFmpeg-devel] [PATCH] lavd: drop disabled v4l code X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This code is disabled since 2012. V4L1 was dropped from the kernel more than 10 years ago. --- configure | 2 - libavdevice/Makefile | 1 - libavdevice/alldevices.c | 1 - libavdevice/v4l.c | 364 ----------------------------------------------- 4 files changed, 368 deletions(-) delete mode 100644 libavdevice/v4l.c diff --git a/configure b/configure index 445d953e4f..d58270550c 100755 --- a/configure +++ b/configure @@ -3048,7 +3048,6 @@ qtkit_indev_select="qtkit" sdl2_outdev_deps="sdl2" sndio_indev_deps="sndio" sndio_outdev_deps="sndio" -v4l_indev_deps="linux_videodev_h" v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h" vfwcap_indev_deps="vfw32 vfwcap_defines" @@ -6079,7 +6078,6 @@ pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout check_header linux/fb.h -check_header linux/videodev.h check_header linux/videodev2.h check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete diff --git a/libavdevice/Makefile b/libavdevice/Makefile index cd077b292e..0efb3f905f 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -47,7 +47,6 @@ OBJS-$(CONFIG_SNDIO_INDEV) += sndio_dec.o sndio.o OBJS-$(CONFIG_SNDIO_OUTDEV) += sndio_enc.o sndio.o OBJS-$(CONFIG_V4L2_INDEV) += v4l2.o v4l2-common.o timefilter.o OBJS-$(CONFIG_V4L2_OUTDEV) += v4l2enc.o v4l2-common.o -OBJS-$(CONFIG_V4L_INDEV) += v4l.o OBJS-$(CONFIG_VFWCAP_INDEV) += vfwcap.o OBJS-$(CONFIG_XCBGRAB_INDEV) += xcbgrab.o OBJS-$(CONFIG_XV_OUTDEV) += xv.o diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c index 8d1cb8648f..4bf08d798d 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c @@ -62,7 +62,6 @@ static void register_all(void) REGISTER_OUTDEV (SDL2, sdl2); REGISTER_INOUTDEV(SNDIO, sndio); REGISTER_INOUTDEV(V4L2, v4l2); -// REGISTER_INDEV (V4L, v4l REGISTER_INDEV (VFWCAP, vfwcap); REGISTER_INDEV (XCBGRAB, xcbgrab); REGISTER_OUTDEV (XV, xv); diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c deleted file mode 100644 index 81653e02fb..0000000000 --- a/libavdevice/v4l.c +++ /dev/null @@ -1,364 +0,0 @@ -/* - * Linux video grab interface - * Copyright (c) 2000,2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "avdevice.h" - -#undef __STRICT_ANSI__ //workaround due to broken kernel headers -#include "config.h" -#include "libavutil/rational.h" -#include "libavutil/imgutils.h" -#include "libavutil/internal.h" -#include "libavutil/log.h" -#include "libavutil/opt.h" -#include "libavformat/internal.h" -#include "libavcodec/dsputil.h" -#include -#include -#include -#include -#include -#define _LINUX_TIME_H 1 -#include -#include - -typedef struct { - AVClass *class; - int fd; - int frame_format; /* see VIDEO_PALETTE_xxx */ - int use_mmap; - AVRational time_base; - int64_t time_frame; - int frame_size; - struct video_capability video_cap; - struct video_audio audio_saved; - struct video_window video_win; - uint8_t *video_buf; - struct video_mbuf gb_buffers; - struct video_mmap gb_buf; - int gb_frame; - int standard; -} VideoData; - -static const struct { - int palette; - int depth; - enum AVPixelFormat pix_fmt; -} video_formats [] = { - {.palette = VIDEO_PALETTE_YUV420P, .depth = 12, .pix_fmt = AV_PIX_FMT_YUV420P }, - {.palette = VIDEO_PALETTE_YUV422, .depth = 16, .pix_fmt = AV_PIX_FMT_YUYV422 }, - {.palette = VIDEO_PALETTE_UYVY, .depth = 16, .pix_fmt = AV_PIX_FMT_UYVY422 }, - {.palette = VIDEO_PALETTE_YUYV, .depth = 16, .pix_fmt = AV_PIX_FMT_YUYV422 }, - /* NOTE: v4l uses BGR24, not RGB24 */ - {.palette = VIDEO_PALETTE_RGB24, .depth = 24, .pix_fmt = AV_PIX_FMT_BGR24 }, - {.palette = VIDEO_PALETTE_RGB565, .depth = 16, .pix_fmt = AV_PIX_FMT_BGR565 }, - {.palette = VIDEO_PALETTE_GREY, .depth = 8, .pix_fmt = AV_PIX_FMT_GRAY8 }, -}; - - -static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) -{ - VideoData *s = s1->priv_data; - AVStream *st; - int video_fd; - int desired_palette, desired_depth; - struct video_tuner tuner; - struct video_audio audio; - struct video_picture pict; - int j; - int vformat_num = FF_ARRAY_ELEMS(video_formats); - - av_log(s1, AV_LOG_WARNING, "V4L input device is deprecated and will be removed in the next release."); - - if (ap->time_base.den <= 0) { - av_log(s1, AV_LOG_ERROR, "Wrong time base (%d)\n", ap->time_base.den); - return -1; - } - s->time_base = ap->time_base; - - s->video_win.width = ap->width; - s->video_win.height = ap->height; - - st = avformat_new_stream(s1, NULL); - if (!st) - return AVERROR(ENOMEM); - avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */ - - video_fd = open(s1->filename, O_RDWR); - if (video_fd < 0) { - av_log(s1, AV_LOG_ERROR, "%s: %s\n", s1->filename, strerror(errno)); - goto fail; - } - - if (ioctl(video_fd, VIDIOCGCAP, &s->video_cap) < 0) { - av_log(s1, AV_LOG_ERROR, "VIDIOCGCAP: %s\n", strerror(errno)); - goto fail; - } - - if (!(s->video_cap.type & VID_TYPE_CAPTURE)) { - av_log(s1, AV_LOG_ERROR, "Fatal: grab device does not handle capture\n"); - goto fail; - } - - /* no values set, autodetect them */ - if (s->video_win.width <= 0 || s->video_win.height <= 0) { - if (ioctl(video_fd, VIDIOCGWIN, &s->video_win, sizeof(s->video_win)) < 0) { - av_log(s1, AV_LOG_ERROR, "VIDIOCGWIN: %s\n", strerror(errno)); - goto fail; - } - } - - if(av_image_check_size(s->video_win.width, s->video_win.height, 0, s1) < 0) - return -1; - - desired_palette = -1; - desired_depth = -1; - for (j = 0; j < vformat_num; j++) { - if (ap->pix_fmt == video_formats[j].pix_fmt) { - desired_palette = video_formats[j].palette; - desired_depth = video_formats[j].depth; - break; - } - } - - /* set tv standard */ - if (!ioctl(video_fd, VIDIOCGTUNER, &tuner)) { - tuner.mode = s->standard; - ioctl(video_fd, VIDIOCSTUNER, &tuner); - } - - /* unmute audio */ - audio.audio = 0; - ioctl(video_fd, VIDIOCGAUDIO, &audio); - memcpy(&s->audio_saved, &audio, sizeof(audio)); - audio.flags &= ~VIDEO_AUDIO_MUTE; - ioctl(video_fd, VIDIOCSAUDIO, &audio); - - ioctl(video_fd, VIDIOCGPICT, &pict); - ff_dlog(s1, "v4l: colour=%d hue=%d brightness=%d constrast=%d whiteness=%d\n", - pict.colour, pict.hue, pict.brightness, pict.contrast, pict.whiteness); - /* try to choose a suitable video format */ - pict.palette = desired_palette; - pict.depth= desired_depth; - if (desired_palette == -1 || ioctl(video_fd, VIDIOCSPICT, &pict) < 0) { - for (j = 0; j < vformat_num; j++) { - pict.palette = video_formats[j].palette; - pict.depth = video_formats[j].depth; - if (-1 != ioctl(video_fd, VIDIOCSPICT, &pict)) - break; - } - if (j >= vformat_num) - goto fail1; - } - - if (ioctl(video_fd, VIDIOCGMBUF, &s->gb_buffers) < 0) { - /* try to use read based access */ - int val; - - s->video_win.x = 0; - s->video_win.y = 0; - s->video_win.chromakey = -1; - s->video_win.flags = 0; - - if (ioctl(video_fd, VIDIOCSWIN, s->video_win) < 0) { - av_log(s1, AV_LOG_ERROR, "VIDIOCSWIN: %s\n", strerror(errno)); - goto fail; - } - - s->frame_format = pict.palette; - - val = 1; - if (ioctl(video_fd, VIDIOCCAPTURE, &val) < 0) { - av_log(s1, AV_LOG_ERROR, "VIDIOCCAPTURE: %s\n", strerror(errno)); - goto fail; - } - - s->time_frame = av_gettime() * s->time_base.den / s->time_base.num; - s->use_mmap = 0; - } else { - s->video_buf = mmap(0, s->gb_buffers.size, PROT_READ|PROT_WRITE, MAP_SHARED, video_fd, 0); - if ((unsigned char*)-1 == s->video_buf) { - s->video_buf = mmap(0, s->gb_buffers.size, PROT_READ|PROT_WRITE, MAP_PRIVATE, video_fd, 0); - if ((unsigned char*)-1 == s->video_buf) { - av_log(s1, AV_LOG_ERROR, "mmap: %s\n", strerror(errno)); - goto fail; - } - } - s->gb_frame = 0; - s->time_frame = av_gettime() * s->time_base.den / s->time_base.num; - - /* start to grab the first frame */ - s->gb_buf.frame = s->gb_frame % s->gb_buffers.frames; - s->gb_buf.height = s->video_win.height; - s->gb_buf.width = s->video_win.width; - s->gb_buf.format = pict.palette; - - if (ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf) < 0) { - if (errno != EAGAIN) { - fail1: - av_log(s1, AV_LOG_ERROR, "VIDIOCMCAPTURE: %s\n", strerror(errno)); - } else { - av_log(s1, AV_LOG_ERROR, "Fatal: grab device does not receive any video signal\n"); - } - goto fail; - } - for (j = 1; j < s->gb_buffers.frames; j++) { - s->gb_buf.frame = j; - ioctl(video_fd, VIDIOCMCAPTURE, &s->gb_buf); - } - s->frame_format = s->gb_buf.format; - s->use_mmap = 1; - } - - for (j = 0; j < vformat_num; j++) { - if (s->frame_format == video_formats[j].palette) { - s->frame_size = s->video_win.width * s->video_win.height * video_formats[j].depth / 8; - st->codec->pix_fmt = video_formats[j].pix_fmt; - break; - } - } - - if (j >= vformat_num) - goto fail; - - s->fd = video_fd; - - st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; - st->codec->width = s->video_win.width; - st->codec->height = s->video_win.height; - st->codec->time_base = s->time_base; - st->codec->bit_rate = s->frame_size * 1/av_q2d(st->codec->time_base) * 8; - - return 0; - fail: - if (video_fd >= 0) - close(video_fd); - return AVERROR(EIO); -} - -static int v4l_mm_read_picture(VideoData *s, uint8_t *buf) -{ - uint8_t *ptr; - - while (ioctl(s->fd, VIDIOCSYNC, &s->gb_frame) < 0 && - (errno == EAGAIN || errno == EINTR)); - - ptr = s->video_buf + s->gb_buffers.offsets[s->gb_frame]; - memcpy(buf, ptr, s->frame_size); - - /* Setup to capture the next frame */ - s->gb_buf.frame = s->gb_frame; - if (ioctl(s->fd, VIDIOCMCAPTURE, &s->gb_buf) < 0) { - if (errno == EAGAIN) - av_log(NULL, AV_LOG_ERROR, "Cannot Sync\n"); - else - av_log(NULL, AV_LOG_ERROR, "VIDIOCMCAPTURE: %s\n", strerror(errno)); - return AVERROR(EIO); - } - - /* This is now the grabbing frame */ - s->gb_frame = (s->gb_frame + 1) % s->gb_buffers.frames; - - return s->frame_size; -} - -static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt) -{ - VideoData *s = s1->priv_data; - int64_t curtime, delay; - struct timespec ts; - - /* Calculate the time of the next frame */ - s->time_frame += INT64_C(1000000); - - /* wait based on the frame rate */ - for(;;) { - curtime = av_gettime(); - delay = s->time_frame * s->time_base.num / s->time_base.den - curtime; - if (delay <= 0) { - if (delay < INT64_C(-1000000) * s->time_base.num / s->time_base.den) { - /* printf("grabbing is %d frames late (dropping)\n", (int) -(delay / 16666)); */ - s->time_frame += INT64_C(1000000); - } - break; - } - ts.tv_sec = delay / 1000000; - ts.tv_nsec = (delay % 1000000) * 1000; - nanosleep(&ts, NULL); - } - - if (av_new_packet(pkt, s->frame_size) < 0) - return AVERROR(EIO); - - pkt->pts = curtime; - - /* read one frame */ - if (s->use_mmap) { - return v4l_mm_read_picture(s, pkt->data); - } else { - if (read(s->fd, pkt->data, pkt->size) != pkt->size) - return AVERROR(EIO); - return s->frame_size; - } -} - -static int grab_read_close(AVFormatContext *s1) -{ - VideoData *s = s1->priv_data; - - if (s->use_mmap) - munmap(s->video_buf, s->gb_buffers.size); - - /* mute audio. we must force it because the BTTV driver does not - return its state correctly */ - s->audio_saved.flags |= VIDEO_AUDIO_MUTE; - ioctl(s->fd, VIDIOCSAUDIO, &s->audio_saved); - - close(s->fd); - return 0; -} - -static const AVOption options[] = { - { "standard", "", offsetof(VideoData, standard), AV_OPT_TYPE_INT, {.i64 = VIDEO_MODE_NTSC}, VIDEO_MODE_PAL, VIDEO_MODE_NTSC, AV_OPT_FLAG_DECODING_PARAM, "standard" }, - { "PAL", "", 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_MODE_PAL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, - { "SECAM", "", 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_MODE_SECAM}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, - { "NTSC", "", 0, AV_OPT_TYPE_CONST, {.i64 = VIDEO_MODE_NTSC}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "standard" }, - { NULL }, -}; - -static const AVClass v4l_class = { - .class_name = "V4L indev", - .item_name = av_default_item_name, - .option = options, - .version = LIBAVUTIL_VERSION_INT, - .category = AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT, -}; - -AVInputFormat ff_v4l_demuxer = { - .name = "video4linux,v4l", - .long_name = NULL_IF_CONFIG_SMALL("Video4Linux device grab"), - .priv_data_size = sizeof(VideoData), - .read_header = grab_read_header, - .read_packet = grab_read_packet, - .read_close = grab_read_close, - .flags = AVFMT_NOFILE, - .priv_class = &v4l_class, -};