Android new codec_para_t structure
#1
Lightbulb 
Hello

I have TV box created by Geniatch with amlogic CPU. It has Android 4.0.4 Android on the board with unusual structure of codec_para_t.
Here is link to the some sources. Difference in structure lead to error

Code:
I/amcodec (23518): send control failed,handle=0,cmd=5311,paramter=0, t=ffffffff errno=25
V/XBMC    (23518): 10:44:03 T:9600752   DEBUG: CAMLCodec::OpenDecoder codec init failed, ret=0x100000a
V/XBMC    (23518): 10:44:03 T:9600752   ERROR: DVDVideoCodecAmlogic: Failed to open Amlogic Codec

If bring struct codec_para_t from github

Code:
typedef struct {
    CODEC_HANDLE handle;        ///< codec device handler
    CODEC_HANDLE cntl_handle;   ///< video control device handler
    CODEC_HANDLE sub_handle;    ///< subtile device handler
    stream_type_t stream_type;  ///< stream type(es, ps, rm, ts)
    unsigned int has_video:1;   ///< stream has video(1) or not(0)
    unsigned int has_audio:1;   ///< stream has audio(1) or not(0)
    unsigned int has_sub:1;     ///< stream has subtitle(1) or not(0)
    unsigned int noblock:1;     ///< codec device is NONBLOCK(1) or not(0)
    int video_type;             ///< stream video type(H264, VC1...)
    int audio_type;             ///< stream audio type(PCM, WMA...)
    int sub_type;               ///< stream subtitle type(TXT, SSA...)
    int video_pid;              ///< stream video pid
    int audio_pid;              ///< stream audio pid
    int sub_pid;                ///< stream subtitle pid
    int audio_channels;         ///< stream audio channel number
    int audio_samplerate;       ///< steram audio sample rate
    int vbuf_size;              ///< video buffer size of codec device
    int abuf_size;              ///< audio buffer size of codec device
    dec_sysinfo_t am_sysinfo;   ///< system information for video
    audio_info_t audio_info;    ///< audio information pass to audiodsp
    int packet_size;            ///< data size per packet
    int avsync_threshold;       ///<for adec in ms>
    void * adec_priv;           ///<for adec>
} codec_para_t;

and from sources

Code:
typedef struct {
    CODEC_HANDLE handle;        ///< codec device handler
    CODEC_HANDLE cntl_handle;   ///< video control device handler
    CODEC_HANDLE sub_handle;    ///< subtile device handler
    CODEC_HANDLE audio_utils_handle;  ///< audio utils handler
    stream_type_t stream_type;  ///< stream type(es, ps, rm, ts)
    unsigned int has_video:1;                          ///< stream has video(1) or not(0)
    unsigned int  has_audio:1;                          ///< stream has audio(1) or not(0)
    unsigned int has_sub:1;                          ///< stream has subtitle(1) or not(0)
    unsigned int noblock:1;                          ///< codec device is NONBLOCK(1) or not(0)
    int video_type;             ///< stream video type(H264, VC1...)
    int audio_type;             ///< stream audio type(PCM, WMA...)
    int sub_type;               ///< stream subtitle type(TXT, SSA...)
    int video_pid;              ///< stream video pid
    int audio_pid;              ///< stream audio pid
    int sub_pid;                ///< stream subtitle pid
    int audio_channels;         ///< stream audio channel number
    int audio_samplerate;       ///< steram audio sample rate
    int vbuf_size;              ///< video buffer size of codec device
    int abuf_size;              ///< audio buffer size of codec device
    dec_sysinfo_t am_sysinfo;   ///< system information for video
    audio_info_t audio_info;    ///< audio information pass to audiodsp
    int packet_size;            ///< data size per packet
    int avsync_threshold;    ///<for adec in ms>
    void * adec_priv;          ///<for adec>
    int SessionID;
    int dspdec_not_supported;//check some profile that audiodsp decoder can not support,we switch to arm decoder
    int switch_audio_flag;          //<switch audio flag switching(1) else(0)
} codec_para_t;

Last part of structure is not so big problem but inserted in head CODEC_HANDLE audio_utils_handle; is big... Also problem there is no version function in amcodec... I don't see direct path to separate one version of structure from another in init.

Please help to find universal path resolving this problem.
Reply
#2
https://github.com/xbmc/xbmc/blob/master...-4.1.patch
https://github.com/xbmc/xbmc/blob/master...-4.2.patch
https://github.com/xbmc/xbmc/blob/master...-4.4.patch

see https://github.com/xbmc/xbmc/blob/master...r/Makefile

but these do not matter much, it's handled dynamically now, see https://github.com/xbmc/xbmc/blob/master...LCodec.cpp

// translate from generic to firmware version dependent
codec_init_para, line 168.

// added in JellyBean 4.2
if (CAndroidFeatures::GetVersion() > 16)
CBitstreamConverter::write_bits(&bs, 32, 0); // CODEC_HANDLE audio_utils_handle

Your problem is most likely not the structure but the permissions on /dev/am*
Reply

Logout Mark Read Team Forum Stats Members Help
new codec_para_t structure0