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

Issue 213423006: Move conversion from YUV420 to YV12 in WebMediaPlayerMs (Closed)

Created:
6 years, 9 months ago by Alpha Left Google
Modified:
6 years, 8 months ago
Reviewers:
perkj_chrome
CC:
chromium-reviews, fischman+watch_chromium.org, jam, mcasas+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, wjia+watch_chromium.org
Visibility:
Public.

Description

Move conversion from YUV420 to YV12 in WebMediaPlayerMs Hardware encoding of video frames in cast streaming requires the memory to be packed and using YUV420 format. However the format is YV12 because it is converted in MediaStreamVideoTrack. The reason for the conversion was because rendering of video frames expected YV12 instead of YUV420. This change moves the format conversion to WebMediaPlayerMs which is specific to rendering of the video frame. This way cast streaming will receive YUV420 frames and <video> with camera source will render correctly. I tested this with: 1. Aura with regular accelerated compositing 2. --disable-gpu --enable-software-compositing BUG=355763, 341452

Patch Set 1 #

Patch Set 2 : comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -34 lines) Patch
M content/renderer/media/media_stream_video_track.cc View 2 chunks +1 line, -29 lines 1 comment Download
M content/renderer/media/webmediaplayer_ms.cc View 3 chunks +32 lines, -5 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
Alpha Left Google
6 years, 9 months ago (2014-03-27 00:54:33 UTC) #1
perkj_chrome
This is a bit of a mess. I am ok, with allowing I420, YV12 and ...
6 years, 9 months ago (2014-03-27 09:25:39 UTC) #2
Alpha Left Google
On 2014/03/27 09:25:39, perkj wrote: > This is a bit of a mess. I am ...
6 years, 9 months ago (2014-03-27 20:53:44 UTC) #3
perkj_chrome
6 years, 9 months ago (2014-03-28 06:12:50 UTC) #4
On 2014/03/27 20:53:44, Alpha wrote:
> On 2014/03/27 09:25:39, perkj wrote:
> > This is a bit of a mess. I am ok, with allowing I420, YV12 and  textures in
> > VideoTracks but 
> > Pepper also expect YV12 to be delivered on MediaStreamVideoSink, so you will
> > have to talk to them too. Run the content_browsertests and browsertests and
> you
> > should see that this will fail.
> 
> To get the best out of MediaStreamVideoSink for example support for hardware
> video
> encoding the VideoFrame needs to delivered in their native form, i.e. with
> SharedMemory
> and/or texture. I'll look into the pepper case.
> 
> >  
> > You can currently not create a tightly packed I420 media::VideoFrame.
Creation
> > of a frame do alignemnt of the U and V plane. Look at the implementation of
> > media::VideoFrame::AllocateYUV. So if we want to not use I420 in
VideoTracks,
> I
> > think we also need to add the possibility to create tightly packed I420
frames
> > so that other type sources can create valid frames, ie video tracks received
> on
> > a PeerConnection and the pepper plugin used for effects.
> 
> I'm not sure I understand what is the actionable.
> 

Sorry, no action needed in this cl. It was more of FYI. We might need to allow
both YUV12 and I420 and textures- at least for a while and if a sink can not
handle the format, it may have to just drop the frames. 


> > 
> >
>
https://codereview.chromium.org/213423006/diff/20001/content/renderer/media/m...
> > File content/renderer/media/media_stream_video_track.cc (right):
> > 
> >
>
https://codereview.chromium.org/213423006/diff/20001/content/renderer/media/m...
> > content/renderer/media/media_stream_video_track.cc:106:
> > (*it)->OnVideoFrame(frame);
> > Note that you will have to talk to the Pepper team if you do this change.
They
> > expect YV12 to be delivered to the MediaStreamVideoSinks.
> > 
> >
>
https://codereview.chromium.org/213423006/diff/20001/content/renderer/media/w...
> > File content/renderer/media/webmediaplayer_ms.cc (right):
> > 
> >
>
https://codereview.chromium.org/213423006/diff/20001/content/renderer/media/w...
> > content/renderer/media/webmediaplayer_ms.cc:415:
> > scoped_refptr<media::VideoFrame> yv12_frame = frame;
> > The incoming frame can be a texture as well- not necessarily I420.

Please rename the variable from yv12_frame to something more neutral.

Powered by Google App Engine
This is Rietveld 408576698