47
47
char *framerate; /**< Set by a private option. */
50
static enum PixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount)
50
static enum AVPixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount)
52
52
switch(biCompression) {
53
53
case MKTAG('U', 'Y', 'V', 'Y'):
54
return PIX_FMT_UYVY422;
54
return AV_PIX_FMT_UYVY422;
55
55
case MKTAG('Y', 'U', 'Y', '2'):
56
return PIX_FMT_YUYV422;
56
return AV_PIX_FMT_YUYV422;
57
57
case MKTAG('I', '4', '2', '0'):
58
return PIX_FMT_YUV420P;
58
return AV_PIX_FMT_YUV420P;
60
60
switch(biBitCount) { /* 1-8 are untested */
62
return PIX_FMT_MONOWHITE;
62
return AV_PIX_FMT_MONOWHITE;
64
return AV_PIX_FMT_RGB4;
66
return AV_PIX_FMT_RGB8;
68
return PIX_FMT_RGB555;
68
return AV_PIX_FMT_RGB555;
70
return AV_PIX_FMT_BGR24;
72
return AV_PIX_FMT_RGB32;
75
return AV_PIX_FMT_NONE;
78
static enum CodecID vfw_codecid(DWORD biCompression)
78
static enum AVCodecID vfw_codecid(DWORD biCompression)
80
80
switch(biCompression) {
81
81
case MKTAG('d', 'v', 's', 'd'):
82
return CODEC_ID_DVVIDEO;
82
return AV_CODEC_ID_DVVIDEO;
83
83
case MKTAG('M', 'J', 'P', 'G'):
84
84
case MKTAG('m', 'j', 'p', 'g'):
85
return CODEC_ID_MJPEG;
85
return AV_CODEC_ID_MJPEG;
87
return AV_CODEC_ID_NONE;
90
90
#define dstruct(pctx, sname, var, type) \
376
376
codec->width = bi->bmiHeader.biWidth;
377
377
codec->height = bi->bmiHeader.biHeight;
378
378
codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount);
379
if(codec->pix_fmt == PIX_FMT_NONE) {
379
if(codec->pix_fmt == AV_PIX_FMT_NONE) {
380
380
codec->codec_id = vfw_codecid(biCompression);
381
if(codec->codec_id == CODEC_ID_NONE) {
381
if(codec->codec_id == AV_CODEC_ID_NONE) {
382
382
av_log(s, AV_LOG_ERROR, "Unknown compression type. "
383
383
"Please report verbose (-v 9) debug information.\n");
384
384
vfw_read_close(s);
387
387
codec->bits_per_coded_sample = biBitCount;
389
codec->codec_id = CODEC_ID_RAWVIDEO;
389
codec->codec_id = AV_CODEC_ID_RAWVIDEO;
390
390
if(biCompression == BI_RGB) {
391
391
codec->bits_per_coded_sample = biBitCount;
392
392
codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE);