#include "libavutil/parseutils.h"
#include "libavutil/opt.h"
-
+#include "libavformat/internal.h"
#include "avdevice.h"
#include "dshow.h"
return PIX_FMT_YUYV422;
case MKTAG('I', '4', '2', '0'):
return PIX_FMT_YUV420P;
+ case BI_BITFIELDS:
case BI_RGB:
switch(biBitCount) { /* 1-8 are untested */
case 1:
if (r == S_OK) {
IBaseFilter *f;
IEnumFilters_Reset(fenum);
- while (IEnumFilters_Next(fenum, 1, &f, NULL) == S_OK)
+ while (IEnumFilters_Next(fenum, 1, &f, NULL) == S_OK) {
if (IGraphBuilder_RemoveFilter(ctx->graph, f) == S_OK)
IEnumFilters_Reset(fenum); /* When a filter is removed,
* the list must be reset. */
+ IBaseFilter_Release(f);
+ }
IEnumFilters_Release(fenum);
}
IGraphBuilder_Release(ctx->graph);
goto fail1;
if (!skip--)
- IMoniker_BindToObject(m, 0, 0, &IID_IBaseFilter, (void *) &device_filter);
+ IMoniker_BindToObject(m, 0, 0, &IID_IBaseFilter, (void *) &device_filter);
} else {
av_log(avctx, AV_LOG_INFO, " \"%s\"\n", buf);
}
if (!pformat_set) {
av_log(avctx, AV_LOG_INFO, " min s=%ldx%ld fps=%g max s=%ldx%ld fps=%g\n",
vcaps->MinOutputSize.cx, vcaps->MinOutputSize.cy,
- 1e7 / vcaps->MinFrameInterval,
+ 1e7 / vcaps->MaxFrameInterval,
vcaps->MaxOutputSize.cx, vcaps->MaxOutputSize.cy,
- 1e7 / vcaps->MaxFrameInterval);
+ 1e7 / vcaps->MinFrameInterval);
continue;
}
if (ctx->framerate) {
dshow_list_device_options(AVFormatContext *avctx, ICreateDevEnum *devenum,
enum dshowDeviceType devtype)
{
+ struct dshow_ctx *ctx = avctx->priv_data;
IBaseFilter *device_filter = NULL;
int r;
if ((r = dshow_cycle_devices(avctx, devenum, devtype, &device_filter)) < 0)
return r;
+ ctx->device_filter[devtype] = device_filter;
if ((r = dshow_cycle_pins(avctx, devtype, device_filter, NULL)) < 0)
return r;
}
}
-static enum SampleFormat sample_fmt_bits_per_sample(int bits)
+static enum AVSampleFormat sample_fmt_bits_per_sample(int bits)
{
switch (bits) {
case 8: return AV_SAMPLE_FMT_U8;
}
static int
-dshow_add_device(AVFormatContext *avctx, AVFormatParameters *ap,
+dshow_add_device(AVFormatContext *avctx,
enum dshowDeviceType devtype)
{
struct dshow_ctx *ctx = avctx->priv_data;
codec->bits_per_coded_sample = bih->biBitCount;
} else {
codec->codec_id = CODEC_ID_RAWVIDEO;
- if (bih->biCompression == BI_RGB) {
+ if (bih->biCompression == BI_RGB || bih->biCompression == BI_BITFIELDS) {
codec->bits_per_coded_sample = bih->biBitCount;
codec->extradata = av_malloc(9 + FF_INPUT_BUFFER_PADDING_SIZE);
if (codec->extradata) {
codec->channels = fx->nChannels;
}
- av_set_pts_info(st, 64, 1, 10000000);
+ avpriv_set_pts_info(st, 64, 1, 10000000);
ret = 0;
return ret;
}
-static int dshow_read_header(AVFormatContext *avctx, AVFormatParameters *ap)
+static int dshow_read_header(AVFormatContext *avctx)
{
struct dshow_ctx *ctx = avctx->priv_data;
IGraphBuilder *graph = NULL;