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

Side by Side Diff: content/renderer/pepper/pepper_media_stream_video_track_host.cc

Issue 2867693004: Snapshot of all changes to get jumbo in blink and content.
Patch Set: Rebased again Created 3 years, 5 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
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/pepper/pepper_media_stream_video_track_host.h" 5 #include "content/renderer/pepper/pepper_media_stream_video_track_host.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 13 matching lines...) Expand all
24 #include "ppapi/proxy/ppapi_messages.h" 24 #include "ppapi/proxy/ppapi_messages.h"
25 #include "ppapi/shared_impl/media_stream_buffer.h" 25 #include "ppapi/shared_impl/media_stream_buffer.h"
26 #include "third_party/libyuv/include/libyuv.h" 26 #include "third_party/libyuv/include/libyuv.h"
27 27
28 using media::VideoFrame; 28 using media::VideoFrame;
29 using ppapi::host::HostMessageContext; 29 using ppapi::host::HostMessageContext;
30 using ppapi::MediaStreamVideoTrackShared; 30 using ppapi::MediaStreamVideoTrackShared;
31 31
32 namespace { 32 namespace {
33 33
34 const int32_t kDefaultNumberOfBuffers = 4; 34 const int32_t kVideoDefaultNumberOfBuffers = 4;
35 const int32_t kMaxNumberOfBuffers = 8; 35 const int32_t kVideoMaxNumberOfBuffers = 8;
36 // Filter mode for scaling frames. 36 // Filter mode for scaling frames.
37 const libyuv::FilterMode kFilterMode = libyuv::kFilterBox; 37 const libyuv::FilterMode kFilterMode = libyuv::kFilterBox;
38 38
39 const char kPepperVideoSourceName[] = "PepperVideoSourceName"; 39 const char kPepperVideoSourceName[] = "PepperVideoSourceName";
40 40
41 // Default config for output mode. 41 // Default config for output mode.
42 const int kDefaultOutputFrameRate = 30; 42 const int kDefaultOutputFrameRate = 30;
43 43
44 media::VideoPixelFormat ToPixelFormat(PP_VideoFrame_Format format) { 44 media::VideoPixelFormat ToPixelFormat(PP_VideoFrame_Format format) {
45 switch (format) { 45 switch (format) {
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 new_frame_callback_.Run(frame, base::TimeTicks()); 220 new_frame_callback_.Run(frame, base::TimeTicks());
221 } 221 }
222 222
223 PepperMediaStreamVideoTrackHost::PepperMediaStreamVideoTrackHost( 223 PepperMediaStreamVideoTrackHost::PepperMediaStreamVideoTrackHost(
224 RendererPpapiHost* host, 224 RendererPpapiHost* host,
225 PP_Instance instance, 225 PP_Instance instance,
226 PP_Resource resource, 226 PP_Resource resource,
227 const blink::WebMediaStreamTrack& track) 227 const blink::WebMediaStreamTrack& track)
228 : PepperMediaStreamTrackHostBase(host, instance, resource), 228 : PepperMediaStreamTrackHostBase(host, instance, resource),
229 track_(track), 229 track_(track),
230 number_of_buffers_(kDefaultNumberOfBuffers), 230 number_of_buffers_(kVideoDefaultNumberOfBuffers),
231 source_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), 231 source_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN),
232 plugin_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), 232 plugin_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN),
233 frame_data_size_(0), 233 frame_data_size_(0),
234 type_(kRead), 234 type_(kRead),
235 weak_factory_(this) { 235 weak_factory_(this) {
236 DCHECK(!track_.IsNull()); 236 DCHECK(!track_.IsNull());
237 } 237 }
238 238
239 PepperMediaStreamVideoTrackHost::PepperMediaStreamVideoTrackHost( 239 PepperMediaStreamVideoTrackHost::PepperMediaStreamVideoTrackHost(
240 RendererPpapiHost* host, 240 RendererPpapiHost* host,
241 PP_Instance instance, 241 PP_Instance instance,
242 PP_Resource resource) 242 PP_Resource resource)
243 : PepperMediaStreamTrackHostBase(host, instance, resource), 243 : PepperMediaStreamTrackHostBase(host, instance, resource),
244 number_of_buffers_(kDefaultNumberOfBuffers), 244 number_of_buffers_(kVideoDefaultNumberOfBuffers),
245 source_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), 245 source_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN),
246 plugin_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN), 246 plugin_frame_format_(PP_VIDEOFRAME_FORMAT_UNKNOWN),
247 frame_data_size_(0), 247 frame_data_size_(0),
248 type_(kWrite), 248 type_(kWrite),
249 weak_factory_(this) { 249 weak_factory_(this) {
250 InitBlinkTrack(); 250 InitBlinkTrack();
251 DCHECK(!track_.IsNull()); 251 DCHECK(!track_.IsNull());
252 } 252 }
253 253
254 PepperMediaStreamVideoTrackHost::~PepperMediaStreamVideoTrackHost() { 254 PepperMediaStreamVideoTrackHost::~PepperMediaStreamVideoTrackHost() {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 471
472 bool changed = false; 472 bool changed = false;
473 gfx::Size new_size(attributes.width, attributes.height); 473 gfx::Size new_size(attributes.width, attributes.height);
474 if (GetTargetSize(source_frame_size_, plugin_frame_size_) != 474 if (GetTargetSize(source_frame_size_, plugin_frame_size_) !=
475 GetTargetSize(source_frame_size_, new_size)) { 475 GetTargetSize(source_frame_size_, new_size)) {
476 changed = true; 476 changed = true;
477 } 477 }
478 plugin_frame_size_ = new_size; 478 plugin_frame_size_ = new_size;
479 479
480 int32_t buffers = attributes.buffers 480 int32_t buffers = attributes.buffers
481 ? std::min(kMaxNumberOfBuffers, attributes.buffers) 481 ? std::min(kVideoMaxNumberOfBuffers, attributes.buffers)
482 : kDefaultNumberOfBuffers; 482 : kVideoDefaultNumberOfBuffers;
483 if (buffers != number_of_buffers_) 483 if (buffers != number_of_buffers_)
484 changed = true; 484 changed = true;
485 number_of_buffers_ = buffers; 485 number_of_buffers_ = buffers;
486 486
487 if (GetTargetFormat(source_frame_format_, plugin_frame_format_) != 487 if (GetTargetFormat(source_frame_format_, plugin_frame_format_) !=
488 GetTargetFormat(source_frame_format_, attributes.format)) { 488 GetTargetFormat(source_frame_format_, attributes.format)) {
489 changed = true; 489 changed = true;
490 } 490 }
491 plugin_frame_format_ = attributes.format; 491 plugin_frame_format_ = attributes.format;
492 492
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 527 }
528 528
529 void PepperMediaStreamVideoTrackHost::OnTrackStarted( 529 void PepperMediaStreamVideoTrackHost::OnTrackStarted(
530 MediaStreamSource* source, 530 MediaStreamSource* source,
531 MediaStreamRequestResult result, 531 MediaStreamRequestResult result,
532 const blink::WebString& result_name) { 532 const blink::WebString& result_name) {
533 DVLOG(3) << "OnTrackStarted result: " << result; 533 DVLOG(3) << "OnTrackStarted result: " << result;
534 } 534 }
535 535
536 } // namespace content 536 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_media_stream_audio_track_host.cc ('k') | content/renderer/pepper/pepper_video_encoder_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698