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}
This commit is contained in:
nisse
2017-05-15 02:42:11 -07:00
committed by Commit bot
parent c99bddfc1c
commit ea3a7987d2
23 changed files with 106 additions and 92 deletions

View File

@ -231,6 +231,20 @@ rtc_source_set("video_stream_api") {
]
}
# 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") {

View File

@ -14,7 +14,6 @@ include_rules = [
"+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",

View File

@ -19,11 +19,9 @@ rtc_source_set("video_codecs_api") {
]
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",
]
}

View File

@ -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 {

View File

@ -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 {

View File

@ -36,6 +36,7 @@ rtc_static_library("common_video") {
"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",

View File

@ -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_

View File

@ -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_

View File

@ -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>

View File

@ -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 {

View File

@ -13,7 +13,7 @@
#include <vector>
#include "webrtc/common_video/include/video_image.h"
#include "webrtc/common_types.h"
namespace webrtc {
namespace test {

View File

@ -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;

View File

@ -14,7 +14,6 @@
#include <vector>
#include "webrtc/common_video/include/video_image.h"
#include "webrtc/typedefs.h"
struct vpx_codec_enc_cfg;

View File

@ -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 {

View File

@ -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"

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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"

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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_