Closed Bug 796854 Opened 7 years ago Closed 6 years ago

GonkNativeWindow(ANativeWindow) need to support NATIVE_WINDOW_SET_BUFFERS_SIZE on some qcom ics hardwares


(Core :: Graphics: Layers, defect)

Gonk (Firefox OS)
Not set





(Reporter: sotaro, Unassigned)




(1 file)

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.

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().;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().;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.;a=blob;f=services/surfaceflinger/SurfaceFlinger.cpp;h=34780d834d13e164264427fd92c229e1917244f5;hb=ics_strawberry#l2741

checkBuffer() is implemented in following.;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.
Depends on: 759506
Blocks: 803471
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:// in saveVideoPosterImage/ getreq.onsuccess/</offscreenVideo.onerror: not a video file /sdcard/DCIM/100MZLLA/VID_0001.3gp delete it!
Flags: needinfo?(sotaro.ikeda.g)
Hi Sotaro,

I could many do changes to all the files except the following files. 

GonkNativeWindow.cpp | GonkNativeWindow.h | | ShadowLayerUtilsGralloc.cpp

The changes in ShadowLayerUtilsGralloc.cpp were not taken because qcom_ui.h has been removed in the following commit.

 Can you please help with the alternative at the earliest? Your help will be highly appreciated.

Thanks in advance,
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.
Flags: needinfo?(sotaro.ikeda.g)
b2g's gonk does not need this. Set to WONTFIX.
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.