Don't call deprecated FFmpeg API.

This removes call of av_register_all(), which is deprecated, and
related code.

Bug: webrtc:9352
Change-Id: Ib7de5931c900eaf1023ecf3046f560feaaeec8ef
Reviewed-on: https://webrtc-review.googlesource.com/85347
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23743}
This commit is contained in:
Sergey Silkin
2018-06-25 16:22:38 +02:00
committed by Commit Bot
parent df3bcdbe88
commit fe288eb687
3 changed files with 1 additions and 44 deletions

View File

@ -45,21 +45,6 @@ enum H264DecoderImplEvent {
kH264DecoderEventMax = 16,
};
#if defined(WEBRTC_INITIALIZE_FFMPEG)
rtc::CriticalSection ffmpeg_init_lock;
bool ffmpeg_initialized = false;
void InitializeFFmpeg() {
rtc::CritScope cs(&ffmpeg_init_lock);
if (!ffmpeg_initialized) {
av_register_all();
ffmpeg_initialized = true;
}
}
#endif // defined(WEBRTC_INITIALIZE_FFMPEG)
} // namespace
int H264DecoderImpl::AVGetBuffer2(
@ -171,18 +156,6 @@ int32_t H264DecoderImpl::InitDecode(const VideoCodec* codec_settings,
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
}
// FFmpeg must have been initialized (with |av_register_all|) before we
// proceed. |InitializeFFmpeg| does this, which makes sense for WebRTC
// standalone. In other cases, such as Chromium, FFmpeg is initialized
// externally and calling |InitializeFFmpeg| would be thread-unsafe and result
// in FFmpeg being initialized twice, which could break other FFmpeg usage.
// See the |rtc_initialize_ffmpeg| flag.
#if defined(WEBRTC_INITIALIZE_FFMPEG)
// Make sure FFmpeg has been initialized. Subsequent |InitializeFFmpeg| calls
// do nothing.
InitializeFFmpeg();
#endif
// Release necessary in case of re-initializing.
int32_t ret = Release();
if (ret != WEBRTC_VIDEO_CODEC_OK) {