Chromium Code Reviews| Index: content/renderer/pepper/pepper_video_source_host.cc |
| diff --git a/content/renderer/pepper/pepper_video_source_host.cc b/content/renderer/pepper/pepper_video_source_host.cc |
| index db20126b141a6f30c413748970c36a7bb5f36e5d..cac83ebf76ec26aeaeda2896cc00edec8dbe7ada 100644 |
| --- a/content/renderer/pepper/pepper_video_source_host.cc |
| +++ b/content/renderer/pepper/pepper_video_source_host.cc |
| @@ -12,6 +12,7 @@ |
| #include "content/renderer/media/video_track_to_pepper_adapter.h" |
| #include "content/renderer/pepper/ppb_image_data_impl.h" |
| #include "content/renderer/render_thread_impl.h" |
| +#include "media/base/video_util.h" |
| #include "ppapi/c/pp_errors.h" |
| #include "ppapi/host/dispatch_host_message.h" |
| #include "ppapi/host/ppapi_host.h" |
| @@ -55,10 +56,21 @@ PepperVideoSourceHost::FrameReceiver::FrameReceiver( |
| PepperVideoSourceHost::FrameReceiver::~FrameReceiver() {} |
| void PepperVideoSourceHost::FrameReceiver::GotFrame( |
| - const scoped_refptr<media::VideoFrame>& frame) { |
| + const scoped_refptr<media::VideoFrame>& video_frame) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| if (!host_) |
| return; |
| + |
| + if (!(video_frame->format() == media::PIXEL_FORMAT_I420 || |
| + video_frame->format() == media::PIXEL_FORMAT_YV12A)) { |
|
bbudge
2016/03/08 13:17:33
Why is this checked here, but not in content/rende
emircan
2016/03/08 19:01:46
With this patch, each sink is expected to handle a
bbudge
2016/03/08 20:13:34
OK, this is fine then.
|
| + NOTREACHED(); |
| + return; |
| + } |
| + scoped_refptr<media::VideoFrame> frame = video_frame; |
| + // Drop alpha channel since we do not support it yet. |
| + if (frame->format() == media::PIXEL_FORMAT_YV12A) |
| + frame = media::WrapAsI420VideoFrame(video_frame); |
| + |
| // Hold a reference to the new frame and release the previous. |
| host_->last_frame_ = frame; |
| if (host_->get_frame_pending_) |