From b906172e02e695ecd302b6d78cb05ddd2643e6f9 Mon Sep 17 00:00:00 2001 From: kthelgason Date: Wed, 26 Oct 2016 02:48:16 -0700 Subject: [PATCH] Reland of Move bitstream parser to more appropriate directory. (patchset #1 id:1 of https://codereview.webrtc.org/2430353004/ ) Reason for revert: Internal project has been fixed Original issue's description: > Revert of Move bitstream parser to more appropriate directory. (patchset #4 id:60001 of https://codereview.webrtc.org/2370853005/ ) > > Reason for revert: > Breaks internal project > > Original issue's description: > > Move current bitstream parser to more appropriate directory. > > > > This CL groups together the code that has to do with parsing H264 bitstreams. > > This code logically belongs together, and having it in the same directory not > > only simplifies things from a project structure perspective, but also makes it > > easier to refactor out common parts incrementally. > > An added benefit is that this simplifies modular compilation, where for example > > one would like a build of WebRTC without the H264 codec-specific parts. > > > > BUG=webrtc:6338 > > > > Committed: https://crrev.com/cc6817e9ce4a5ffc73efb660cf0368afbc7d9a4f > > Cr-Commit-Position: refs/heads/master@{#14684} > > TBR=magjed@webrtc.org,stefan@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6338 > > Committed: https://crrev.com/f04f14e772f803de39f8a6128e5157127cd35103 > Cr-Commit-Position: refs/heads/master@{#14685} TBR=magjed@webrtc.org,stefan@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:6338 Review-Url: https://codereview.webrtc.org/2434043002 Cr-Commit-Position: refs/heads/master@{#14783} --- webrtc/api/android/jni/androidmediaencoder_jni.cc | 2 +- webrtc/common_video/BUILD.gn | 3 +++ webrtc/common_video/common_video.gyp | 2 ++ .../utility => common_video/h264}/h264_bitstream_parser.cc | 2 +- .../utility => common_video/h264}/h264_bitstream_parser.h | 6 +++--- .../h264}/h264_bitstream_parser_unittest.cc | 2 +- webrtc/modules/BUILD.gn | 1 - webrtc/modules/video_coding/BUILD.gn | 2 -- webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h | 2 +- .../video_coding/codecs/h264/h264_video_toolbox_encoder.h | 2 +- .../modules/video_coding/utility/video_coding_utility.gyp | 2 -- 11 files changed, 13 insertions(+), 13 deletions(-) rename webrtc/{modules/video_coding/utility => common_video/h264}/h264_bitstream_parser.cc (99%) rename webrtc/{modules/video_coding/utility => common_video/h264}/h264_bitstream_parser.h (89%) rename webrtc/{modules/video_coding/utility => common_video/h264}/h264_bitstream_parser_unittest.cc (96%) diff --git a/webrtc/api/android/jni/androidmediaencoder_jni.cc b/webrtc/api/android/jni/androidmediaencoder_jni.cc index ef3d4815ba..9ee99f0495 100644 --- a/webrtc/api/android/jni/androidmediaencoder_jni.cc +++ b/webrtc/api/android/jni/androidmediaencoder_jni.cc @@ -29,8 +29,8 @@ #include "webrtc/base/thread_checker.h" #include "webrtc/base/timeutils.h" #include "webrtc/common_types.h" +#include "webrtc/common_video/h264/h264_bitstream_parser.h" #include "webrtc/modules/video_coding/include/video_codec_interface.h" -#include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" #include "webrtc/modules/video_coding/utility/quality_scaler.h" #include "webrtc/modules/video_coding/utility/vp8_header_parser.h" #include "webrtc/system_wrappers/include/field_trial.h" diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn index 5fbe1e875c..9830c8b942 100644 --- a/webrtc/common_video/BUILD.gn +++ b/webrtc/common_video/BUILD.gn @@ -18,6 +18,8 @@ config("common_video_config") { rtc_static_library("common_video") { sources = [ "bitrate_adjuster.cc", + "h264/h264_bitstream_parser.cc", + "h264/h264_bitstream_parser.h", "h264/h264_common.cc", "h264/h264_common.h", "h264/pps_parser.cc", @@ -93,6 +95,7 @@ if (rtc_include_tests) { sources = [ "bitrate_adjuster_unittest.cc", + "h264/h264_bitstream_parser_unittest.cc", "h264/pps_parser_unittest.cc", "h264/sps_parser_unittest.cc", "h264/sps_vui_rewriter_unittest.cc", diff --git a/webrtc/common_video/common_video.gyp b/webrtc/common_video/common_video.gyp index eee0c048e7..cb9b7037cb 100644 --- a/webrtc/common_video/common_video.gyp +++ b/webrtc/common_video/common_video.gyp @@ -62,6 +62,8 @@ 'h264/pps_parser.h', 'h264/sps_parser.cc', 'h264/sps_parser.h', + 'h264/h264_bitstream_parser.cc', + 'h264/h264_bitstream_parser.h', 'i420_buffer_pool.cc', 'video_frame.cc', 'incoming_video_stream.cc', diff --git a/webrtc/modules/video_coding/utility/h264_bitstream_parser.cc b/webrtc/common_video/h264/h264_bitstream_parser.cc similarity index 99% rename from webrtc/modules/video_coding/utility/h264_bitstream_parser.cc rename to webrtc/common_video/h264/h264_bitstream_parser.cc index 97cd003869..28b92e1241 100644 --- a/webrtc/modules/video_coding/utility/h264_bitstream_parser.cc +++ b/webrtc/common_video/h264/h264_bitstream_parser.cc @@ -7,7 +7,7 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" +#include "webrtc/common_video/h264/h264_bitstream_parser.h" #include #include diff --git a/webrtc/modules/video_coding/utility/h264_bitstream_parser.h b/webrtc/common_video/h264/h264_bitstream_parser.h similarity index 89% rename from webrtc/modules/video_coding/utility/h264_bitstream_parser.h rename to webrtc/common_video/h264/h264_bitstream_parser.h index 6a779e156b..0b84e40234 100644 --- a/webrtc/modules/video_coding/utility/h264_bitstream_parser.h +++ b/webrtc/common_video/h264/h264_bitstream_parser.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_MODULES_VIDEO_CODING_UTILITY_H264_BITSTREAM_PARSER_H_ -#define WEBRTC_MODULES_VIDEO_CODING_UTILITY_H264_BITSTREAM_PARSER_H_ +#ifndef WEBRTC_COMMON_VIDEO_H264_H264_BITSTREAM_PARSER_H_ +#define WEBRTC_COMMON_VIDEO_H264_H264_BITSTREAM_PARSER_H_ #include #include @@ -56,4 +56,4 @@ class H264BitstreamParser { } // namespace webrtc -#endif // WEBRTC_MODULES_VIDEO_CODING_UTILITY_H264_BITSTREAM_PARSER_H_ +#endif // WEBRTC_COMMON_VIDEO_H264_H264_BITSTREAM_PARSER_H_ diff --git a/webrtc/modules/video_coding/utility/h264_bitstream_parser_unittest.cc b/webrtc/common_video/h264/h264_bitstream_parser_unittest.cc similarity index 96% rename from webrtc/modules/video_coding/utility/h264_bitstream_parser_unittest.cc rename to webrtc/common_video/h264/h264_bitstream_parser_unittest.cc index fbacd3b9ed..e9bfac84de 100644 --- a/webrtc/modules/video_coding/utility/h264_bitstream_parser_unittest.cc +++ b/webrtc/common_video/h264/h264_bitstream_parser_unittest.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" +#include "webrtc/common_video/h264/h264_bitstream_parser.h" #include "webrtc/test/gtest.h" diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn index 0b08e9079e..ee18569ff8 100644 --- a/webrtc/modules/BUILD.gn +++ b/webrtc/modules/BUILD.gn @@ -491,7 +491,6 @@ if (rtc_include_tests) { "video_coding/test/stream_generator.h", "video_coding/timing_unittest.cc", "video_coding/utility/frame_dropper_unittest.cc", - "video_coding/utility/h264_bitstream_parser_unittest.cc", "video_coding/utility/ivf_file_writer_unittest.cc", "video_coding/utility/moving_average_unittest.cc", "video_coding/utility/quality_scaler_unittest.cc", diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index 4836207a9f..a21a79bbd9 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -98,8 +98,6 @@ rtc_static_library("video_coding_utility") { sources = [ "utility/frame_dropper.cc", "utility/frame_dropper.h", - "utility/h264_bitstream_parser.cc", - "utility/h264_bitstream_parser.h", "utility/ivf_file_writer.cc", "utility/ivf_file_writer.h", "utility/moving_average.cc", diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h index c6014e6651..3713896a8b 100644 --- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h +++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.h @@ -15,8 +15,8 @@ #include #include +#include "webrtc/common_video/h264/h264_bitstream_parser.h" #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" -#include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" #include "webrtc/modules/video_coding/utility/quality_scaler.h" #include "third_party/openh264/src/codec/api/svc/codec_app_def.h" diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h index 673a6e28ef..2b387563d3 100644 --- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h +++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_encoder.h @@ -13,10 +13,10 @@ #define WEBRTC_MODULES_VIDEO_CODING_CODECS_H264_H264_VIDEO_TOOLBOX_ENCODER_H_ #include "webrtc/base/criticalsection.h" +#include "webrtc/common_video/h264/h264_bitstream_parser.h" #include "webrtc/common_video/include/bitrate_adjuster.h" #include "webrtc/common_video/rotation.h" #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" -#include "webrtc/modules/video_coding/utility/h264_bitstream_parser.h" #include "webrtc/modules/video_coding/utility/quality_scaler.h" #if defined(WEBRTC_VIDEO_TOOLBOX_SUPPORTED) diff --git a/webrtc/modules/video_coding/utility/video_coding_utility.gyp b/webrtc/modules/video_coding/utility/video_coding_utility.gyp index e4ed78f211..b1158a2298 100644 --- a/webrtc/modules/video_coding/utility/video_coding_utility.gyp +++ b/webrtc/modules/video_coding/utility/video_coding_utility.gyp @@ -21,8 +21,6 @@ 'sources': [ 'frame_dropper.cc', 'frame_dropper.h', - 'h264_bitstream_parser.cc', - 'h264_bitstream_parser.h', 'ivf_file_writer.cc', 'ivf_file_writer.h', 'moving_average.cc',