Chromium Code Reviews| Index: webrtc/api/video/video_frame.h |
| diff --git a/webrtc/video_frame.h b/webrtc/api/video/video_frame.h |
| similarity index 62% |
| copy from webrtc/video_frame.h |
| copy to webrtc/api/video/video_frame.h |
| index a834f83ddf1333c74e3f3f70779e905248aceec2..599e8b94fdb1f06ed7a6f10bf2d41a577f689579 100644 |
| --- a/webrtc/video_frame.h |
| +++ b/webrtc/api/video/video_frame.h |
| @@ -8,15 +8,14 @@ |
| * be found in the AUTHORS file in the root of the source tree. |
| */ |
| -#ifndef WEBRTC_VIDEO_FRAME_H_ |
| -#define WEBRTC_VIDEO_FRAME_H_ |
| +#ifndef WEBRTC_API_VIDEO_VIDEO_FRAME_H_ |
| +#define WEBRTC_API_VIDEO_VIDEO_FRAME_H_ |
|
the sun
2016/11/24 10:36:59
nit: add stdint.h
nisse-webrtc
2016/11/25 08:58:02
Done. (It was indirectly included, via video_frame
|
| -#include "webrtc/base/scoped_ref_ptr.h" |
| -#include "webrtc/base/timeutils.h" |
| -#include "webrtc/common_types.h" |
| -#include "webrtc/common_video/include/video_frame_buffer.h" |
| -#include "webrtc/common_video/rotation.h" |
| -#include "webrtc/typedefs.h" |
| +#include "webrtc/api/video/rotation.h" |
| + |
| +// TODO(nisse): Including the abstract interface here makes more sense |
| +// than forward declaring it. Right? |
|
the sun
2016/11/24 10:36:59
Agree.
nisse-webrtc
2016/11/25 08:58:02
Good. TODO comment deleted.
|
| +#include "webrtc/api/video/video_frame_buffer.h" |
| namespace webrtc { |
| @@ -41,11 +40,13 @@ class VideoFrame { |
| int64_t render_time_ms, |
| VideoRotation rotation); |
| + ~VideoFrame(); |
| + |
| // Support move and copy. |
| - VideoFrame(const VideoFrame&) = default; |
| - VideoFrame(VideoFrame&&) = default; |
| - VideoFrame& operator=(const VideoFrame&) = default; |
| - VideoFrame& operator=(VideoFrame&&) = default; |
| + VideoFrame(const VideoFrame&); |
| + VideoFrame(VideoFrame&&); |
| + VideoFrame& operator=(const VideoFrame&); |
| + VideoFrame& operator=(VideoFrame&&); |
| // Get frame width. |
| int width() const; |
| @@ -97,14 +98,10 @@ class VideoFrame { |
| } |
| // Set render time in milliseconds. |
| - void set_render_time_ms(int64_t render_time_ms) { |
| - set_timestamp_us(render_time_ms * rtc::kNumMicrosecsPerMillisec);; |
| - } |
| + void set_render_time_ms(int64_t render_time_ms); |
| // Get render time in milliseconds. |
| - int64_t render_time_ms() const { |
| - return timestamp_us() / rtc::kNumMicrosecsPerMillisec; |
| - } |
| + int64_t render_time_ms() const; |
| // Return true if and only if video_frame_buffer() is null. Which is possible |
| // only if the object was default-constructed. |
| @@ -134,53 +131,6 @@ class VideoFrame { |
| VideoRotation rotation_; |
| }; |
| - |
| -// 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) {} |
| - |
| - struct AdaptReason { |
| - AdaptReason() |
| - : quality_resolution_downscales(-1), |
| - bw_resolutions_disabled(-1) {} |
| - |
| - int quality_resolution_downscales; // Number of times this frame is down |
| - // scaled in resolution due to quality. |
| - // Or -1 if information is not provided. |
| - 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; |
| - 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_ |
| + |
| +#endif // WEBRTC_API_VIDEO_VIDEO_FRAME_H_ |