diff options
author | davilla <davilla@4pi.com> | 2013-05-04 21:21:53 -0400 |
---|---|---|
committer | davilla <davilla@4pi.com> | 2013-05-04 22:54:13 -0400 |
commit | 6198607aad941b6547601a96b8bdd0ec37bc9cbd (patch) | |
tree | d5350b2fc1ab675c517f6c566a3cad4f49648483 /tools | |
parent | 9244cbfacb4588c8d816af0ad01006e8cea22333 (diff) |
update libamplayer, amlplayer, amlogic egl
Diffstat (limited to 'tools')
6 files changed, 307 insertions, 3 deletions
diff --git a/tools/depends/target/libamplayer/libamplayer/include/amports/vformat.h b/tools/depends/target/libamplayer/libamplayer/include/amports/vformat.h index 6ded0d47d2..ed0021963f 100644 --- a/tools/depends/target/libamplayer/libamplayer/include/amports/vformat.h +++ b/tools/depends/target/libamplayer/libamplayer/include/amports/vformat.h @@ -48,6 +48,7 @@ typedef enum { VIDEO_DEC_FORMAT_WMV3, VIDEO_DEC_FORMAT_WVC1, VIDEO_DEC_FORMAT_SW, + VIDEO_DEC_FORMAT_AVS, VIDEO_DEC_FORMAT_MAX } vdec_type_t; diff --git a/tools/depends/target/libamplayer/libamplayer/include/codec.h b/tools/depends/target/libamplayer/libamplayer/include/codec.h new file mode 100644 index 0000000000..187d4d5c82 --- /dev/null +++ b/tools/depends/target/libamplayer/libamplayer/include/codec.h @@ -0,0 +1,93 @@ +/** +* @file codec.h +* @brief Function prototypes of codec lib +* @author Zhang Chen <chen.zhang@amlogic.com> +* @version 1.0.0 +* @date 2011-02-24 +*/ +/* Copyright (C) 2007-2011, Amlogic Inc. +* All right reserved +* +*/ +#ifndef CODEC_CTRL_H_ +#define CODEC_CTRL_H_ + +#include <codec_type.h> +#include <codec_error.h> + + +int codec_init(codec_para_t *); +int codec_close(codec_para_t *); +void codec_audio_basic_init(void); +void codec_close_audio(codec_para_t *); +void codec_resume_audio(codec_para_t *, unsigned int); +int codec_reset(codec_para_t *); +int codec_init_sub(codec_para_t *); +int codec_open_sub_read(void); +int codec_close_sub(codec_para_t *); +int codec_close_sub_fd(CODEC_HANDLE); +int codec_reset_subtile(codec_para_t *pcodec); +int codec_poll_sub(codec_para_t *); +int codec_poll_sub_fd(CODEC_HANDLE, int); +int codec_get_sub_size(codec_para_t *); +int codec_get_sub_size_fd(CODEC_HANDLE); +int codec_read_sub_data(codec_para_t *, char *, unsigned int); +int codec_read_sub_data_fd(CODEC_HANDLE, char *, unsigned int); +int codec_write_sub_data(codec_para_t *, char *, unsigned int); +int codec_init_cntl(codec_para_t *); +int codec_close_cntl(codec_para_t *); +int codec_poll_cntl(codec_para_t *); +int codec_get_cntl_state(codec_para_t *); +int codec_set_cntl_mode(codec_para_t *, unsigned int); +int codec_set_cntl_avthresh(codec_para_t *, unsigned int); +int codec_set_cntl_syncthresh(codec_para_t *pcodec, unsigned int syncthresh); +int codec_reset_audio(codec_para_t *pcodec); +int codec_set_audio_pid(codec_para_t *pcodec); +int codec_set_sub_id(codec_para_t *pcodec); +int codec_set_sub_type(codec_para_t *pcodec); +int codec_audio_reinit(codec_para_t *pcodec); +int codec_set_dec_reset(codec_para_t *pcodec); + +int codec_write(codec_para_t *pcodec, void *buffer, int len); +int codec_checkin_pts(codec_para_t *pcodec, unsigned long pts); +int codec_get_vbuf_state(codec_para_t *, struct buf_status *); +int codec_get_abuf_state(codec_para_t *, struct buf_status *); +int codec_get_vdec_state(codec_para_t *, struct vdec_status *); +int codec_get_adec_state(codec_para_t *, struct adec_status *); + +int codec_pause(codec_para_t *); +int codec_resume(codec_para_t *); +int codec_audio_search(codec_para_t *p); +int codec_set_mute(codec_para_t *p, int mute); +int codec_get_volume_range(codec_para_t *, int *min, int *max); +int codec_set_volume(codec_para_t *, float val); +int codec_get_volume(codec_para_t *, float *val); +int codec_set_lrvolume(codec_para_t *, float lvol,float rvol); +int codec_get_lrvolume(codec_para_t *, float *lvol,float* rvol); +int codec_get_mutesta(codec_para_t *); +int codec_set_volume_balance(codec_para_t *, int); /*left£¨0-100)right*/ +int codec_swap_left_right(codec_para_t *); +int codec_left_mono(codec_para_t *p); +int codec_right_mono(codec_para_t *p); +int codec_stereo(codec_para_t *p); +int codec_get_soundtrack(codec_para_t *p,int* strack); +int codec_audio_automute(void *priv, int auto_mute); +int codec_audio_spectrum_switch(codec_para_t *p, int isStart, int interval); +int codec_audio_isready(codec_para_t *p); +int codec_audio_get_nb_frames(codec_para_t *p); +int codec_audio_set_audioinfo(codec_para_t *p); + +int codec_get_apts(codec_para_t *pcodec); +int codec_get_vpts(codec_para_t *pcodec); +int codec_get_pcrscr(codec_para_t *pcodec); +int codec_set_pcrscr(codec_para_t *pcodec, int val); +int codec_set_syncenable(codec_para_t *pcodec, int enable); +int codec_set_sync_audio_discont(codec_para_t *pcodec, int discontinue); +int codec_get_sync_audio_discont(codec_para_t *pcodec); +int codec_set_sync_video_discont(codec_para_t *pcodec, int discontinue); +int codec_get_sync_video_discont(codec_para_t *pcodec); + +int codec_get_sub_num(codec_para_t *pcodec); +int codec_get_sub_info(codec_para_t *pcodec, subtitle_info_t *sub_info); + +#endif diff --git a/tools/depends/target/libamplayer/libamplayer/include/codec_error.h b/tools/depends/target/libamplayer/libamplayer/include/codec_error.h new file mode 100644 index 0000000000..0d6df8fdf4 --- /dev/null +++ b/tools/depends/target/libamplayer/libamplayer/include/codec_error.h @@ -0,0 +1,37 @@ +/** +* @file codec_error.h +* @brief Codec error type definitions +* @author Zhang Chen <chen.zhang@amlogic.com> +* @version 1.0.0 +* @date 2011-02-24 +*/ +/* Copyright (C) 2007-2011, Amlogic Inc. +* All right reserved +* +*/ + +#ifndef CODEC_ERROR_H_ +#define CODEC_ERROR_H_ + +#define C_PAE (0x01000000) + +#define CODEC_ERROR_NONE ( 0) +#define CODEC_ERROR_INVAL (C_PAE | 1) +#define CODEC_ERROR_NOMEM (C_PAE | 2) +#define CODEC_ERROR_BUSY (C_PAE | 3) +#define CODEC_ERROR_IO (C_PAE | 4) +#define CODEC_ERROR_PARAMETER (C_PAE | 5) +#define CODEC_ERROR_AUDIO_TYPE_UNKNOW (C_PAE | 6) +#define CODEC_ERROR_VIDEO_TYPE_UNKNOW (C_PAE | 7) +#define CODEC_ERROR_STREAM_TYPE_UNKNOW (C_PAE | 8) +#define CODEC_ERROR_VDEC_TYPE_UNKNOW (C_PAE | 9) + +#define CODEC_ERROR_INIT_FAILED (C_PAE | 10) +#define CODEC_ERROR_SET_BUFSIZE_FAILED (C_PAE | 11) +#define CODEC_OPEN_HANDLE_FAILED (C_PAE | 12) + + + + +#endif + diff --git a/tools/depends/target/libamplayer/libamplayer/include/codec_msg.h b/tools/depends/target/libamplayer/libamplayer/include/codec_msg.h new file mode 100644 index 0000000000..f898af3756 --- /dev/null +++ b/tools/depends/target/libamplayer/libamplayer/include/codec_msg.h @@ -0,0 +1,19 @@ +/** +* @file codec_msg.h +* @brief Function prototype of codec error +* @author Zhang Chen <chen.zhang@amlogic.com> +* @version 1.0.0 +* @date 2011-02-24 +*/ +/* Copyright (C) 2007-2011, Amlogic Inc. +* All right reserved +* +*/ +#ifndef CODEC_MSG_H +#define CODEC_MSG_H + +const char * codec_error_msg(int error); +int system_error_to_codec_error(int error); +void print_error_msg(int error, int syserr, char *func, int line); + +#endif diff --git a/tools/depends/target/libamplayer/libamplayer/include/codec_type.h b/tools/depends/target/libamplayer/libamplayer/include/codec_type.h new file mode 100644 index 0000000000..5d61ca8722 --- /dev/null +++ b/tools/depends/target/libamplayer/libamplayer/include/codec_type.h @@ -0,0 +1,108 @@ +/** +* @file codec_type.h +* @brief Definitions of codec type and structures +* @author Zhang Chen <chen.zhang@amlogic.com> +* @version 1.0.0 +* @date 2011-02-24 +*/ +/* Copyright (C) 2007-2011, Amlogic Inc. +* All right reserved +* +*/ +#ifndef CODEC_TYPE_H_ +#define CODEC_TYPE_H_ + +#include "amports/amstream.h" +#include "amports/vformat.h" +#include "amports/aformat.h" + +typedef int CODEC_HANDLE; + +typedef enum { + STREAM_TYPE_UNKNOW, + STREAM_TYPE_ES_VIDEO, + STREAM_TYPE_ES_AUDIO, + STREAM_TYPE_ES_SUB, + STREAM_TYPE_PS, + STREAM_TYPE_TS, + STREAM_TYPE_RM, +} stream_type_t; + +typedef struct { + unsigned int format; ///< video format, such as H264, MPEG2... + unsigned int width; ///< video source width + unsigned int height; ///< video source height + unsigned int rate; ///< video source frame duration + unsigned int extra; ///< extra data information of video stream + unsigned int status; ///< status of video stream + unsigned int ratio; ///< aspect ratio of video source + void * param; ///< other parameters for video decoder + unsigned long long ratio64; ///< aspect ratio of video source +} dec_sysinfo_t; + +typedef struct { + int valid; ///< audio extradata valid(1) or invalid(0), set by dsp + int sample_rate; ///< audio stream sample rate + int channels; ///< audio stream channels + int bitrate; ///< audio stream bit rate + int codec_id; ///< codec format id + int block_align; ///< audio block align from ffmpeg + int extradata_size; ///< extra data size + char extradata[AUDIO_EXTRA_DATA_SIZE]; ///< extra data information for decoder +} audio_info_t; + +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; + +typedef struct +{ + signed char id; + unsigned char width; + unsigned char height; + unsigned char type; +} subtitle_info_t; +#define MAX_SUB_NUM (32) + +#define IS_VALID_PID(t) (t>=0 && t<=0x1fff) +#define IS_VALID_STREAM(t) (t>0 && t<=0x1fff) +#define IS_VALID_ATYPE(t) (t>=0 && t<AFORMAT_MAX) +#define IS_VALID_VTYPE(t) (t>=0 && t<VFORMAT_MAX) + +//pass to arm audio decoder +typedef struct { + int sample_rate; ///< audio stream sample rate + int channels; ///< audio stream channels + int format; ///< codec format id + int handle; ///< codec device handler + int extradata_size; ///< extra data size + char extradata[AUDIO_EXTRA_DATA_SIZE]; +} arm_audio_info; + +//audio decoder type, default arc +#define AUDIO_ARC_DECODER 0 +#define AUDIO_ARM_DECODER 1 +#define AUDIO_FFMPEG_DECODER 2 +#endif diff --git a/tools/depends/target/libamplayer/libamplayer/include/player_type.h b/tools/depends/target/libamplayer/libamplayer/include/player_type.h index 2abd1940f3..37ad847573 100644 --- a/tools/depends/target/libamplayer/libamplayer/include/player_type.h +++ b/tools/depends/target/libamplayer/libamplayer/include/player_type.h @@ -5,7 +5,14 @@ #include <stream_format.h> #define MSG_SIZE 64 +#if defined(HAS_AMLPLAYER_CHAPTERS) +#define MAX_CHAPTERS 64 +#endif +#if defined(HAS_AMLPLAYER_VIDEO_STREAMS10) +#define MAX_VIDEO_STREAMS 10 +#else #define MAX_VIDEO_STREAMS 8 +#endif #define MAX_AUDIO_STREAMS 8 #define MAX_SUB_INTERNAL 8 #define MAX_SUB_EXTERNAL 24 @@ -64,8 +71,6 @@ typedef enum PLAYER_DIVX_AUTHORERR = 0x40001, PLAYER_DIVX_RENTAL_EXPIRED = 0x40002, PLAYER_DIVX_RENTAL_VIEW = 0x40003, - - }player_status; @@ -107,6 +112,7 @@ typedef struct typedef struct { + int index; int id; int channel; int sample_rate; @@ -114,10 +120,14 @@ typedef struct aformat_t aformat; int duration; audio_tag_info *audio_tag; +#if defined(HAS_AMLPLAYER_AUDIO_LANG) + char audio_language[4]; +#endif }maudio_info_t; typedef struct { + int index; char id; char internal_external; //0:internal_sub 1:external_sub unsigned short width; @@ -147,14 +157,33 @@ typedef struct int cur_sub_index; int seekable; int drm_check; +#if defined(HAS_AMLPLAYER_VIDEO_STREAMS10) + int t1; + int t2; +#endif +#if defined(HAS_AMLPLAYER_CHAPTERS) + int has_chapter; + int total_chapter_num; +#endif }mstream_info_t; +#if defined(HAS_AMLPLAYER_CHAPTERS) +typedef struct +{ + char *name; + int64_t seekto_ms; +} mchapter_info_t; +#endif + typedef struct { mstream_info_t stream_info; mvideo_info_t *video_info[MAX_VIDEO_STREAMS]; maudio_info_t *audio_info[MAX_AUDIO_STREAMS]; msub_info_t *sub_info[MAX_SUB_STREAMS]; +#if defined(HAS_AMLPLAYER_CHAPTERS) + mchapter_info_t *chapter_info[MAX_CHAPTERS]; +#endif }media_info_t; typedef struct player_info @@ -213,10 +242,25 @@ typedef enum PLAYER_EVENTS_ERROR, ///<ext1=error_code,ext2=message char * PLAYER_EVENTS_BUFFERING, ///<ext1=buffered=d,d={0-100},ext2=0, PLAYER_EVENTS_FILE_TYPE, ///<ext1=player_file_type_t*,ext2=0 + PLAYER_EVENTS_HTTP_WV, ///<(need use DRMExtractor),ext1=0, ext2=0 + PLAYER_EVENTS_HWBUF_DATA_SIZE_CHANGED, ///<(need use DRMExtractor),ext1=0, ext2=0 }player_events; typedef struct { + int vbufused; + int vbufsize; + int vdatasize; + int abufused; + int abufsize; + int adatasize; + int sbufused; + int sbufsize; + int sdatasize; +}hwbufstats_t; + +typedef struct +{ update_state_fun_t update_statue_callback; int update_interval; long callback_old_time; @@ -231,7 +275,7 @@ typedef struct int video_index; //video track, no assigned, please set to -1 int audio_index; //audio track, no assigned, please set to -1 int sub_index; //subtitle track, no assigned, please set to -1 - int t_pos; //start postion, use second as unit + float t_pos; //start postion, use second as unit int read_max_cnt; //read retry maxium counts, if exceed it, return error int avsync_threshold; //for adec av sync threshold in ms union @@ -265,7 +309,9 @@ typedef struct int is_type_parser; //is try to get file type int buffing_starttime_s; //for rest buffing_middle,buffering seconds data to start. int buffing_force_delay_s; + int lowbuffermode_flag; int reserved [56]; //reserved for furthur used,some one add more ,can del reserved num + int SessionID; }play_control_t; #endif |