|
|
Created:
5 years, 2 months ago by emircan Modified:
5 years, 2 months ago CC:
chromium-reviews, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionChange paused frame of WebMediaPlayerMS from YV12 to I420
We copy the last frame in a pause for media stream.
- Changed the copied frame to I420 to be consistent with the general format assumption.
- I use libyuv rather than direct memsets for copy and conversion.
BUG=541728
Committed: https://crrev.com/60a8bbef3d7b1c3e537c5b78d749cae3cf18b3b3
Cr-Commit-Position: refs/heads/master@{#355098}
Patch Set 1 : #
Total comments: 5
Patch Set 2 : #Patch Set 3 : Rebase #
Total comments: 2
Patch Set 4 : Remove gn changes. #Patch Set 5 : #Patch Set 6 : #
Messages
Total messages: 37 (14 generated)
The CQ bit was checked by emircan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1394783004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1394783004/20001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromiu...)
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
emircan@chromium.org changed reviewers: + fbarchard@chromium.org, mcasas@chromium.org
PTAL.
Patchset #1 (id:40001) has been deleted
LGTM. You'll need Owners though.
Its good to weed out the YV12 references... its really YU12. Looks okay, but I'd like to check the rowbytes is not needed, and that Android wants ARGB not ABGR. Thanks for doing this! https://chromiumcodereview.appspot.com/1394783004/diff/60001/content/renderer... File content/renderer/media/webmediaplayer_ms.cc (right): https://chromiumcodereview.appspot.com/1394783004/diff/60001/content/renderer... content/renderer/media/webmediaplayer_ms.cc:82: libyuv::ConvertToI420(reinterpret_cast<uint8*>(bitmap.getPixels()), Consider calling ARGBToI420. ConvertToI420 expects a contiguous buffer, where bytes per row is 4 * width. The original function media::CopyRGBToVideoFrame took bitmap.rowBytes(), allowing for row padding. ARGBToI420 takes rowbytes: // Convert ARGB To I420. LIBYUV_API int ARGBToI420(const uint8* src_argb, int src_stride_argb, uint8* dst_y, int dst_stride_y, uint8* dst_u, int dst_stride_u, uint8* dst_v, int dst_stride_v, int width, int height); https://chromiumcodereview.appspot.com/1394783004/diff/60001/content/renderer... content/renderer/media/webmediaplayer_ms.cc:95: libyuv::kRotate0, libyuv::FOURCC_ARGB); Most code in media expects ABGR for Android. Can you confirm this instance always wants ARGB?
https://codereview.chromium.org/1394783004/diff/60001/content/renderer/media/... File content/renderer/media/webmediaplayer_ms.cc (right): https://codereview.chromium.org/1394783004/diff/60001/content/renderer/media/... content/renderer/media/webmediaplayer_ms.cc:82: libyuv::ConvertToI420(reinterpret_cast<uint8*>(bitmap.getPixels()), On 2015/10/14 06:47:36, fbarchard wrote: > Consider calling ARGBToI420. > > ConvertToI420 expects a contiguous buffer, where bytes per row is 4 * width. > The original function media::CopyRGBToVideoFrame took bitmap.rowBytes(), > allowing for row padding. > ARGBToI420 takes rowbytes: > > // Convert ARGB To I420. > LIBYUV_API > int ARGBToI420(const uint8* src_argb, int src_stride_argb, > uint8* dst_y, int dst_stride_y, > uint8* dst_u, int dst_stride_u, > uint8* dst_v, int dst_stride_v, > int width, int height); Done. https://codereview.chromium.org/1394783004/diff/60001/content/renderer/media/... content/renderer/media/webmediaplayer_ms.cc:95: libyuv::kRotate0, libyuv::FOURCC_ARGB); On 2015/10/14 06:47:36, fbarchard wrote: > Most code in media expects ABGR for Android. Can you confirm this instance > always wants ARGB? Sorry, I couldn't understand what you mean there. Can you elaborate? We want output to be I420. It boils down to VideoResourceUpdater::CreateForSoftwarePlanes() for compositing. AFAIK, the input is RGB32. The earlier function used there was an RGB32 conversion. SKBitmap outputs ARGB as well.
I dont have a benchmark for the old media function, but the new one is very fast For 720p on a Sandy Bridge ARGBToI420_Opt 0.324 ms/frame. A memcpy is I420ToI420_Opt 0.121 ms/frame. https://codereview.chromium.org/1394783004/diff/60001/content/renderer/media/... File content/renderer/media/webmediaplayer_ms.cc (right): https://codereview.chromium.org/1394783004/diff/60001/content/renderer/media/... content/renderer/media/webmediaplayer_ms.cc:95: libyuv::kRotate0, libyuv::FOURCC_ARGB); On 2015/10/14 21:02:32, emircan wrote: > On 2015/10/14 06:47:36, fbarchard wrote: > > Most code in media expects ABGR for Android. Can you confirm this instance > > always wants ARGB? > > Sorry, I couldn't understand what you mean there. Can you elaborate? > > We want output to be I420. It boils down to > VideoResourceUpdater::CreateForSoftwarePlanes() for compositing. > > AFAIK, the input is RGB32. The earlier function used there was an RGB32 > conversion. SKBitmap outputs ARGB as well. In media/blink/skcanvas_video_renderer.cc there are ifdefs like this: // Skia internal format depends on a platform. On Android it is ABGR, on others // it is ARGB. #if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \ SK_A32_SHIFT == 24 #define LIBYUV_I420_TO_ARGB libyuv::I420ToARGB #else #define LIBYUV_I420_TO_ARGB libyuv::I420ToABGR .. So I just wanted to check that you are sure, on Android, that you want the same format as other platforms, which is ARGB. In libyuv terminology, ARGB ordering follows fourcc.org/directx, where ARGB is BGRA in memory, or ARGB in a register ABGR is RGBA in memory RGB24 is BGR in memory RAW is RGB in memory https://code.google.com/p/libyuv/wiki/Formats
lgtm
The CQ bit was checked by emircan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mcasas@chromium.org, fbarchard@chromium.org Link to the patchset: https://codereview.chromium.org/1394783004/#ps100001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1394783004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1394783004/100001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
Changed description from NV12 to YV12, to match code.
emircan@chromium.org changed reviewers: + sievers@chromium.org
Thanks for the correction fbarchard@. I just realized that I also need OWNERS review on BUILD.gn. sievers@chromium.org: Please review changes in BUILD.gn
https://codereview.chromium.org/1394783004/diff/100001/content/renderer/BUILD.gn File content/renderer/BUILD.gn (right): https://codereview.chromium.org/1394783004/diff/100001/content/renderer/BUILD... content/renderer/BUILD.gn:105: "//third_party/libyuv", This is not an android change, so why here? Also it doesn't match gyp where it's added as a dependency for webrtc and plugins enabled. (At least the former already happens below.)
https://codereview.chromium.org/1394783004/diff/100001/content/renderer/BUILD.gn File content/renderer/BUILD.gn (right): https://codereview.chromium.org/1394783004/diff/100001/content/renderer/BUILD... content/renderer/BUILD.gn:105: "//third_party/libyuv", On 2015/10/16 22:12:23, sievers wrote: > This is not an android change, so why here? > Also it doesn't match gyp where it's added as a dependency for webrtc and > plugins enabled. (At least the former already happens below.) Initially android bots failed [0] and I looked for the android section to add the libyuv dependency. But I just realized (!enable_webrtc && is_android) section as well. Should I move it there? https://codereview.chromium.org/1394783004/#msg4
On 2015/10/16 22:27:31, emircan wrote: > https://codereview.chromium.org/1394783004/diff/100001/content/renderer/BUILD.gn > File content/renderer/BUILD.gn (right): > > https://codereview.chromium.org/1394783004/diff/100001/content/renderer/BUILD... > content/renderer/BUILD.gn:105: "//third_party/libyuv", > On 2015/10/16 22:12:23, sievers wrote: > > This is not an android change, so why here? > > Also it doesn't match gyp where it's added as a dependency for webrtc and > > plugins enabled. (At least the former already happens below.) > > Initially android bots failed [0] and I looked for the android section to add > the libyuv dependency. But I just realized (!enable_webrtc && is_android) > section as well. Should I move it there? > > https://codereview.chromium.org/1394783004/#msg4 Still don't get what this has to do with android.
Patchset #4 (id:120001) has been deleted
Patchset #4 (id:140001) has been deleted
On 2015/10/16 22:51:31, sievers wrote: > > Still don't get what this has to do with android. Take a look at PS#4 where I removed the gn changes. AFAIU, libyuv is included inside WebRTC, and when WebRTC isn't enabled, it is not attached and results in compile errors. There fore, I added libyuv as a dependancy on (!enable_webrtc && is_android) case on PS#5. WDYT?
On 2015/10/19 18:33:51, emircan wrote: > On 2015/10/16 22:51:31, sievers wrote: > > > > Still don't get what this has to do with android. > > Take a look at PS#4 where I removed the gn changes. AFAIU, libyuv is included > inside WebRTC, and when WebRTC isn't enabled, it is not attached and results in > compile errors. There fore, I added libyuv as a dependancy on (!enable_webrtc && > is_android) case on PS#5. WDYT? I'm just wondering if this all somehow just ends up accidentally linking correctly in the different configs, and you're adding one more tweak on top. Doesn't content_renderer just always have to explicitly depend on libyuv on all platforms regardless of the config, because it always compiles the source file in which you are introducing the libyuv dependency?
On 2015/10/19 20:30:40, sievers wrote: > I'm just wondering if this all somehow just ends up accidentally linking > correctly in the different configs, and you're adding one more tweak on top. > Doesn't content_renderer just always have to explicitly depend on libyuv on all > platforms regardless of the config, because it always compiles the source file > in which you are introducing the libyuv dependency? As we discussed, I removed all conditional dependencies and added a general dependency. The bots seem to be fine. PTAL.
lgtm
On 2015/10/19 22:51:02, emircan wrote: > On 2015/10/19 20:30:40, sievers wrote: > > I'm just wondering if this all somehow just ends up accidentally linking > > correctly in the different configs, and you're adding one more tweak on top. > > Doesn't content_renderer just always have to explicitly depend on libyuv on > all > > platforms regardless of the config, because it always compiles the source file > > in which you are introducing the libyuv dependency? > > As we discussed, I removed all conditional dependencies and added a general > dependency. The bots seem to be fine. PTAL. lgtm, thanks!
The CQ bit was checked by emircan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mcasas@chromium.org Link to the patchset: https://codereview.chromium.org/1394783004/#ps200001 (title: " ")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1394783004/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1394783004/200001
Message was sent while issue was closed.
Committed patchset #6 (id:200001)
Message was sent while issue was closed.
Patchset 6 (id:??) landed as https://crrev.com/60a8bbef3d7b1c3e537c5b78d749cae3cf18b3b3 Cr-Commit-Position: refs/heads/master@{#355098} |