Commit 1fd880ce authored by James Almer's avatar James Almer Committed by Michael Niedermayer

lavd/dshow: use av_codec_get_id()

ff_codec_get_id() is a lavf internal function
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0ab00a75
...@@ -352,6 +352,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, ...@@ -352,6 +352,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
VIDEO_STREAM_CONFIG_CAPS *vcaps = caps; VIDEO_STREAM_CONFIG_CAPS *vcaps = caps;
BITMAPINFOHEADER *bih; BITMAPINFOHEADER *bih;
int64_t *fr; int64_t *fr;
const AVCodecTag *const tags[] = { avformat_get_riff_video_tags(), NULL };
#if DSHOWDEBUG #if DSHOWDEBUG
ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps); ff_print_VIDEO_STREAM_CONFIG_CAPS(vcaps);
#endif #endif
...@@ -369,7 +370,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, ...@@ -369,7 +370,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
if (!pformat_set) { if (!pformat_set) {
enum AVPixelFormat pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount); enum AVPixelFormat pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount);
if (pix_fmt == AV_PIX_FMT_NONE) { if (pix_fmt == AV_PIX_FMT_NONE) {
enum AVCodecID codec_id = ff_codec_get_id(avformat_get_riff_video_tags(), bih->biCompression); enum AVCodecID codec_id = av_codec_get_id(tags, bih->biCompression);
AVCodec *codec = avcodec_find_decoder(codec_id); AVCodec *codec = avcodec_find_decoder(codec_id);
if (codec_id == AV_CODEC_ID_NONE || !codec) { if (codec_id == AV_CODEC_ID_NONE || !codec) {
av_log(avctx, AV_LOG_INFO, " unknown compression type 0x%X", (int) bih->biCompression); av_log(avctx, AV_LOG_INFO, " unknown compression type 0x%X", (int) bih->biCompression);
...@@ -387,7 +388,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, ...@@ -387,7 +388,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
continue; continue;
} }
if (ctx->video_codec_id != AV_CODEC_ID_RAWVIDEO) { if (ctx->video_codec_id != AV_CODEC_ID_RAWVIDEO) {
if (ctx->video_codec_id != ff_codec_get_id(avformat_get_riff_video_tags(), bih->biCompression)) if (ctx->video_codec_id != av_codec_get_id(tags, bih->biCompression))
goto next; goto next;
} }
if (ctx->pixel_format != AV_PIX_FMT_NONE && if (ctx->pixel_format != AV_PIX_FMT_NONE &&
...@@ -780,7 +781,8 @@ dshow_add_device(AVFormatContext *avctx, ...@@ -780,7 +781,8 @@ dshow_add_device(AVFormatContext *avctx,
codec->color_range = AVCOL_RANGE_MPEG; // just in case it needs this... codec->color_range = AVCOL_RANGE_MPEG; // just in case it needs this...
} }
if (codec->pix_fmt == AV_PIX_FMT_NONE) { if (codec->pix_fmt == AV_PIX_FMT_NONE) {
codec->codec_id = ff_codec_get_id(avformat_get_riff_video_tags(), bih->biCompression); const AVCodecTag *const tags[] = { avformat_get_riff_video_tags(), NULL };
codec->codec_id = av_codec_get_id(tags, bih->biCompression);
if (codec->codec_id == AV_CODEC_ID_NONE) { if (codec->codec_id == AV_CODEC_ID_NONE) {
av_log(avctx, AV_LOG_ERROR, "Unknown compression type. " av_log(avctx, AV_LOG_ERROR, "Unknown compression type. "
"Please report type 0x%X.\n", (int) bih->biCompression); "Please report type 0x%X.\n", (int) bih->biCompression);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment