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

Unified Diff: webrtc/media/engine/webrtcvideoframe.cc

Issue 2075983003: Cleanups in cricket::VideoFrame and cricket::WebRtcVideoFrame. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: address feedback Created 4 years, 6 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
Index: webrtc/media/engine/webrtcvideoframe.cc
diff --git a/webrtc/media/engine/webrtcvideoframe.cc b/webrtc/media/engine/webrtcvideoframe.cc
index 4f89c8b85d100562d14cb891c6b11e8f67f247d1..091adc3c9ac26ad49ab6865fbe104d7e87373390 100644
--- a/webrtc/media/engine/webrtcvideoframe.cc
+++ b/webrtc/media/engine/webrtcvideoframe.cc
@@ -149,26 +149,11 @@ bool WebRtcVideoFrame::Reset(uint32_t format,
return true;
}
-VideoFrame* WebRtcVideoFrame::CreateEmptyFrame(int w,
- int h,
- int64_t timestamp_us) const {
- WebRtcVideoFrame* frame = new WebRtcVideoFrame();
- frame->InitToEmptyBuffer(w, h, rtc::kNumNanosecsPerMicrosec * timestamp_us);
- return frame;
-}
-
void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h) {
video_frame_buffer_ = new rtc::RefCountedObject<webrtc::I420Buffer>(w, h);
rotation_ = webrtc::kVideoRotation_0;
}
-void WebRtcVideoFrame::InitToEmptyBuffer(int w, int h,
- int64_t time_stamp_ns) {
- video_frame_buffer_ = new rtc::RefCountedObject<webrtc::I420Buffer>(w, h);
- SetTimeStamp(time_stamp_ns);
- rotation_ = webrtc::kVideoRotation_0;
-}
-
const VideoFrame* WebRtcVideoFrame::GetCopyWithRotationApplied() const {
// If the frame is not rotated, the caller should reuse this frame instead of
// making a redundant copy.
@@ -197,7 +182,9 @@ const VideoFrame* WebRtcVideoFrame::GetCopyWithRotationApplied() const {
}
rotated_frame_.reset(
- CreateEmptyFrame(rotated_width, rotated_height, timestamp_us_));
+ new WebRtcVideoFrame(new rtc::RefCountedObject<webrtc::I420Buffer>(
+ rotated_width, rotated_height),
+ webrtc::kVideoRotation_0, timestamp_us_));
// TODO(guoweis): Add a function in webrtc_libyuv.cc to convert from
// VideoRotation to libyuv::RotationMode.

Powered by Google App Engine
This is Rietveld 408576698