diff --git a/app/streaming/video/ffmpeg.cpp b/app/streaming/video/ffmpeg.cpp index e5f1f9bf..8c3205ff 100644 --- a/app/streaming/video/ffmpeg.cpp +++ b/app/streaming/video/ffmpeg.cpp @@ -226,7 +226,7 @@ bool FFmpegVideoDecoder::createFrontendRenderer(PDECODER_PARAMETERS params, bool return true; } -bool FFmpegVideoDecoder::completeInitialization(AVCodec* decoder, PDECODER_PARAMETERS params, bool testFrame, bool eglOnly) +bool FFmpegVideoDecoder::completeInitialization(const AVCodec* decoder, PDECODER_PARAMETERS params, bool testFrame, bool eglOnly) { // In test-only mode, we should only see test frames SDL_assert(!m_TestOnly || testFrame); @@ -582,7 +582,7 @@ IFFmpegRenderer* FFmpegVideoDecoder::createHwAccelRenderer(const AVCodecHWConfig } } -bool FFmpegVideoDecoder::tryInitializeRenderer(AVCodec* decoder, +bool FFmpegVideoDecoder::tryInitializeRenderer(const AVCodec* decoder, PDECODER_PARAMETERS params, const AVCodecHWConfig* hwConfig, std::function createRendererFunc) @@ -667,7 +667,7 @@ bool FFmpegVideoDecoder::tryInitializeRenderer(AVCodec* decoder, bool FFmpegVideoDecoder::tryInitializeRendererForDecoderByName(const char *decoderName, PDECODER_PARAMETERS params) { - AVCodec* decoder = avcodec_find_decoder_by_name(decoderName); + const AVCodec* decoder = avcodec_find_decoder_by_name(decoderName); if (decoder == nullptr) { return false; } @@ -767,7 +767,7 @@ bool FFmpegVideoDecoder::initialize(PDECODER_PARAMETERS params) } } - AVCodec* decoder; + const AVCodec* decoder; if (params->videoFormat & VIDEO_FORMAT_MASK_H264) { decoder = avcodec_find_decoder(AV_CODEC_ID_H264); diff --git a/app/streaming/video/ffmpeg.h b/app/streaming/video/ffmpeg.h index 734a6e8e..acd0386f 100644 --- a/app/streaming/video/ffmpeg.h +++ b/app/streaming/video/ffmpeg.h @@ -26,7 +26,7 @@ public: virtual IFFmpegRenderer* getBackendRenderer(); private: - bool completeInitialization(AVCodec* decoder, PDECODER_PARAMETERS params, bool testFrame, bool eglOnly); + bool completeInitialization(const AVCodec* decoder, PDECODER_PARAMETERS params, bool testFrame, bool eglOnly); void stringifyVideoStats(VIDEO_STATS& stats, char* output); @@ -39,7 +39,7 @@ private: bool tryInitializeRendererForDecoderByName(const char* decoderName, PDECODER_PARAMETERS params); - bool tryInitializeRenderer(AVCodec* decoder, + bool tryInitializeRenderer(const AVCodec* decoder, PDECODER_PARAMETERS params, const AVCodecHWConfig* hwConfig, std::function createRendererFunc);