diff options
Diffstat (limited to 'cast')
-rw-r--r-- | cast/standalone_receiver/decoder.cc | 11 | ||||
-rw-r--r-- | cast/standalone_sender/ffmpeg_glue.cc | 9 |
2 files changed, 19 insertions, 1 deletions
diff --git a/cast/standalone_receiver/decoder.cc b/cast/standalone_receiver/decoder.cc index 9a2324e3..92cdc901 100644 --- a/cast/standalone_receiver/decoder.cc +++ b/cast/standalone_receiver/decoder.cc @@ -4,6 +4,8 @@ #include "cast/standalone_receiver/decoder.h" +#include <libavcodec/version.h> + #include <algorithm> #include <sstream> #include <thread> @@ -44,7 +46,14 @@ absl::Span<uint8_t> Decoder::Buffer::GetSpan() { Decoder::Client::Client() = default; Decoder::Client::~Client() = default; -Decoder::Decoder(const std::string& codec_name) : codec_name_(codec_name) {} +Decoder::Decoder(const std::string& codec_name) : codec_name_(codec_name) { +#if LIBAVCODEC_VERSION_MAJOR < 59 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + avcodec_register_all(); +#pragma GCC diagnostic pop +#endif // LIBAVCODEC_VERSION_MAJOR < 59 +} Decoder::~Decoder() = default; diff --git a/cast/standalone_sender/ffmpeg_glue.cc b/cast/standalone_sender/ffmpeg_glue.cc index a6645886..7f476582 100644 --- a/cast/standalone_sender/ffmpeg_glue.cc +++ b/cast/standalone_sender/ffmpeg_glue.cc @@ -4,6 +4,8 @@ #include "cast/standalone_sender/ffmpeg_glue.h" +#include <libavcodec/version.h> + #include "util/osp_logging.h" namespace openscreen { @@ -12,6 +14,13 @@ namespace internal { AVFormatContext* CreateAVFormatContextForFile(const char* path) { AVFormatContext* format_context = nullptr; +#if LIBAVCODEC_VERSION_MAJOR < 59 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + av_register_all(); +#pragma GCC diagnostic pop +#endif // LIBAVCODEC_VERSION_MAJOR < 59 + int result = avformat_open_input(&format_context, path, nullptr, nullptr); if (result < 0) { OSP_LOG_ERROR << "Cannot open " << path << ": " << av_err2str(result); |