]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/dshow.c
dshow: fix AVInputFormat declaration after ABI breakage
[ffmpeg] / libavdevice / dshow.c
index bba1bbaffbad88ef58d10b2b1ab47c9647c62b3b..27048346d1f476a7729c56ebd2483430e6f2bd81 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "libavutil/parseutils.h"
 #include "libavutil/opt.h"
-
+#include "libavformat/internal.h"
 #include "avdevice.h"
 #include "dshow.h"
 
@@ -649,7 +649,7 @@ static enum CodecID waveform_codec_id(enum AVSampleFormat sample_fmt)
     }
 }
 
-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;
@@ -660,7 +660,7 @@ static enum SampleFormat sample_fmt_bits_per_sample(int bits)
 }
 
 static int
-dshow_add_device(AVFormatContext *avctx, AVFormatParameters *ap,
+dshow_add_device(AVFormatContext *avctx,
                  enum dshowDeviceType devtype)
 {
     struct dshow_ctx *ctx = avctx->priv_data;
@@ -739,7 +739,7 @@ dshow_add_device(AVFormatContext *avctx, AVFormatParameters *ap,
         codec->channels    = fx->nChannels;
     }
 
-    av_set_pts_info(st, 64, 1, 10000000);
+    avpriv_set_pts_info(st, 64, 1, 10000000);
 
     ret = 0;
 
@@ -784,7 +784,7 @@ static int parse_device_name(AVFormatContext *avctx)
     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;
@@ -961,13 +961,12 @@ static const AVClass dshow_class = {
 };
 
 AVInputFormat ff_dshow_demuxer = {
-    "dshow",
-    NULL_IF_CONFIG_SMALL("DirectShow capture"),
-    sizeof(struct dshow_ctx),
-    NULL,
-    dshow_read_header,
-    dshow_read_packet,
-    dshow_read_close,
-    .flags = AVFMT_NOFILE,
-    .priv_class = &dshow_class,
+    .name           = "dshow",
+    .long_name      = NULL_IF_CONFIG_SMALL("DirectShow capture"),
+    .priv_data_size = sizeof(struct dshow_ctx),
+    .read_header    = dshow_read_header,
+    .read_packet    = dshow_read_packet,
+    .read_close     = dshow_read_close,
+    .flags          = AVFMT_NOFILE,
+    .priv_class     = &dshow_class,
 };