Closed Bug 796854 Opened 7 years ago Closed 6 years ago
Native Window(ANative Window) need to support NATIVE _WINDOW _SET _BUFFERS _SIZE on some qcom ics hardwares
17.90 KB, patch
|Details | Diff | Splinter Review|
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4 Steps to reproduce: Install FirefoxOS to my phone (qcom ics), and install gaia's test content by following command. > make install-test-media Then try to play following movies from gaia's video app. https://github.com/mozilla-b2g/gaia/blob/master/test_media/Movies/gizmo2.mp4 Actual results: After opened gaia's video app. The app crash with following error log. > F/OMXCodec( 147): frameworks/base/media/libstagefright/OMXCodec.cpp:2935 CHECK_EQ( def.nBufferSize,handle->size) failed: 155648 vs. 147456 Expected results: can play local video(gizmo2.mp4) from gaia's video app.
It seems that qcom's ics platform implementation request ANativeWindow to support NATIVE_WINDOW_SET_BUFFERS_SIZE. It is set by OMXCode within OMXCodec::allocateOutputBuffersFromNativeWindow(). https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=blob;f=media/libstagefright/OMXCodec.cpp;h=0fefa5847490eb83fc584c06a7ba9e1cfdca9784;hb=ics_strawberry#l2731 It is necessary when default buffer allocation size by ANativeWindow and buffer size by OMX video component are different. And Current GonkNativeWindow do not support it. The error log says that a size of allocated buffer is incorrect. It happens because GonkNativeWindow do not implement NATIVE_WINDOW_SET_BUFFERS_SIZE. It seems that it's implementation is not required on all platform, but on qcom's ics platform. qcom's ics platform implement NATIVE_WINDOW_SET_BUFFERS_SIZE in SurfaceTexture::performQcomOperation(). https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=blob;f=libs/gui/SurfaceTexture.cpp;h=e2333fd8257e21ae07e8cc9471980c0b476fef7b;hb=ics_strawberry#l769 And adjust buffer size within GraphicBufferAlloc::createGraphicBuffer() by calling platform dependent checkBuffer() function. https://www.codeaurora.org/gitweb/quic/la/?p=platform/frameworks/base.git;a=blob;f=services/surfaceflinger/SurfaceFlinger.cpp;h=34780d834d13e164264427fd92c229e1917244f5;hb=ics_strawberry#l2741 checkBuffer() is implemented in following. https://www.codeaurora.org/gitweb/quic/la/?p=platform/hardware/qcom/display.git;a=blob;f=libqcomui/qcom_ui.cpp;h=761ff1156ee72fecb0c4fbbc95cb9c2df6471c63;hb=ics_strawberry#l170
OS: Windows 7 → Gonk
Hardware: x86_64 → ARM
To support NATIVE_WINDOW_SET_BUFFERS_SIZE, modified PImageBridge.ipdl related source codes. By using the patch, I could play gizmo2.mp4 from gaia's video app.
attachment 666905 [details] [diff] [review] is necessary for devices using ics_strawberry_rb5.3. otoro and unagi devices use ics_chocolate_rb4.2. Therefore it is not necessary.
Hi Sotaro, I am facing the same issue on JB as well. Can you please help get this port to JB as well. 01-01 12:59:48.019 E/OMXCodec( 1329): native_window_set_buffers_size failed: No such file or directory (2) 01-01 12:59:48.049 E/GeckoConsole( 1329): Content JS WARN at app://camera.gaiamobile.org/gaia_build_defer_index.js:36 in saveVideoPosterImage/ getreq.onsuccess/</offscreenVideo.onerror: not a video file /sdcard/DCIM/100MZLLA/VID_0001.3gp delete it!
Hi Sotaro, I could many do changes to all the files except the following files. GonkNativeWindow.cpp | GonkNativeWindow.h | Makefile.in | ShadowLayerUtilsGralloc.cpp The changes in ShadowLayerUtilsGralloc.cpp were not taken because qcom_ui.h has been removed in the following commit. https://android.googlesource.com/platform/hardware/qcom/display/+/5b6708ac87dc9681b3dd142b82702a8b995c6e22 Can you please help with the alternative at the earliest? Your help will be highly appreciated. Thanks in advance, Manjunatha
Can you provide more information? Only with these information, I can not understand correctly your problem. Which source code do you use? For which device? > 01-01 12:59:48.019 E/OMXCodec( 1329): native_window_set_buffers_size failed: No such file or directory I feel the above log seems strange. It seems better to analyze more about it. NATIVE_WINDOW_SET_BUFFERS_SIZE is defined only for ICS. At first, it might better just adding NATIVE_WINDOW_SET_BUFFERS_SIZE to JB's GonkNativeWindowClient like the following. http://mxr.mozilla.org/mozilla-central/source/widget/gonk/nativewindow/GonkNativeWindowClientICS.cpp#294
b2g's gonk does not need this. Set to WONTFIX.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.