diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index a6fa96c3af..49d39a9c65 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -274,6 +274,12 @@ rtc_static_library("webrtc_h264") { visibility = [ "*" ] sources = [ "codecs/h264/h264.cc", + "codecs/h264/h264_color_space.cc", + "codecs/h264/h264_color_space.h", + "codecs/h264/h264_decoder_impl.cc", + "codecs/h264/h264_decoder_impl.h", + "codecs/h264/h264_encoder_impl.cc", + "codecs/h264/h264_encoder_impl.h", "codecs/h264/include/h264.h", ] @@ -285,6 +291,7 @@ rtc_static_library("webrtc_h264") { "../../api/video:video_frame_i010", "../../api/video:video_frame_i420", "../../api/video_codecs:video_codecs_api", + "../../common_video", "../../media:rtc_h264_profile_id", "../../media:rtc_media_base", "../../rtc_base", @@ -299,21 +306,10 @@ rtc_static_library("webrtc_h264") { ] if (rtc_use_h264) { - assert(!(is_win && !is_clang), "See: bugs.webrtc.org/9213#c13.") - sources += [ - "codecs/h264/h264_color_space.cc", - "codecs/h264/h264_color_space.h", - "codecs/h264/h264_decoder_impl.cc", - "codecs/h264/h264_decoder_impl.h", - "codecs/h264/h264_encoder_impl.cc", - "codecs/h264/h264_encoder_impl.h", - ] deps += [ - "../../common_video", "//third_party/ffmpeg", "//third_party/openh264:encoder", ] - if (!build_with_mozilla) { deps += [ "../../media:rtc_media_base" ] } diff --git a/modules/video_coding/codecs/h264/h264_color_space.cc b/modules/video_coding/codecs/h264/h264_color_space.cc index 2454c20197..59921263e3 100644 --- a/modules/video_coding/codecs/h264/h264_color_space.cc +++ b/modules/video_coding/codecs/h264/h264_color_space.cc @@ -8,6 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ +// Everything declared/defined in this header is only required when WebRTC is +// build with H264 support, please do not move anything out of the +// #ifdef unless needed and tested. +#ifdef WEBRTC_USE_H264 + #include "modules/video_coding/codecs/h264/h264_color_space.h" namespace webrtc { @@ -169,3 +174,5 @@ ColorSpace ExtractH264ColorSpace(AVCodecContext* codec) { } } // namespace webrtc + +#endif // WEBRTC_USE_H264 diff --git a/modules/video_coding/codecs/h264/h264_color_space.h b/modules/video_coding/codecs/h264/h264_color_space.h index 5608ab1f05..392ccaf563 100644 --- a/modules/video_coding/codecs/h264/h264_color_space.h +++ b/modules/video_coding/codecs/h264/h264_color_space.h @@ -11,6 +11,15 @@ #ifndef MODULES_VIDEO_CODING_CODECS_H264_H264_COLOR_SPACE_H_ #define MODULES_VIDEO_CODING_CODECS_H264_H264_COLOR_SPACE_H_ +// Everything declared in this header is only required when WebRTC is +// build with H264 support, please do not move anything out of the +// #ifdef unless needed and tested. +#ifdef WEBRTC_USE_H264 + +#if defined(WEBRTC_WIN) && !defined(__clang__) +#error "See: bugs.webrtc.org/9213#c13." +#endif + #include "api/video/color_space.h" extern "C" { @@ -24,4 +33,6 @@ ColorSpace ExtractH264ColorSpace(AVCodecContext* codec); } // namespace webrtc +#endif // WEBRTC_USE_H264 + #endif // MODULES_VIDEO_CODING_CODECS_H264_H264_COLOR_SPACE_H_ diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.cc b/modules/video_coding/codecs/h264/h264_decoder_impl.cc index 512b846035..bc86a34ea5 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.cc +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.cc @@ -9,6 +9,11 @@ * */ +// Everything declared/defined in this header is only required when WebRTC is +// build with H264 support, please do not move anything out of the +// #ifdef unless needed and tested. +#ifdef WEBRTC_USE_H264 + #include "modules/video_coding/codecs/h264/h264_decoder_impl.h" #include @@ -380,3 +385,5 @@ void H264DecoderImpl::ReportError() { } } // namespace webrtc + +#endif // WEBRTC_USE_H264 diff --git a/modules/video_coding/codecs/h264/h264_decoder_impl.h b/modules/video_coding/codecs/h264/h264_decoder_impl.h index 5e66e079e4..711496acd8 100644 --- a/modules/video_coding/codecs/h264/h264_decoder_impl.h +++ b/modules/video_coding/codecs/h264/h264_decoder_impl.h @@ -12,6 +12,15 @@ #ifndef MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ #define MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ +// Everything declared in this header is only required when WebRTC is +// build with H264 support, please do not move anything out of the +// #ifdef unless needed and tested. +#ifdef WEBRTC_USE_H264 + +#if defined(WEBRTC_WIN) && !defined(__clang__) +#error "See: bugs.webrtc.org/9213#c13." +#endif + #include #include "modules/video_coding/codecs/h264/include/h264.h" @@ -98,4 +107,6 @@ class H264DecoderImpl : public H264Decoder { } // namespace webrtc +#endif // WEBRTC_USE_H264 + #endif // MODULES_VIDEO_CODING_CODECS_H264_H264_DECODER_IMPL_H_ diff --git a/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/modules/video_coding/codecs/h264/h264_encoder_impl.cc index a8135bc6c7..88b667c65a 100644 --- a/modules/video_coding/codecs/h264/h264_encoder_impl.cc +++ b/modules/video_coding/codecs/h264/h264_encoder_impl.cc @@ -9,6 +9,11 @@ * */ +// Everything declared/defined in this header is only required when WebRTC is +// build with H264 support, please do not move anything out of the +// #ifdef unless needed and tested. +#ifdef WEBRTC_USE_H264 + #include "modules/video_coding/codecs/h264/h264_encoder_impl.h" #include @@ -659,3 +664,5 @@ void H264EncoderImpl::LayerConfig::SetStreamState(bool send_stream) { } } // namespace webrtc + +#endif // WEBRTC_USE_H264 diff --git a/modules/video_coding/codecs/h264/h264_encoder_impl.h b/modules/video_coding/codecs/h264/h264_encoder_impl.h index 74592efceb..09ca367073 100644 --- a/modules/video_coding/codecs/h264/h264_encoder_impl.h +++ b/modules/video_coding/codecs/h264/h264_encoder_impl.h @@ -12,6 +12,15 @@ #ifndef MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ #define MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_ +// Everything declared in this header is only required when WebRTC is +// build with H264 support, please do not move anything out of the +// #ifdef unless needed and tested. +#ifdef WEBRTC_USE_H264 + +#if defined(WEBRTC_WIN) && !defined(__clang__) +#error "See: bugs.webrtc.org/9213#c13." +#endif + #include #include @@ -104,4 +113,6 @@ class H264EncoderImpl : public H264Encoder { } // namespace webrtc +#endif // WEBRTC_USE_H264 + #endif // MODULES_VIDEO_CODING_CODECS_H264_H264_ENCODER_IMPL_H_