Hi,
I have compiled the sample code provided in the following location.
https://developer.qualcomm.com/download/qcomvideocodecsample131.zip
My target device is LG Optimus 4X phone which has quad-core Snapdragon S4 CPU and Adreno 320 GPU. The android OS version is 4.0.3 (Ice Cream Sandwich).
Steps followed (as mentioned in 'OpenMax_Encoder_Decoder.pdf'):
1) Downloaded android ICS source code from Google.
Branch details:- "IML74K" "android-4.0.3_r1" "Nexus S"
2) Made the changed required in IOMX.h file.
3) Copied the sample code folder "qcomomxsample" folder into <android-dir>/frameworks/base/cmds/stagefright/.
4) Using "mm" command, build "libqcomomxsample_ics.so".
5) Copied "libqcomomxsample_ics.so" into "lib" folder of the NDK project.
6) Using "ndk-build" command, created "libqcomomx4ndk_encode_decode_ics.so" and "libqcomomxsample_ics.so" under "libs" folder.
7) Install and run the program in "LG Optimus 4X" device.
---------------------------------------------------------------------------------------------------
I am getting the following error in the device.
11-15 18:11:14.950: D/ActivityCameraToH264(17182): Starting Encoder.. calling encoderStart.
11-15 18:11:14.950: E/QCOMOMXINTERFACE(17182): FRAME WxH = 320x240 TO /mnt/sdcard/qcom//camframes.320x240.h264
11-15 18:11:14.950: E/(17182): QCOMOMXINTERFACE: QUERY FOR OMX COMPONENT: OMX.qcom.video.encoder.avc
11-15 18:11:14.950: E/(17182): QCOMOMXINTERFACE: LIST NODES
11-15 18:11:14.960: E/(17182): QCOMOMXINTERFACE: CODEC NOT FOUND: OMX.qcom.video.encoder.avc
11-15 18:11:14.960: E/(17182): QCOMOMXINTERFACE - ERROR creating encoder: 6 (OMX Component Node Not Found.)
---------------------------------------------------------------------------------------------------
Please help me resolving the issue.
Thanks in advance.
Sorry, now I realized that LG Optimus 4X is not having snapdragon openMAX components.
So, I have put the application in LG Optimus L7 phone in which snapdragon GPU is present.
I am able to decode the sample H.264 video file using openMAX decoder component successfully. But, while trying to encode I am getting the following errors. Please provide more details about this type of error to help fixing the issue.
----------------------------------------------------------------------------------------------------
1-16 12:57:48.540: E/(4138): OMX MESSAGE: EVENT: 1, data1 -2147479551, data2 3
11-16 12:57:48.540: E/(4138): QCOMOMXINTERFACE - Event error = -2147479551, data2 3
----------------------------------------------------------------------------------------------------
Please find the complete log lines as follows.
--------------------------------------------------------------------------------------------------
11-16 12:57:44.260: D/memalloc(4138): /dev/pmem: Mapped buffer base:0x51ced000 size:11776000 offset:10240000 fd:55
11-16 12:57:44.440: D/memalloc(4138): /dev/pmem: Mapped buffer base:0x52828000 size:2826240 offset:1290240 fd:58
11-16 12:57:44.490: D/memalloc(4138): /dev/pmem: Unmapping buffer base:0x50dc8000 size:13312000 offset:11776000
11-16 12:57:44.490: D/memalloc(4138): /dev/pmem: Unmapping buffer base:0x51ced000 size:11776000 offset:10240000
11-16 12:57:45.380: D/memalloc(4138): /dev/pmem: Mapped buffer base:0x50dc8000 size:4362240 offset:2826240 fd:52
11-16 12:57:46.210: D/memalloc(4138): /dev/pmem: Mapped buffer base:0x511f1000 size:5898240 offset:4362240 fd:55
11-16 12:57:46.270: D/memalloc(4138): /dev/pmem: Mapped buffer base:0x51bf7000 size:11776000 offset:10240000 fd:67
11-16 12:57:46.300: D/memalloc(4138): /dev/pmem: Unmapping buffer base:0x52828000 size:2826240 offset:1290240
11-16 12:57:46.300: D/memalloc(4138): /dev/pmem: Unmapping buffer base:0x50dc8000 size:4362240 offset:2826240
11-16 12:57:47.390: D/ActivityCameraToH264(4138): start encoder
11-16 12:57:48.390: D/ActivityCameraToH264(4138): Starting Encoder..
11-16 12:57:48.390: V/ActivityCameraToH264(4138): Encoder Start at 320 x 240
11-16 12:57:48.390: D/ActivityCameraToH264(4138): Starting Encoder.. calling encoderStart.
11-16 12:57:48.390: E/QCOMOMXINTERFACE(4138): FRAME WxH = 320x240 TO /mnt/sdcard/qcom//camframes.320x240.h264
11-16 12:57:48.420: E/(4138): QCOMOMXINTERFACE: QUERY FOR OMX COMPONENT: OMX.qcom.video.encoder.avc
11-16 12:57:48.420: E/(4138): QCOMOMXINTERFACE: LIST NODES
11-16 12:57:48.430: E/(4138): QCOMOMXINTERFACE - OBSERVER IS SET!
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE - ENCODER CREATE: SETUP INPUT PORT PARAMS (320 x 240 @ 10 fps)
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE - ENCODER CREATE: SETUP OUTPUT PORT BIT RATE (230400)
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE - ENCODER CREATE: SETUP OUTPUT PORT RATE CONTROL (3, 230400)
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE - ENCODER CREATE COMPLETE, value 1451240
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE::INIT - CREATE FRAME OUTPUT THREAD
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE::INIT - CREATE DATA OUTPUT THREAD
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE::INIT - ALLOCATE BUFFERS
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE::allocateBuffersOnPort 0 BEGIN
11-16 12:57:48.440: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 0 buffer size 118784
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 0 buffer size 118784
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 0 buffer size 118784
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 0 buffer size 118784
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE::allocateBuffersOnPort 0 COMPLETE
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE::allocateBuffersOnPort 1 BEGIN
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 1 buffer size 76800
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 1 buffer size 76800
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 1 buffer size 76800
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 1 buffer size 76800
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 1 buffer size 76800
11-16 12:57:48.450: E/(4138): QCOMOMXINTERFACE - Memory dealer allocation for port 1 buffer size 76800
11-16 12:57:48.460: E/(4138): QCOMOMXINTERFACE::allocateBuffersOnPort 1 COMPLETE
11-16 12:57:48.460: E/(4138): QCOMOMXINTERFACE::INIT - WAIT FOR IDLE STATE (2)
11-16 12:57:48.460: E/(4138): QCOMOMXINTERFACE - OnMessage :: message.type = 0
11-16 12:57:48.460: E/(4138): OMX MESSAGE: EVENT: 0, data1 0, data2 2
11-16 12:57:48.460: E/(4138): QCOMOMXINTERFACE::INIT - SEND TO EXECUTION STATE (3)
11-16 12:57:48.460: E/(4138): QCOMOMXINTERFACE::INIT - WAIT FOR EXECUTING STATE (3)
11-16 12:57:48.480: E/(4138): QCOMOMXINTERFACE - OnMessage :: message.type = 0
11-16 12:57:48.480: E/(4138): OMX MESSAGE: EVENT: 0, data1 0, data2 3
11-16 12:57:48.480: E/(4138): QCOMOMXINTERFACE::INIT - FILL OUTPUT BUFFERS
11-16 12:57:48.480: E/(4138): QCOMOMXINTERFACE - OnMessage :: message.type = 2
11-16 12:57:48.480: E/(4138): QCOMOMXINTERFACE - OMX MESSAGE: FILL BUFFER DONE (21) LAST = 0
11-16 12:57:48.480: V/ActivityCameraToH264(4138): ENCODER START
11-16 12:57:48.540: E/(4138): QCOMOMXINTERFACE - OnMessage :: message.type = 0
11-16 12:57:48.540: E/(4138): OMX MESSAGE: EVENT: 1, data1 -2147479551, data2 3
11-16 12:57:48.540: E/(4138): QCOMOMXINTERFACE - Event error = -2147479551, data2 3
11-16 12:57:48.670: E/(4138): QCOMOMXINTERFACE - OnMessage :: message.type = 0
11-16 12:57:48.670: E/(4138): OMX MESSAGE: EVENT: 1, data1 -2147479551, data2 3
11-16 12:57:48.670: E/(4138): QCOMOMXINTERFACE - Event error = -2147479551, data2 3
11-16 12:57:48.800: E/(4138): QCOMOMXINTERFACE - OnMessage :: message.type = 0
11-16 12:57:48.800: E/(4138): OMX MESSAGE: EVENT: 1, data1 -2147479551, data2 3
11-16 12:57:48.800: E/(4138): QCOMOMXINTERFACE - Event error = -2147479551, data2 3
11-16 12:57:48.910: E/(4138): QCOMOMXINTERFACE - OnMessage :: message.type = 0
11-16 12:57:48.910: E/(4138): OMX MESSAGE: EVENT: 1, data1 -2147479551, data2 3
11-16 12:57:48.910: E/(4138): QCOMOMXINTERFACE - Event error = -2147479551, data2 3
The hexadecimal value for the error code -2147479551 comes as 0x80001001
I have checked the error code in the following file (in android OMX part of source code).
"frameworks/base/include/media/stagefright/openmax/OMX_Core.h"
---------------------------------------------------------
typedef enum OMX_ERRORTYPE
{
OMX_ErrorUndefined = (OMX_S32) 0x80001001,
...
}