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

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

Issue 1921493004: Revert of Delete cricket::VideoFrame methods GetYPlane and GetYPitch. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 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/media/engine/webrtcvideoframe.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/webrtcvideoframe.cc
diff --git a/webrtc/media/engine/webrtcvideoframe.cc b/webrtc/media/engine/webrtcvideoframe.cc
index cda00275f70d2d87b6a20105fa14a474a8459e08..145f265f282958d5f1210b11899b0ee5d09d6916 100644
--- a/webrtc/media/engine/webrtcvideoframe.cc
+++ b/webrtc/media/engine/webrtcvideoframe.cc
@@ -79,6 +79,45 @@
return video_frame_buffer_ ? video_frame_buffer_->height() : 0;
}
+const uint8_t* WebRtcVideoFrame::GetYPlane() const {
+ return video_frame_buffer_ ? video_frame_buffer_->DataY() : nullptr;
+}
+
+const uint8_t* WebRtcVideoFrame::GetUPlane() const {
+ return video_frame_buffer_ ? video_frame_buffer_->DataU() : nullptr;
+}
+
+const uint8_t* WebRtcVideoFrame::GetVPlane() const {
+ return video_frame_buffer_ ? video_frame_buffer_->DataV() : nullptr;
+}
+
+uint8_t* WebRtcVideoFrame::GetYPlane() {
+ return video_frame_buffer_ ? video_frame_buffer_->MutableData(kYPlane)
+ : nullptr;
+}
+
+uint8_t* WebRtcVideoFrame::GetUPlane() {
+ return video_frame_buffer_ ? video_frame_buffer_->MutableData(kUPlane)
+ : nullptr;
+}
+
+uint8_t* WebRtcVideoFrame::GetVPlane() {
+ return video_frame_buffer_ ? video_frame_buffer_->MutableData(kVPlane)
+ : nullptr;
+}
+
+int32_t WebRtcVideoFrame::GetYPitch() const {
+ return video_frame_buffer_ ? video_frame_buffer_->StrideY() : 0;
+}
+
+int32_t WebRtcVideoFrame::GetUPitch() const {
+ return video_frame_buffer_ ? video_frame_buffer_->StrideU() : 0;
+}
+
+int32_t WebRtcVideoFrame::GetVPitch() const {
+ return video_frame_buffer_ ? video_frame_buffer_->StrideV() : 0;
+}
+
bool WebRtcVideoFrame::IsExclusive() const {
return video_frame_buffer_->IsMutable();
}
@@ -87,7 +126,7 @@
return video_frame_buffer_ ? video_frame_buffer_->native_handle() : nullptr;
}
-const rtc::scoped_refptr<webrtc::VideoFrameBuffer>&
+rtc::scoped_refptr<webrtc::VideoFrameBuffer>
WebRtcVideoFrame::video_frame_buffer() const {
return video_frame_buffer_;
}
@@ -142,12 +181,9 @@
int idh = (h < 0) ? -dh : dh;
int r = libyuv::ConvertToI420(
sample, sample_size,
- video_frame_buffer_->MutableDataY(),
- video_frame_buffer_->StrideY(),
- video_frame_buffer_->MutableDataU(),
- video_frame_buffer_->StrideU(),
- video_frame_buffer_->MutableDataV(),
- video_frame_buffer_->StrideV(),
+ GetYPlane(), GetYPitch(),
+ GetUPlane(), GetUPitch(),
+ GetVPlane(), GetVPitch(),
horiz_crop, vert_crop,
w, h,
dw, idh,
@@ -216,15 +252,10 @@
// TODO(guoweis): Add a function in webrtc_libyuv.cc to convert from
// VideoRotation to libyuv::RotationMode.
int ret = libyuv::I420Rotate(
- video_frame_buffer_->DataY(), video_frame_buffer_->StrideY(),
- video_frame_buffer_->DataU(), video_frame_buffer_->StrideU(),
- video_frame_buffer_->DataV(), video_frame_buffer_->StrideV(),
- rotated_frame_->video_frame_buffer()->MutableDataY(),
- rotated_frame_->video_frame_buffer()->StrideY(),
- rotated_frame_->video_frame_buffer()->MutableDataU(),
- rotated_frame_->video_frame_buffer()->StrideU(),
- rotated_frame_->video_frame_buffer()->MutableDataV(),
- rotated_frame_->video_frame_buffer()->StrideV(),
+ GetYPlane(), GetYPitch(), GetUPlane(), GetUPitch(), GetVPlane(),
+ GetVPitch(), rotated_frame_->GetYPlane(), rotated_frame_->GetYPitch(),
+ rotated_frame_->GetUPlane(), rotated_frame_->GetUPitch(),
+ rotated_frame_->GetVPlane(), rotated_frame_->GetVPitch(),
orig_width, orig_height,
static_cast<libyuv::RotationMode>(rotation()));
if (ret == 0) {
« no previous file with comments | « webrtc/media/engine/webrtcvideoframe.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698