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:
8
deps/media-playback/media-playback/decode.c
vendored
8
deps/media-playback/media-playback/decode.c
vendored
@@ -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;
|
||||
}
|
||||
|
||||
|
8
deps/media-playback/media-playback/decode.h
vendored
8
deps/media-playback/media-playback/decode.h
vendored
@@ -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 {
|
||||
|
Reference in New Issue
Block a user