From 228fb0e1ec5f25018d112bf891bf8cca4a038fed Mon Sep 17 00:00:00 2001 From: hbos Date: Mon, 21 Aug 2017 05:17:17 -0700 Subject: [PATCH] H264: Don't disable compiler warning by using NO_THREAD_SAFETY_ANALYSIS. The LockManagerOperation global function uses void** which does not work well with the thread_annotations.h macros and produce compiler warnings on clang (chromium default). Workarounds to this is hacky and unhelpful so we disable the analysis for this function, which isn't helpful in this case anyway. webrtc_h264_config is no longer needed and is removed. BUG=8090, 8119 Review-Url: https://codereview.webrtc.org/3000263002 Cr-Commit-Position: refs/heads/master@{#19425} --- webrtc/modules/video_coding/BUILD.gn | 8 -------- webrtc/modules/video_coding/codecs/h264/OWNERS | 2 ++ .../modules/video_coding/codecs/h264/h264_decoder_impl.cc | 5 +++-- 3 files changed, 5 insertions(+), 10 deletions(-) create mode 100644 webrtc/modules/video_coding/codecs/h264/OWNERS diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index 3f06c4d73e..cab7ad207e 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -146,13 +146,6 @@ rtc_static_library("video_coding_utility") { ] } -# TODO(ehmaldonado): Remove once http://bugs.webrtc.org/8090 is fixed. -config("webrtc_h264_config") { - if (is_clang) { - cflags = [ "-Wno-thread-safety-attributes" ] - } -} - rtc_static_library("webrtc_h264") { sources = [ "codecs/h264/h264.cc", @@ -173,7 +166,6 @@ rtc_static_library("webrtc_h264") { ] if (rtc_use_h264) { - configs += [ ":webrtc_h264_config" ] defines += [ "WEBRTC_USE_H264" ] if (rtc_initialize_ffmpeg) { defines += [ "WEBRTC_INITIALIZE_FFMPEG" ] diff --git a/webrtc/modules/video_coding/codecs/h264/OWNERS b/webrtc/modules/video_coding/codecs/h264/OWNERS new file mode 100644 index 0000000000..a79fd4a169 --- /dev/null +++ b/webrtc/modules/video_coding/codecs/h264/OWNERS @@ -0,0 +1,2 @@ +hbos@webrtc.org +sprang@webrtc.org diff --git a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc index a28a841994..290df944bd 100644 --- a/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc +++ b/webrtc/modules/video_coding/codecs/h264/h264_decoder_impl.cc @@ -50,9 +50,10 @@ rtc::CriticalSection ffmpeg_init_lock; bool ffmpeg_initialized = false; // Called by FFmpeg to do mutex operations if initialized using -// |InitializeFFmpeg|. +// |InitializeFFmpeg|. Disabling thread safety analysis because void** does not +// play nicely with thread_annotations.h macros. int LockManagerOperation(void** lock, AVLockOp op) - EXCLUSIVE_LOCK_FUNCTION() UNLOCK_FUNCTION() { + NO_THREAD_SAFETY_ANALYSIS { switch (op) { case AV_LOCK_CREATE: *lock = new rtc::CriticalSection();