mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
ffmpeg: Clean up ffmpeg_prefer_libvpx implementation
This commit is contained in:
parent
148010c5f0
commit
cc77c5dbe2
@ -36,12 +36,8 @@ PStatCollector FfmpegVideoCursor::_fetch_buffer_pcollector("*:FFMPEG Video Decod
|
|||||||
PStatCollector FfmpegVideoCursor::_seek_pcollector("*:FFMPEG Video Decoding:Seek");
|
PStatCollector FfmpegVideoCursor::_seek_pcollector("*:FFMPEG Video Decoding:Seek");
|
||||||
PStatCollector FfmpegVideoCursor::_export_frame_pcollector("*:FFMPEG Convert Video to BGR");
|
PStatCollector FfmpegVideoCursor::_export_frame_pcollector("*:FFMPEG Convert Video to BGR");
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 54
|
|
||||||
#define AV_CODEC_ID_VP8 CODEC_ID_VP8
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 32, 100)
|
#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(52, 32, 100)
|
||||||
#define AV_PIX_FMT_FLAG_ALPHA PIX_FMT_ALPHA
|
#define AV_PIX_FMT_FLAG_ALPHA PIX_FMT_ALPHA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -506,9 +502,12 @@ open_stream() {
|
|||||||
|
|
||||||
AVCodec *pVideoCodec = NULL;
|
AVCodec *pVideoCodec = NULL;
|
||||||
if (ffmpeg_prefer_libvpx) {
|
if (ffmpeg_prefer_libvpx) {
|
||||||
if ((int)_video_ctx->codec_id == 168) { // AV_CODEC_ID_VP9
|
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 0, 0)
|
||||||
|
if (_video_ctx->codec_id == AV_CODEC_ID_VP9) {
|
||||||
pVideoCodec = avcodec_find_decoder_by_name("libvpx-vp9");
|
pVideoCodec = avcodec_find_decoder_by_name("libvpx-vp9");
|
||||||
} else if (_video_ctx->codec_id == AV_CODEC_ID_VP8) {
|
} else
|
||||||
|
#endif
|
||||||
|
if (_video_ctx->codec_id == AV_CODEC_ID_VP8) {
|
||||||
pVideoCodec = avcodec_find_decoder_by_name("libvpx");
|
pVideoCodec = avcodec_find_decoder_by_name("libvpx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user