Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: webrtc/api/video/video_frame.cc

Issue 2517173004: Move VideoFrame and related declarations to webrtc/api/video. (Closed)
Patch Set: Make rotation check clearer. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/video/video_frame.h ('k') | webrtc/api/video/video_frame_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/video/video_frame.cc
diff --git a/webrtc/common_video/video_frame.cc b/webrtc/api/video/video_frame.cc
similarity index 67%
copy from webrtc/common_video/video_frame.cc
copy to webrtc/api/video/video_frame.cc
index d9c5c2f783cf6dcf7c0014112541017e5b04fb54..bd9c72c35272b6e9d3f9efb14ff005ad9c47297e 100644
--- a/webrtc/common_video/video_frame.cc
+++ b/webrtc/api/video/video_frame.cc
@@ -8,21 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/video_frame.h"
+#include "webrtc/api/video/video_frame.h"
-#include <string.h>
-
-#include <algorithm> // swap
-
-#include "webrtc/base/bind.h"
#include "webrtc/base/checks.h"
+#include "webrtc/base/timeutils.h"
namespace webrtc {
-// FFmpeg's decoder, used by H264DecoderImpl, requires up to 8 bytes padding due
-// to optimized bitstream readers. See avcodec_decode_video2.
-const size_t EncodedImage::kBufferPaddingBytesH264 = 8;
-
VideoFrame::VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
webrtc::VideoRotation rotation,
int64_t timestamp_us)
@@ -44,6 +36,13 @@ VideoFrame::VideoFrame(const rtc::scoped_refptr<VideoFrameBuffer>& buffer,
RTC_DCHECK(buffer);
}
+VideoFrame::~VideoFrame() = default;
+
+VideoFrame::VideoFrame(const VideoFrame&) = default;
+VideoFrame::VideoFrame(VideoFrame&&) = default;
+VideoFrame& VideoFrame::operator=(const VideoFrame&) = default;
+VideoFrame& VideoFrame::operator=(VideoFrame&&) = default;
+
int VideoFrame::width() const {
return video_frame_buffer_ ? video_frame_buffer_->width() : 0;
}
@@ -56,23 +55,12 @@ rtc::scoped_refptr<VideoFrameBuffer> VideoFrame::video_frame_buffer() const {
return video_frame_buffer_;
}
-size_t EncodedImage::GetBufferPaddingBytes(VideoCodecType codec_type) {
- switch (codec_type) {
- case kVideoCodecVP8:
- case kVideoCodecVP9:
- return 0;
- case kVideoCodecH264:
- return kBufferPaddingBytesH264;
- case kVideoCodecI420:
- case kVideoCodecRED:
- case kVideoCodecULPFEC:
- case kVideoCodecFlexfec:
- case kVideoCodecGeneric:
- case kVideoCodecUnknown:
- return 0;
- }
- RTC_NOTREACHED();
- return 0;
+void VideoFrame::set_render_time_ms(int64_t render_time_ms) {
+ set_timestamp_us(render_time_ms * rtc::kNumMicrosecsPerMillisec);
+}
+
+int64_t VideoFrame::render_time_ms() const {
+ return timestamp_us() / rtc::kNumMicrosecsPerMillisec;
}
} // namespace webrtc
« no previous file with comments | « webrtc/api/video/video_frame.h ('k') | webrtc/api/video/video_frame_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698