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

Unified Diff: content/renderer/media/webrtc/media_stream_remote_video_source.cc

Issue 1919283005: Eliminate calls to cricket::VideoFrame's GetNativeHandle, GetYPlane. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc/media_stream_remote_video_source.cc
diff --git a/content/renderer/media/webrtc/media_stream_remote_video_source.cc b/content/renderer/media/webrtc/media_stream_remote_video_source.cc
index b82695e2137cdb10d4f6839b6931d1ac4b1c1cd2..3d01a0de31779bfe8e6c921a4ed4343dba1b7031 100644
--- a/content/renderer/media/webrtc/media_stream_remote_video_source.cc
+++ b/content/renderer/media/webrtc/media_stream_remote_video_source.cc
@@ -93,9 +93,10 @@ void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate::OnFrame(
incoming_timestamp - start_timestamp_;
scoped_refptr<media::VideoFrame> video_frame;
- if (incoming_frame.GetNativeHandle() != NULL) {
+ if (incoming_frame.video_frame_buffer()->native_handle() != NULL) {
video_frame =
- static_cast<media::VideoFrame*>(incoming_frame.GetNativeHandle());
+ static_cast<media::VideoFrame*>(
+ incoming_frame.video_frame_buffer()->native_handle());
video_frame->set_timestamp(elapsed_timestamp);
} else {
const cricket::VideoFrame* frame =
@@ -110,10 +111,13 @@ void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate::OnFrame(
// need to const cast here.
video_frame = media::VideoFrame::WrapExternalYuvData(
media::PIXEL_FORMAT_YV12, size, gfx::Rect(size), size,
- frame->GetYPitch(), frame->GetUPitch(), frame->GetVPitch(),
- const_cast<uint8_t*>(frame->GetYPlane()),
- const_cast<uint8_t*>(frame->GetUPlane()),
- const_cast<uint8_t*>(frame->GetVPlane()), elapsed_timestamp);
+ frame->video_frame_buffer()->StrideY(),
+ frame->video_frame_buffer()->StrideU(),
+ frame->video_frame_buffer()->StrideV(),
+ const_cast<uint8_t*>(frame->video_frame_buffer()->DataY()),
+ const_cast<uint8_t*>(frame->video_frame_buffer()->DataU()),
+ const_cast<uint8_t*>(frame->video_frame_buffer()->DataV()),
+ elapsed_timestamp);
if (!video_frame)
return;
video_frame->AddDestructionObserver(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698