Move webrtc/video_frame to common_video/include.
BUG=webrtc:7616
Review-Url: https://codereview.webrtc.org/2877703002
Cr-Commit-Position: refs/heads/master@{#18147}
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index db0c067..863f062 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -231,6 +231,20 @@
]
}
+# Contents of video_frame.h is moved from top-level down to common_video/.
+# Nothing in webrtc includes the backwards-compatibility header, so this target
+# is only for completeness.
+# TODO(nisse): Delete together with the header file once downstream applications
+# no longer use it.
+rtc_source_set("video_frame_deprecated") {
+ sources = [
+ "video_frame.h",
+ ]
+ deps = [
+ "common_video",
+ ]
+}
+
if (!build_with_chromium) {
# Target to build all the WebRTC production code.
rtc_static_library("webrtc") {
diff --git a/webrtc/DEPS b/webrtc/DEPS
index d4ebc55..0f6d237 100644
--- a/webrtc/DEPS
+++ b/webrtc/DEPS
@@ -14,7 +14,6 @@
"+webrtc/config.h",
"+webrtc/transport.h",
"+webrtc/typedefs.h",
- "+webrtc/video_frame.h",
"+webrtc/video_receive_stream.h",
"+webrtc/video_send_stream.h",
"+webrtc/voice_engine_configurations.h",
diff --git a/webrtc/api/video_codecs/BUILD.gn b/webrtc/api/video_codecs/BUILD.gn
index 5562eec..d435534 100644
--- a/webrtc/api/video_codecs/BUILD.gn
+++ b/webrtc/api/video_codecs/BUILD.gn
@@ -19,11 +19,9 @@
]
deps = [
- # TODO(ilnik): Add dependency on webrtc/video_frame.h when it will have it's
- # own build target.
-
"..:video_frame_api",
"../..:webrtc_common",
"../../base:rtc_base_approved",
+ "../../common_video",
]
}
diff --git a/webrtc/api/video_codecs/video_decoder.h b/webrtc/api/video_codecs/video_decoder.h
index 04deaed..ea531e4 100644
--- a/webrtc/api/video_codecs/video_decoder.h
+++ b/webrtc/api/video_codecs/video_decoder.h
@@ -17,8 +17,8 @@
#include "webrtc/api/video/video_frame.h"
#include "webrtc/common_types.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/typedefs.h"
-#include "webrtc/video_frame.h"
namespace webrtc {
diff --git a/webrtc/api/video_codecs/video_encoder.h b/webrtc/api/video_codecs/video_encoder.h
index 5d21ed9..0c95dfa 100644
--- a/webrtc/api/video_codecs/video_encoder.h
+++ b/webrtc/api/video_codecs/video_encoder.h
@@ -18,8 +18,8 @@
#include "webrtc/api/video/video_frame.h"
#include "webrtc/base/checks.h"
#include "webrtc/common_types.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/typedefs.h"
-#include "webrtc/video_frame.h"
#include "webrtc/base/optional.h"
namespace webrtc {
diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn
index d6005d0..043e19d 100644
--- a/webrtc/common_video/BUILD.gn
+++ b/webrtc/common_video/BUILD.gn
@@ -36,6 +36,7 @@
"include/i420_buffer_pool.h",
"include/incoming_video_stream.h",
"include/video_bitrate_allocator.h",
+ "include/video_frame.h",
"include/video_frame_buffer.h",
"incoming_video_stream.cc",
"libyuv/include/webrtc_libyuv.h",
diff --git a/webrtc/common_video/include/video_frame.h b/webrtc/common_video/include/video_frame.h
new file mode 100644
index 0000000..1e8f37c
--- /dev/null
+++ b/webrtc/common_video/include/video_frame.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_H_
+#define WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_H_
+
+// TODO(nisse): This header file should eventually be deleted. The
+// EncodedImage class stays in this file until we have figured out how
+// to refactor and clean up related interfaces, at which point it
+// should be moved to somewhere under api/.
+
+#include "webrtc/common_types.h"
+#include "webrtc/typedefs.h"
+
+namespace webrtc {
+
+// TODO(pbos): Rename EncodedFrame and reformat this class' members.
+class EncodedImage {
+ public:
+ static const size_t kBufferPaddingBytesH264;
+
+ // Some decoders require encoded image buffers to be padded with a small
+ // number of additional bytes (due to over-reading byte readers).
+ static size_t GetBufferPaddingBytes(VideoCodecType codec_type);
+
+ EncodedImage() : EncodedImage(nullptr, 0, 0) {}
+
+ EncodedImage(uint8_t* buffer, size_t length, size_t size)
+ : _buffer(buffer), _length(length), _size(size) {}
+
+ // TODO(kthelgason): get rid of this struct as it only has a single member
+ // remaining.
+ struct AdaptReason {
+ AdaptReason() : bw_resolutions_disabled(-1) {}
+ int bw_resolutions_disabled; // Number of resolutions that are not sent
+ // due to bandwidth for this frame.
+ // Or -1 if information is not provided.
+ };
+ uint32_t _encodedWidth = 0;
+ uint32_t _encodedHeight = 0;
+ uint32_t _timeStamp = 0;
+ // NTP time of the capture time in local timebase in milliseconds.
+ int64_t ntp_time_ms_ = 0;
+ int64_t capture_time_ms_ = 0;
+ FrameType _frameType = kVideoFrameDelta;
+ uint8_t* _buffer;
+ size_t _length;
+ size_t _size;
+ VideoRotation rotation_ = kVideoRotation_0;
+ VideoContentType content_type_ = VideoContentType::UNSPECIFIED;
+ bool _completeFrame = false;
+ AdaptReason adapt_reason_;
+ int qp_ = -1; // Quantizer value.
+
+ // When an application indicates non-zero values here, it is taken as an
+ // indication that all future frames will be constrained with those limits
+ // until the application indicates a change again.
+ PlayoutDelay playout_delay_ = {-1, -1};
+};
+
+} // namespace webrtc
+
+#endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_H_
diff --git a/webrtc/common_video/include/video_image.h b/webrtc/common_video/include/video_image.h
deleted file mode 100644
index 4a6e451..0000000
--- a/webrtc/common_video/include/video_image.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_IMAGE_H_
-#define WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_IMAGE_H_
-
-// TODO(pbos): Remove this file and include webrtc/video_frame.h instead.
-#include "webrtc/video_frame.h"
-
-#endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_IMAGE_H_
diff --git a/webrtc/common_video/video_frame.cc b/webrtc/common_video/video_frame.cc
index 55eb535..f062b73 100644
--- a/webrtc/common_video/video_frame.cc
+++ b/webrtc/common_video/video_frame.cc
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/video_frame.h"
+#include "webrtc/common_video/include/video_frame.h"
#include <string.h>
diff --git a/webrtc/modules/video_coding/codecs/test/mock/mock_packet_manipulator.h b/webrtc/modules/video_coding/codecs/test/mock/mock_packet_manipulator.h
index f00302e..a086a88 100644
--- a/webrtc/modules/video_coding/codecs/test/mock/mock_packet_manipulator.h
+++ b/webrtc/modules/video_coding/codecs/test/mock/mock_packet_manipulator.h
@@ -16,7 +16,7 @@
#include "webrtc/modules/video_coding/codecs/test/packet_manipulator.h"
#include "webrtc/test/gmock.h"
#include "webrtc/typedefs.h"
-#include "webrtc/video_frame.h"
+#include "webrtc/common_video/include/video_frame.h"
namespace webrtc {
namespace test {
diff --git a/webrtc/modules/video_coding/codecs/test/stats.h b/webrtc/modules/video_coding/codecs/test/stats.h
index d2dd303..452ab6e 100644
--- a/webrtc/modules/video_coding/codecs/test/stats.h
+++ b/webrtc/modules/video_coding/codecs/test/stats.h
@@ -13,7 +13,7 @@
#include <vector>
-#include "webrtc/common_video/include/video_image.h"
+#include "webrtc/common_types.h"
namespace webrtc {
namespace test {
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h b/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
index 6c37202..dfb15a9 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
@@ -19,13 +19,13 @@
#include "webrtc/api/video/i420_buffer.h"
#include "webrtc/api/video/video_frame.h"
#include "webrtc/base/checks.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/simulcast_rate_allocator.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h"
#include "webrtc/test/gtest.h"
-#include "webrtc/video_frame.h"
using ::testing::_;
using ::testing::AllOf;
diff --git a/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h b/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h
index f5d2aab..9b12291 100644
--- a/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h
+++ b/webrtc/modules/video_coding/codecs/vp8/temporal_layers.h
@@ -14,7 +14,6 @@
#include <vector>
-#include "webrtc/common_video/include/video_image.h"
#include "webrtc/typedefs.h"
struct vpx_codec_enc_cfg;
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
index 0d7ecba..376dde1 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.h
@@ -25,11 +25,11 @@
#include "webrtc/api/video/video_frame.h"
#include "webrtc/common_video/include/i420_buffer_pool.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/modules/video_coding/codecs/vp8/include/vp8.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
-#include "webrtc/video_frame.h"
namespace webrtc {
diff --git a/webrtc/modules/video_coding/encoded_frame.h b/webrtc/modules/video_coding/encoded_frame.h
index fc17264..2d65e9c 100644
--- a/webrtc/modules/video_coding/encoded_frame.h
+++ b/webrtc/modules/video_coding/encoded_frame.h
@@ -14,7 +14,7 @@
#include <vector>
#include "webrtc/common_types.h"
-#include "webrtc/common_video/include/video_image.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/modules/video_coding/include/video_coding_defines.h"
diff --git a/webrtc/modules/video_coding/include/video_coding_defines.h b/webrtc/modules/video_coding/include/video_coding_defines.h
index 278a6b5..b27bcd9 100644
--- a/webrtc/modules/video_coding/include/video_coding_defines.h
+++ b/webrtc/modules/video_coding/include/video_coding_defines.h
@@ -15,10 +15,10 @@
#include <vector>
#include "webrtc/api/video/video_frame.h"
+// For EncodedImage
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/typedefs.h"
-// For EncodedImage
-#include "webrtc/video_frame.h"
namespace webrtc {
diff --git a/webrtc/modules/video_coding/utility/ivf_file_writer.h b/webrtc/modules/video_coding/utility/ivf_file_writer.h
index b556111..374b807 100644
--- a/webrtc/modules/video_coding/utility/ivf_file_writer.h
+++ b/webrtc/modules/video_coding/utility/ivf_file_writer.h
@@ -17,8 +17,8 @@
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/file.h"
#include "webrtc/base/timeutils.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/modules/include/module_common_types.h"
-#include "webrtc/video_frame.h"
namespace webrtc {
diff --git a/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_decoder.cc b/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_decoder.cc
index a910066..efaaeeb 100644
--- a/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_decoder.cc
+++ b/webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_decoder.cc
@@ -20,9 +20,9 @@
#include "webrtc/api/video/video_frame.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/sdk/objc/Framework/Classes/corevideo_frame_buffer.h"
#include "webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_nalu.h"
-#include "webrtc/video_frame.h"
namespace webrtc {
namespace {
diff --git a/webrtc/test/configurable_frame_size_encoder.cc b/webrtc/test/configurable_frame_size_encoder.cc
index bef6240..0cb90a6 100644
--- a/webrtc/test/configurable_frame_size_encoder.cc
+++ b/webrtc/test/configurable_frame_size_encoder.cc
@@ -13,7 +13,7 @@
#include <string.h>
#include "webrtc/base/checks.h"
-#include "webrtc/common_video/include/video_image.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
#include "webrtc/test/gtest.h"
diff --git a/webrtc/video/overuse_frame_detector_unittest.cc b/webrtc/video/overuse_frame_detector_unittest.cc
index 044b11f..bf1c8b4 100644
--- a/webrtc/video/overuse_frame_detector_unittest.cc
+++ b/webrtc/video/overuse_frame_detector_unittest.cc
@@ -13,10 +13,10 @@
#include "webrtc/api/video/i420_buffer.h"
#include "webrtc/base/event.h"
#include "webrtc/base/fakeclock.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/test/gmock.h"
#include "webrtc/test/gtest.h"
#include "webrtc/video/overuse_frame_detector.h"
-#include "webrtc/video_frame.h"
#include "webrtc/modules/video_coding/utility/quality_scaler.h"
namespace webrtc {
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index 23dbffa..58ac2b4 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -21,6 +21,7 @@
#include "webrtc/base/timeutils.h"
#include "webrtc/call/call.h"
#include "webrtc/common_video/include/frame_callback.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
#include "webrtc/modules/rtp_rtcp/source/rtcp_sender.h"
@@ -41,7 +42,6 @@
#include "webrtc/video/send_statistics_proxy.h"
#include "webrtc/video/transport_adapter.h"
-#include "webrtc/video_frame.h"
#include "webrtc/video_send_stream.h"
namespace webrtc {
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index ed6d07c..cd0f3eb 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -22,6 +22,7 @@
#include "webrtc/base/timeutils.h"
#include "webrtc/base/trace_event.h"
#include "webrtc/common_video/include/video_bitrate_allocator.h"
+#include "webrtc/common_video/include/video_frame.h"
#include "webrtc/modules/pacing/paced_sender.h"
#include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
#include "webrtc/modules/video_coding/include/video_codec_initializer.h"
@@ -29,7 +30,7 @@
#include "webrtc/modules/video_coding/include/video_coding_defines.h"
#include "webrtc/video/overuse_frame_detector.h"
#include "webrtc/video/send_statistics_proxy.h"
-#include "webrtc/video_frame.h"
+
namespace webrtc {
namespace {
diff --git a/webrtc/video_frame.h b/webrtc/video_frame.h
index 93cc171..76975e8 100644
--- a/webrtc/video_frame.h
+++ b/webrtc/video_frame.h
@@ -11,60 +11,9 @@
#ifndef WEBRTC_VIDEO_FRAME_H_
#define WEBRTC_VIDEO_FRAME_H_
-// TODO(nisse): This header file should eventually be deleted. For
-// declarations of classes related to unencoded video frame, use the
-// headers under api/video instead. The EncodedImage class stays in
-// this file until we have figured out how to refactor and clean up
-// related interfaces.
+// TODO(nisse): Delete this wrapper file, as soon as downstream
+// projects are updated.
-#include "webrtc/common_types.h"
-#include "webrtc/typedefs.h"
+#include "webrtc/common_video/include/video_frame.h"
-namespace webrtc {
-
-// TODO(pbos): Rename EncodedFrame and reformat this class' members.
-class EncodedImage {
- public:
- static const size_t kBufferPaddingBytesH264;
-
- // Some decoders require encoded image buffers to be padded with a small
- // number of additional bytes (due to over-reading byte readers).
- static size_t GetBufferPaddingBytes(VideoCodecType codec_type);
-
- EncodedImage() : EncodedImage(nullptr, 0, 0) {}
-
- EncodedImage(uint8_t* buffer, size_t length, size_t size)
- : _buffer(buffer), _length(length), _size(size) {}
-
- // TODO(kthelgason): get rid of this struct as it only has a single member
- // remaining.
- struct AdaptReason {
- AdaptReason() : bw_resolutions_disabled(-1) {}
- int bw_resolutions_disabled; // Number of resolutions that are not sent
- // due to bandwidth for this frame.
- // Or -1 if information is not provided.
- };
- uint32_t _encodedWidth = 0;
- uint32_t _encodedHeight = 0;
- uint32_t _timeStamp = 0;
- // NTP time of the capture time in local timebase in milliseconds.
- int64_t ntp_time_ms_ = 0;
- int64_t capture_time_ms_ = 0;
- FrameType _frameType = kVideoFrameDelta;
- uint8_t* _buffer;
- size_t _length;
- size_t _size;
- VideoRotation rotation_ = kVideoRotation_0;
- VideoContentType content_type_ = VideoContentType::UNSPECIFIED;
- bool _completeFrame = false;
- AdaptReason adapt_reason_;
- int qp_ = -1; // Quantizer value.
-
- // When an application indicates non-zero values here, it is taken as an
- // indication that all future frames will be constrained with those limits
- // until the application indicates a change again.
- PlayoutDelay playout_delay_ = {-1, -1};
-};
-
-} // namespace webrtc
#endif // WEBRTC_VIDEO_FRAME_H_