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

Issue 23903032: Move NV21 colorspace treatment from VideoCapture java to C++ (Closed)

Created:
7 years, 3 months ago by mcasas
Modified:
7 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, jam, miu+watch_chromium.org, ncarter (slow), Ami GONE FROM CHROMIUM, qinmin
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Move NV21 colorspace treatment from VideoCapture java to C++ - VideoCapture.java: Removed NV21 explicit treatment. Added getColorspace() method. - Added VideoCaptureDeviceAndroid::GetColorspace(), translates between Android and C++ colorspaces. - Added support for NV21 conversion and rotations in Android to VideoCaptureController. - Unrelated to the rest, removed unused unused GetIntField in VideoCaptureDeviceAndroid anonymous namespace. Tested by forcing NV21 in VideoCapture.java [1] [1] https://code.google.com/p/chromium/codesearch#chromium/src/media/base/android/java/src/org/chromium/media/VideoCapture.java&q=deviceimageformathack&sq=package:chromium&l=55 BUG=288567 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=223886

Patch Set 1 #

Patch Set 2 : Removed unused GetIntField in VCDA; protected nv21_intermediate_buffer allocation in VCC #

Total comments: 8

Patch Set 3 : joi's comments addressed #

Patch Set 4 : reload CL #

Total comments: 4

Patch Set 5 : Added java-c++ automatic enum correspondence #

Patch Set 6 : Addressed tommi@'s comment and some other nits. #

Patch Set 7 : Try again uploading - didn't work :( #

Total comments: 16

Patch Set 8 : Comments addressed #

Patch Set 9 : Rebased. #

Patch Set 10 : Try again uploading... #

Patch Set 11 : Rebased again - with more attention to ncarter VCC refactoring #

Patch Set 12 : Added missing file #

Total comments: 14

Patch Set 13 : Addressed scherkus@'s comments #

Patch Set 14 : Added media_android_imageformat_list target to all android webview targets #

Total comments: 2

Patch Set 15 : Added ImageFormat.java automatic generation to android_webview/Android.mk, missed before. #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+123 lines, -43 lines) Patch
M android_webview/Android.mk View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/all_webview.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/media/video_capture_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +28 lines, -4 lines 1 comment Download
A + media/base/android/java/src/org/chromium/media/ImageFormat.template View 1 2 3 4 1 chunk +6 lines, -6 lines 0 comments Download
M media/base/android/java/src/org/chromium/media/VideoCapture.java View 1 2 3 4 4 chunks +21 lines, -18 lines 1 comment Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -1 line 0 comments Download
A media/video/capture/android/imageformat_list.h View 1 2 3 4 5 6 7 11 1 chunk +22 lines, -0 lines 0 comments Download
M media/video/capture/android/video_capture_device_android.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -0 lines 1 comment Download
M media/video/capture/android/video_capture_device_android.cc View 1 2 3 4 5 6 7 3 chunks +23 lines, -14 lines 4 comments Download

Messages

Total messages: 35 (0 generated)
mcasas
Hi joi could PTAL? Thanks!
7 years, 3 months ago (2013-09-10 13:47:53 UTC) #1
Jói
Sorry for the delay reviewing this. Note that I'm not an OWNER for any of ...
7 years, 3 months ago (2013-09-10 16:31:17 UTC) #2
mcasas
@joi: thanks for the comments! @bulach: could you PTAL at media/base/android/java/src/org/chromium/media/VideoCapture.java ? Thanks! @tommi: could ...
7 years, 3 months ago (2013-09-11 09:03:27 UTC) #3
tommi (sloooow) - chröme
On 2013/09/11 09:03:27, miguelao wrote: > @joi: thanks for the comments! > > @bulach: could ...
7 years, 3 months ago (2013-09-11 09:41:41 UTC) #4
mcasas
CL uploaded again - should be fine now :)
7 years, 3 months ago (2013-09-11 09:43:51 UTC) #5
tommi (sloooow) - chröme
just one question - if I'm not missing something then please just fix &buffer[0]+offset to ...
7 years, 3 months ago (2013-09-11 12:32:44 UTC) #6
bulach
https://codereview.chromium.org/23903032/diff/11001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/23903032/diff/11001/content/browser/renderer_host/media/video_capture_controller.h#newcode161 content/browser/renderer_host/media/video_capture_controller.h:161: scoped_ptr<uint8[]> i420_intermediate_buffer_; nit: shouldn't this be a scoped_array instead? ...
7 years, 3 months ago (2013-09-11 14:59:07 UTC) #7
ncarter (slow)
Drive by comment https://codereview.chromium.org/23903032/diff/11001/content/browser/renderer_host/media/video_capture_controller.h File content/browser/renderer_host/media/video_capture_controller.h (right): https://codereview.chromium.org/23903032/diff/11001/content/browser/renderer_host/media/video_capture_controller.h#newcode161 content/browser/renderer_host/media/video_capture_controller.h:161: scoped_ptr<uint8[]> i420_intermediate_buffer_; On 2013/09/11 14:59:07, bulach ...
7 years, 3 months ago (2013-09-11 20:07:23 UTC) #8
mcasas
@bulach, I followed your wise instructions and think I cleaned the java-c++ enumeration interfacing. Could ...
7 years, 3 months ago (2013-09-12 14:00:31 UTC) #9
bulach
android jni bits lgtm, thanks!
7 years, 3 months ago (2013-09-12 16:31:46 UTC) #10
bulach
(I added qinmin@ since he owns the media on android and may want to take ...
7 years, 3 months ago (2013-09-12 16:32:26 UTC) #11
mcasas
@bulach: thanks a lot! @scherkus: could you PTAL at media/media.gyp please? Thanks!
7 years, 3 months ago (2013-09-12 16:34:32 UTC) #12
Ami GONE FROM CHROMIUM
drive-by comments. https://codereview.chromium.org/23903032/diff/54001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/23903032/diff/54001/content/browser/renderer_host/media/video_capture_controller.cc#newcode263 content/browser/renderer_host/media/video_capture_controller.cc:263: #if !defined(OS_IOS) && !defined(OS_ANDROID) Why not use ...
7 years, 3 months ago (2013-09-12 17:03:15 UTC) #13
scherkus (not reviewing)
https://codereview.chromium.org/23903032/diff/54001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/23903032/diff/54001/content/browser/renderer_host/media/video_capture_controller.cc#newcode263 content/browser/renderer_host/media/video_capture_controller.cc:263: #if !defined(OS_IOS) && !defined(OS_ANDROID) On 2013/09/12 17:03:16, Ami Fischman ...
7 years, 3 months ago (2013-09-12 17:26:48 UTC) #14
mcasas
@scherkus, @fischman: Thanks for the comments I answered some of them but will take me ...
7 years, 3 months ago (2013-09-13 08:42:50 UTC) #15
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/23903032/diff/54001/media/video/capture/android/imageformat_list.h File media/video/capture/android/imageformat_list.h (right): https://codereview.chromium.org/23903032/diff/54001/media/video/capture/android/imageformat_list.h#newcode15 media/video/capture/android/imageformat_list.h:15: DEFINE_ANDROID_IMAGEFORMAT(ANDROID_IMAGEFORMAT_JPEG, 0) On 2013/09/13 08:42:51, miguelao wrote: > Do ...
7 years, 3 months ago (2013-09-13 17:28:59 UTC) #16
mcasas
scherkus@, fischman@ thanks for the comments, I tried to address them all :) https://codereview.chromium.org/23903032/diff/54001/content/browser/renderer_host/media/video_capture_controller.cc File ...
7 years, 3 months ago (2013-09-16 08:43:01 UTC) #17
bulach
https://codereview.chromium.org/23903032/diff/54001/media/video/capture/android/imageformat_list.h File media/video/capture/android/imageformat_list.h (right): https://codereview.chromium.org/23903032/diff/54001/media/video/capture/android/imageformat_list.h#newcode15 media/video/capture/android/imageformat_list.h:15: DEFINE_ANDROID_IMAGEFORMAT(ANDROID_IMAGEFORMAT_JPEG, 0) On 2013/09/13 17:29:00, Ami Fischman wrote: > ...
7 years, 3 months ago (2013-09-16 08:45:01 UTC) #18
Ami GONE FROM CHROMIUM
> > 2) using the same value as the SDK is fine, but not having ...
7 years, 3 months ago (2013-09-16 15:56:28 UTC) #19
scherkus (not reviewing)
https://codereview.chromium.org/23903032/diff/2001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/23903032/diff/2001/content/browser/renderer_host/media/video_capture_controller.cc#newcode145 content/browser/renderer_host/media/video_capture_controller.cc:145: // http://crbug.com/292400 . nit: remove trailing " ." https://codereview.chromium.org/23903032/diff/2001/content/browser/renderer_host/media/video_capture_controller.cc#newcode149 ...
7 years, 3 months ago (2013-09-17 01:52:56 UTC) #20
mcasas
scherkus@ comments addressed, thanks for the quick reply! https://codereview.chromium.org/23903032/diff/2001/content/browser/renderer_host/media/video_capture_controller.cc File content/browser/renderer_host/media/video_capture_controller.cc (right): https://codereview.chromium.org/23903032/diff/2001/content/browser/renderer_host/media/video_capture_controller.cc#newcode145 content/browser/renderer_host/media/video_capture_controller.cc:145: // ...
7 years, 3 months ago (2013-09-17 15:38:35 UTC) #21
scherkus (not reviewing)
lgtm
7 years, 3 months ago (2013-09-17 17:05:29 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/23903032/85001
7 years, 3 months ago (2013-09-17 19:10:45 UTC) #23
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 3 months ago (2013-09-17 20:17:10 UTC) #24
mcasas
@benm, could you PTAL at android_webview/all_webview.gyp ? Thanks!
7 years, 3 months ago (2013-09-18 11:36:46 UTC) #25
mcasas
Hi mnaganov@, could you PTAL? Thanks!
7 years, 3 months ago (2013-09-18 12:12:04 UTC) #26
mnaganov (inactive)
https://codereview.chromium.org/23903032/diff/97001/android_webview/all_webview.gyp File android_webview/all_webview.gyp (right): https://codereview.chromium.org/23903032/diff/97001/android_webview/all_webview.gyp#newcode23 android_webview/all_webview.gyp:23: '../media/media.gyp:media_android_imageformat_list', This should also be added into android_webview/Android.mk (sorry ...
7 years, 3 months ago (2013-09-18 12:22:33 UTC) #27
mcasas
Mikhail comments addressed, thanks for the quick reply! https://codereview.chromium.org/23903032/diff/97001/android_webview/all_webview.gyp File android_webview/all_webview.gyp (right): https://codereview.chromium.org/23903032/diff/97001/android_webview/all_webview.gyp#newcode23 android_webview/all_webview.gyp:23: '../media/media.gyp:media_android_imageformat_list', ...
7 years, 3 months ago (2013-09-18 12:57:31 UTC) #28
mnaganov (inactive)
LGTM, thanks! android_aosp seems to be happy now. Looking forward for actually removing this dependency.
7 years, 3 months ago (2013-09-18 13:34:46 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mcasas@chromium.org/23903032/38001
7 years, 3 months ago (2013-09-18 13:35:31 UTC) #30
benm (inactive)
aw/ lgtm
7 years, 3 months ago (2013-09-18 15:54:15 UTC) #31
commit-bot: I haz the power
Change committed as 223886
7 years, 3 months ago (2013-09-18 16:08:21 UTC) #32
wjia(left Chromium)
Please use "git blame" to figure out reviewer for some files. It'd be great to ...
7 years, 3 months ago (2013-09-18 18:35:26 UTC) #33
mcasas
On 2013/09/18 18:35:26, wjia wrote: > Please use "git blame" to figure out reviewer for ...
7 years, 3 months ago (2013-09-18 19:22:44 UTC) #34
wjia(left Chromium)
7 years, 3 months ago (2013-09-18 20:14:09 UTC) #35
Message was sent while issue was closed.
On 2013/09/18 19:22:44, miguelao wrote:
> On 2013/09/18 18:35:26, wjia wrote:
> > Please use "git blame" to figure out reviewer for some files. It'd be great
to
> > not have a premature check-in in the future.
> > 
> > If this patch is about performance improvement, the performance data
> comparison
> > should be included in the description.
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/content/browser/re...
> > File content/browser/renderer_host/media/video_capture_controller.cc
(right):
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/content/browser/re...
> > content/browser/renderer_host/media/video_capture_controller.cc:462:
rotation,
> > flip_vert, flip_horiz);
> > Do you have the performance data comparison between these 2 approaches
(i.e.,
> > conversion in java and c++)?
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/base/android...
> > File media/base/android/java/src/org/chromium/media/VideoCapture.java
(right):
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/base/android...
> > media/base/android/java/src/org/chromium/media/VideoCapture.java:253: return
> > AndroidImageFormatList.ANDROID_IMAGEFORMAT_RGB_565;
> > Only YV12 and NV21 are used. The rest should be added only when they are in
> use.
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/video/captur...
> > File media/video/capture/android/video_capture_device_android.cc (right):
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/video/captur...
> > media/video/capture/android/video_capture_device_android.cc:142:
> > DCHECK_NE(current_settings_.color, media::PIXEL_FORMAT_UNKNOWN);
> > no need to have media::
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/video/captur...
> > media/video/capture/android/video_capture_device_android.cc:251: switch
> > (current_capture_colorspace){
> > nit: one space between ) and {.
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/video/captur...
> > media/video/capture/android/video_capture_device_android.cc:252: case
> > ANDROID_IMAGEFORMAT_YV12:
> > Some reviewer has mentioned this before. Please follow
> >
>
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Loops_and_Swit...
> > for indent of this switch.
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/video/captur...
> > media/video/capture/android/video_capture_device_android.cc:260: case
> > ANDROID_IMAGEFORMAT_RGB_565:
> > Only NV21 and YV12 are used. Please remove unused color formats.
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/video/captur...
> > File media/video/capture/android/video_capture_device_android.h (right):
> > 
> >
>
https://chromiumcodereview.appspot.com/23903032/diff/38001/media/video/captur...
> > media/video/capture/android/video_capture_device_android.h:61: };
> > This enum should be moved into cc file.
> 
> I disagree about the enum comments: the Android device supports 6 color spaces
> (or pixel formats), and so is implemented. VideoCaptureController supports
only
> NV21, YUY2 and YV12 and this is reflected in the code (other colorspaces
default
> to PIXEL_FORMAT_UNKNOWN in video_capture_device_android.cc).
> 
> I will also dig up some performance comparison and address the other comments.

Android has those color formats defined, but we are not using all of them.
The current code only uses NV21 and YV12. There is no point to add non-used
color
formats. They should be added only when needed.

Powered by Google App Engine
This is Rietveld 408576698