FFmpeg
Loading...
Searching...
No Matches
vfwcap.c File Reference
#include "libavutil/internal.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include "libavformat/packet_internal.h"
#include "libavformat/demux.h"
#include "libavformat/internal.h"
#include <windows.h>
#include <vfw.h>
#include "avdevice.h"

Go to the source code of this file.

Data Structures

struct  vfw_ctx
 

Macros

#define HWND_MESSAGE   ((HWND) -3)
 
#define dstruct(pctx, sname, var, type)
 
#define OFFSET(x)
 
#define DEC   AV_OPT_FLAG_DECODING_PARAM
 

Functions

static enum AVPixelFormat vfw_pixfmt (DWORD biCompression, WORD biBitCount)
 
static enum AVCodecID vfw_codecid (DWORD biCompression)
 
static void dump_captureparms (AVFormatContext *s, CAPTUREPARMS *cparms)
 
static void dump_videohdr (AVFormatContext *s, VIDEOHDR *vhdr)
 
static void dump_bih (AVFormatContext *s, BITMAPINFOHEADER *bih)
 
static int shall_we_drop (AVFormatContext *s)
 
static LRESULT CALLBACK videostream_cb (HWND hwnd, LPVIDEOHDR vdhdr)
 
static int vfw_read_close (AVFormatContext *s)
 
static int vfw_read_header (AVFormatContext *s)
 
static int vfw_read_packet (AVFormatContext *s, AVPacket *pkt)
 

Variables

static const AVOption options []
 
static const AVClass vfw_class
 
const FFInputFormat ff_vfwcap_demuxer
 

Macro Definition Documentation

◆ HWND_MESSAGE

#define HWND_MESSAGE   ((HWND) -3)

Definition at line 42 of file vfwcap.c.

Referenced by vfw_read_header().

◆ dstruct

#define dstruct ( pctx,
sname,
var,
type )
Value:
av_log(pctx, AV_LOG_DEBUG, #var":\t%"type"\n", sname->var)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
cl_device_type type
#define av_log(a,...)

Definition at line 97 of file vfwcap.c.

Referenced by dump_bih(), dump_captureparms(), and dump_videohdr().

◆ OFFSET

#define OFFSET ( x)
Value:
offsetof(struct vfw_ctx, x)

Definition at line 471 of file vfwcap.c.

◆ DEC

#define DEC   AV_OPT_FLAG_DECODING_PARAM

Definition at line 472 of file vfwcap.c.

Function Documentation

◆ vfw_pixfmt()

static enum AVPixelFormat vfw_pixfmt ( DWORD biCompression,
WORD biBitCount )
static

Definition at line 57 of file vfwcap.c.

Referenced by vfw_read_header().

◆ vfw_codecid()

static enum AVCodecID vfw_codecid ( DWORD biCompression)
static

Definition at line 85 of file vfwcap.c.

Referenced by vfw_read_header().

◆ dump_captureparms()

static void dump_captureparms ( AVFormatContext * s,
CAPTUREPARMS * cparms )
static

Definition at line 100 of file vfwcap.c.

Referenced by vfw_read_header().

◆ dump_videohdr()

static void dump_videohdr ( AVFormatContext * s,
VIDEOHDR * vhdr )
static

Definition at line 129 of file vfwcap.c.

Referenced by videostream_cb().

◆ dump_bih()

static void dump_bih ( AVFormatContext * s,
BITMAPINFOHEADER * bih )
static

Definition at line 146 of file vfwcap.c.

Referenced by ff_print_AM_MEDIA_TYPE(), and vfw_read_header().

◆ shall_we_drop()

static int shall_we_drop ( AVFormatContext * s)
static

Definition at line 164 of file vfwcap.c.

Referenced by videostream_cb().

◆ videostream_cb()

static LRESULT CALLBACK videostream_cb ( HWND hwnd,
LPVIDEOHDR vdhdr )
static

Definition at line 180 of file vfwcap.c.

Referenced by vfw_read_header().

◆ vfw_read_close()

static int vfw_read_close ( AVFormatContext * s)
static

Definition at line 222 of file vfwcap.c.

Referenced by vfw_read_header().

◆ vfw_read_header()

static int vfw_read_header ( AVFormatContext * s)
static

Definition at line 248 of file vfwcap.c.

◆ vfw_read_packet()

static int vfw_read_packet ( AVFormatContext * s,
AVPacket * pkt )
static

Definition at line 442 of file vfwcap.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "video_size", "A string describing frame size, such as 640x480 or hd720.", OFFSET(video_size), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, DEC },
{ "framerate", "", OFFSET(framerate), AV_OPT_TYPE_STRING, {.str = "ntsc"}, 0, 0, DEC },
{ NULL },
}
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
#define DEC
Definition librsvgdec.c:149
float framerate
Definition av1_levels.c:29

Definition at line 473 of file vfwcap.c.

◆ vfw_class

const AVClass vfw_class
static
Initial value:
= {
.class_name = "VFW indev",
.item_name = av_default_item_name,
.option = options,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
Definition log.h:42

Definition at line 479 of file vfwcap.c.

◆ ff_vfwcap_demuxer

const FFInputFormat ff_vfwcap_demuxer
Initial value:
= {
.p.name = "vfwcap",
.p.long_name = NULL_IF_CONFIG_SMALL("VfW video capture"),
.p.flags = AVFMT_NOFILE,
.p.priv_class = &vfw_class,
.priv_data_size = sizeof(struct vfw_ctx),
.read_packet = vfw_read_packet,
.read_close = vfw_read_close,
}
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition avformat.h:488
static int read_header(FFV1Context *f, RangeCoder *c)
Definition ffv1dec.c:578
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
static int vfw_read_close(AVFormatContext *s)
Definition vfwcap.c:222
static int vfw_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition vfwcap.c:442
static int vfw_read_header(AVFormatContext *s)
Definition vfwcap.c:248
static const AVClass vfw_class
Definition vfwcap.c:479

Definition at line 487 of file vfwcap.c.