libobs: Fix FFmpeg constants

(This commit also modifies the deps/media-playback, obs-ffmpeg, and
win-dshow modules)

More fixes due to ffmpeg renaming some constants and deprecating
AVFMT_RAWPICTURE and AV_PIX_FMT_VDA_VLD.
Latter replaced by AV_PIX_FMT_VIDEOTOOLBOX per ffmpeg dev advice.

Closes jp9000/obs-studio#1061
This commit is contained in:
pkviet
2017-10-29 23:50:01 +01:00
committed by jp9000
parent a33db9af20
commit d670d7badb
9 changed files with 55 additions and 15 deletions

View File

@@ -24,8 +24,8 @@ static AVCodec *find_hardware_decoder(enum AVCodecID id)
while (hwa) {
if (hwa->id == id) {
if (hwa->pix_fmt == AV_PIX_FMT_VDA_VLD ||
hwa->pix_fmt == AV_PIX_FMT_DXVA2_VLD ||
if (hwa->pix_fmt == AV_PIX_FMT_VIDEOTOOLBOX ||
hwa->pix_fmt == AV_PIX_FMT_DXVA2_VLD ||
hwa->pix_fmt == AV_PIX_FMT_VAAPI_VLD) {
c = avcodec_find_decoder_by_name(hwa->name);
if (c)
@@ -142,8 +142,8 @@ bool mp_decode_init(mp_media_t *m, enum AVMediaType type, bool hw)
return false;
}
if (d->codec->capabilities & AV_CODEC_CAP_TRUNCATED)
d->decoder->flags |= AV_CODEC_FLAG_TRUNCATED;
if (d->codec->capabilities & CODEC_CAP_TRUNC)
d->decoder->flags |= CODEC_FLAG_TRUNC;
return true;
}

View File

@@ -36,6 +36,14 @@ extern "C" {
#pragma warning(pop)
#endif
#if LIBAVCODEC_VERSION_MAJOR >= 58
#define CODEC_CAP_TRUNC AV_CODEC_CAP_TRUNCATED
#define CODEC_FLAG_TRUNC AV_CODEC_FLAG_TRUNCATED
#else
#define CODEC_CAP_TRUNC CODEC_CAP_TRUNCATED
#define CODEC_FLAG_TRUNC CODEC_FLAG_TRUNCATED
#endif
struct mp_media;
struct mp_decode {