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

Side by Side Diff: content/renderer/media/webrtc/media_stream_remote_video_source.cc

Issue 1588493002: Delete testing of GetPixelWidth and GetPixelWidth, so they can be deleted in webrtc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h" 5 #include "content/renderer/media/webrtc/media_stream_remote_video_source.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (incoming_frame->GetNativeHandle() != NULL) { 97 if (incoming_frame->GetNativeHandle() != NULL) {
98 video_frame = 98 video_frame =
99 static_cast<media::VideoFrame*>(incoming_frame->GetNativeHandle()); 99 static_cast<media::VideoFrame*>(incoming_frame->GetNativeHandle());
100 video_frame->set_timestamp(elapsed_timestamp); 100 video_frame->set_timestamp(elapsed_timestamp);
101 } else { 101 } else {
102 const cricket::VideoFrame* frame = 102 const cricket::VideoFrame* frame =
103 incoming_frame->GetCopyWithRotationApplied(); 103 incoming_frame->GetCopyWithRotationApplied();
104 104
105 gfx::Size size(frame->GetWidth(), frame->GetHeight()); 105 gfx::Size size(frame->GetWidth(), frame->GetHeight());
106 106
107 // Non-square pixels are unsupported.
108 DCHECK_EQ(frame->GetPixelWidth(), 1u);
109 DCHECK_EQ(frame->GetPixelHeight(), 1u);
110
111 // Make a shallow copy. Both |frame| and |video_frame| will share a single 107 // Make a shallow copy. Both |frame| and |video_frame| will share a single
112 // reference counted frame buffer. Const cast and hope no one will overwrite 108 // reference counted frame buffer. Const cast and hope no one will overwrite
113 // the data. 109 // the data.
114 // TODO(magjed): Update media::VideoFrame to support const data so we don't 110 // TODO(magjed): Update media::VideoFrame to support const data so we don't
115 // need to const cast here. 111 // need to const cast here.
116 video_frame = media::VideoFrame::WrapExternalYuvData( 112 video_frame = media::VideoFrame::WrapExternalYuvData(
117 media::PIXEL_FORMAT_YV12, size, gfx::Rect(size), size, 113 media::PIXEL_FORMAT_YV12, size, gfx::Rect(size), size,
118 frame->GetYPitch(), frame->GetUPitch(), frame->GetVPitch(), 114 frame->GetYPitch(), frame->GetUPitch(), frame->GetVPitch(),
119 const_cast<uint8_t*>(frame->GetYPlane()), 115 const_cast<uint8_t*>(frame->GetYPlane()),
120 const_cast<uint8_t*>(frame->GetUPlane()), 116 const_cast<uint8_t*>(frame->GetUPlane()),
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 case webrtc::MediaStreamTrackInterface::kEnded: 215 case webrtc::MediaStreamTrackInterface::kEnded:
220 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); 216 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded);
221 break; 217 break;
222 default: 218 default:
223 NOTREACHED(); 219 NOTREACHED();
224 break; 220 break;
225 } 221 }
226 } 222 }
227 223
228 } // namespace content 224 } // namespace content
OLDNEW
« 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