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

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

Issue 1737253002: Handle Alpha channel in Canvas capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 SendEnqueueBufferMessageToPlugin(index); 368 SendEnqueueBufferMessageToPlugin(index);
369 return PP_OK; 369 return PP_OK;
370 } 370 }
371 371
372 void PepperMediaStreamVideoTrackHost::OnVideoFrame( 372 void PepperMediaStreamVideoTrackHost::OnVideoFrame(
373 const scoped_refptr<VideoFrame>& frame, 373 const scoped_refptr<VideoFrame>& frame,
374 base::TimeTicks estimated_capture_time) { 374 base::TimeTicks estimated_capture_time) {
375 DCHECK(frame.get()); 375 DCHECK(frame.get());
376 // TODO(penghuang): Check |frame->end_of_stream()| and close the track. 376 // TODO(penghuang): Check |frame->end_of_stream()| and close the track.
377 PP_VideoFrame_Format ppformat = ToPpapiFormat(frame->format()); 377 PP_VideoFrame_Format ppformat = ToPpapiFormat(frame->format());
378
379 // Drop alpha channel since we do not support it yet.
380 if (frame->format() == media::PIXEL_FORMAT_YV12A)
381 frame->DropYV12AAlphaChannel();
382
378 if (ppformat == PP_VIDEOFRAME_FORMAT_UNKNOWN) 383 if (ppformat == PP_VIDEOFRAME_FORMAT_UNKNOWN)
379 return; 384 return;
380 385
381 if (source_frame_size_.IsEmpty()) { 386 if (source_frame_size_.IsEmpty()) {
382 source_frame_size_ = frame->visible_rect().size(); 387 source_frame_size_ = frame->visible_rect().size();
383 source_frame_format_ = ppformat; 388 source_frame_format_ = ppformat;
384 InitBuffers(); 389 InitBuffers();
385 } 390 }
386 391
387 int32_t index = buffer_manager()->DequeueBuffer(); 392 int32_t index = buffer_manager()->DequeueBuffer();
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 } 532 }
528 533
529 void PepperMediaStreamVideoTrackHost::OnTrackStarted( 534 void PepperMediaStreamVideoTrackHost::OnTrackStarted(
530 MediaStreamSource* source, 535 MediaStreamSource* source,
531 MediaStreamRequestResult result, 536 MediaStreamRequestResult result,
532 const blink::WebString& result_name) { 537 const blink::WebString& result_name) {
533 DVLOG(3) << "OnTrackStarted result: " << result; 538 DVLOG(3) << "OnTrackStarted result: " << result;
534 } 539 }
535 540
536 } // namespace content 541 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698