mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-05 12:54:02 +00:00
Remove deprecated APIs to support ffmpeg5.
This commit is contained in:
parent
6f7b86f930
commit
6c1870edc3
@ -85,8 +85,6 @@ class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory {
|
|||||||
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
CoInitializeEx(nullptr, COINIT_MULTITHREADED);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
av_register_all();
|
|
||||||
|
|
||||||
typeToCodecId = {
|
typeToCodecId = {
|
||||||
{ ".mp3", AV_CODEC_ID_MP3 },
|
{ ".mp3", AV_CODEC_ID_MP3 },
|
||||||
{ "audio/mpeg", AV_CODEC_ID_MP3 },
|
{ "audio/mpeg", AV_CODEC_ID_MP3 },
|
||||||
@ -117,13 +115,13 @@ class FfmpegDecoderFactory : public musik::core::sdk::IDecoderFactory {
|
|||||||
".wav", ".wave", ".aif", ".aiff"
|
".wav", ".wave", ".aif", ".aiff"
|
||||||
};
|
};
|
||||||
|
|
||||||
AVCodec* codec = av_codec_next(nullptr);
|
void* iterator = nullptr;
|
||||||
while (codec != nullptr) {
|
const AVCodec* codec = nullptr;
|
||||||
|
while ((codec = av_codec_iterate(&iterator))) {
|
||||||
const AVCodecDescriptor* descriptor = avcodec_descriptor_get(codec->id);
|
const AVCodecDescriptor* descriptor = avcodec_descriptor_get(codec->id);
|
||||||
if (descriptor != nullptr && descriptor->type == AVMEDIA_TYPE_AUDIO) {
|
if (descriptor != nullptr && descriptor->type == AVMEDIA_TYPE_AUDIO) {
|
||||||
supported.insert(descriptor->id);
|
supported.insert(descriptor->id);
|
||||||
}
|
}
|
||||||
codec = av_codec_next(codec);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,10 +361,6 @@ bool FfmpegEncoder::OpenOutputContext() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FfmpegEncoder::Initialize(IDataStream* out, size_t rate, size_t channels, size_t bitrate) {
|
bool FfmpegEncoder::Initialize(IDataStream* out, size_t rate, size_t channels, size_t bitrate) {
|
||||||
#ifndef WIN32
|
|
||||||
av_register_all();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
this->out = out;
|
this->out = out;
|
||||||
|
|
||||||
if (this->OpenOutputContext()) {
|
if (this->OpenOutputContext()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user