mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
media: adjust to ffmpeg 5 API changes
Change-Id: I5c5b9935e7ed3a15029d5aa62e0266c77e59f652
This commit is contained in:

committed by
Sébastien Blin

parent
2b45e58237
commit
4b5595c398
@ -29,7 +29,7 @@ namespace jami {
|
|||||||
* Attempt to find standalone AVCodec decoder using AVCodecID,
|
* Attempt to find standalone AVCodec decoder using AVCodecID,
|
||||||
* or fallback to the default decoder.
|
* or fallback to the default decoder.
|
||||||
*/
|
*/
|
||||||
AVCodec*
|
const AVCodec*
|
||||||
findDecoder(const enum AVCodecID codec_id)
|
findDecoder(const enum AVCodecID codec_id)
|
||||||
{
|
{
|
||||||
const char* codec_name;
|
const char* codec_name;
|
||||||
@ -49,7 +49,7 @@ findDecoder(const enum AVCodecID codec_id)
|
|||||||
default:
|
default:
|
||||||
codec_name = nullptr;
|
codec_name = nullptr;
|
||||||
}
|
}
|
||||||
AVCodec* codec = nullptr;
|
const AVCodec* codec = nullptr;
|
||||||
if (codec_name)
|
if (codec_name)
|
||||||
codec = avcodec_find_decoder_by_name(codec_name);
|
codec = avcodec_find_decoder_by_name(codec_name);
|
||||||
if (not codec)
|
if (not codec)
|
||||||
|
@ -91,7 +91,7 @@ int
|
|||||||
MediaDemuxer::openInput(const DeviceParams& params)
|
MediaDemuxer::openInput(const DeviceParams& params)
|
||||||
{
|
{
|
||||||
inputParams_ = params;
|
inputParams_ = params;
|
||||||
AVInputFormat* iformat = av_find_input_format(params.format.c_str());
|
auto iformat = av_find_input_format(params.format.c_str());
|
||||||
|
|
||||||
if (!iformat && !params.format.empty())
|
if (!iformat && !params.format.empty())
|
||||||
JAMI_WARN("Cannot find format \"%s\"", params.format.c_str());
|
JAMI_WARN("Cannot find format \"%s\"", params.format.c_str());
|
||||||
|
@ -221,7 +221,7 @@ private:
|
|||||||
|
|
||||||
std::shared_ptr<MediaDemuxer> demuxer_;
|
std::shared_ptr<MediaDemuxer> demuxer_;
|
||||||
|
|
||||||
AVCodec* inputDecoder_ = nullptr;
|
const AVCodec* inputDecoder_ = nullptr;
|
||||||
AVCodecContext* decoderCtx_ = nullptr;
|
AVCodecContext* decoderCtx_ = nullptr;
|
||||||
AVStream* avStream_ = nullptr;
|
AVStream* avStream_ = nullptr;
|
||||||
bool emulateRate_ = false;
|
bool emulateRate_ = false;
|
||||||
|
@ -600,7 +600,7 @@ MediaEncoder::print_sdp()
|
|||||||
}
|
}
|
||||||
|
|
||||||
AVCodecContext*
|
AVCodecContext*
|
||||||
MediaEncoder::prepareEncoderContext(AVCodec* outputCodec, bool is_video)
|
MediaEncoder::prepareEncoderContext(const AVCodec* outputCodec, bool is_video)
|
||||||
{
|
{
|
||||||
AVCodecContext* encoderCtx = avcodec_alloc_context3(outputCodec);
|
AVCodecContext* encoderCtx = avcodec_alloc_context3(outputCodec);
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
NON_COPYABLE(MediaEncoder);
|
NON_COPYABLE(MediaEncoder);
|
||||||
AVCodecContext* prepareEncoderContext(AVCodec* outputCodec, bool is_video);
|
AVCodecContext* prepareEncoderContext(const AVCodec* outputCodec, bool is_video);
|
||||||
void forcePresetX2645(AVCodecContext* encoderCtx);
|
void forcePresetX2645(AVCodecContext* encoderCtx);
|
||||||
void extractProfileLevelID(const std::string& parameters, AVCodecContext* ctx);
|
void extractProfileLevelID(const std::string& parameters, AVCodecContext* ctx);
|
||||||
int initStream(const std::string& codecName, AVBufferRef* framesCtx = {});
|
int initStream(const std::string& codecName, AVBufferRef* framesCtx = {});
|
||||||
@ -154,7 +154,7 @@ private:
|
|||||||
bool initialized_ {false};
|
bool initialized_ {false};
|
||||||
bool fileIO_ {false};
|
bool fileIO_ {false};
|
||||||
unsigned int currentVideoCodecID_ {0};
|
unsigned int currentVideoCodecID_ {0};
|
||||||
AVCodec* outputCodec_ = nullptr;
|
const AVCodec* outputCodec_ = nullptr;
|
||||||
std::mutex encMutex_;
|
std::mutex encMutex_;
|
||||||
bool linkableHW_ {false};
|
bool linkableHW_ {false};
|
||||||
RateMode mode_ {RateMode::CRF_CONSTRAINED};
|
RateMode mode_ {RateMode::CRF_CONSTRAINED};
|
||||||
|
Reference in New Issue
Block a user