Skip to content
This repository
Browse code

changed libamplayer includes to support AMLogic Android 4.1/4.2

  • Loading branch information...
commit 309e01553d42845b412c5036139459c206f8ea4c 1 parent a434663
authored August 23, 2013
1  tools/depends/.gitignore
@@ -3,6 +3,7 @@
3 3
 /autom4te.cache/
4 4
 /**/.gitignore
5 5
 /**/.installed-*
  6
+/target/*/.patched-*
6 7
 /target/*/.installed-*
7 8
 /native/*/.installed-*
8 9
 /target/*/x86/*
15  tools/depends/target/libamplayer/Makefile
@@ -3,14 +3,23 @@ DEPS= ../../Makefile.include Makefile
3 3
 
4 4
 all: .installed-$(PLATFORM)
5 5
 
6  
-.installed-$(PLATFORM): $(DEPS)
  6
+.patched-$(PLATFORM): $(DEPS)
  7
+	rm -rf $(PLATFORM); mkdir -p $(PLATFORM)
  8
+	cp -rf libamplayer $(PLATFORM)/
  9
+	cd $(PLATFORM); patch -p1 < ../android-4.0-to-4.1.patch
  10
+	cd $(PLATFORM); patch -p1 < ../android-4.1-to-4.2.patch
  11
+	touch $@
  12
+
  13
+.installed-$(PLATFORM): .patched-$(PLATFORM)
7 14
 	mkdir -p $(PREFIX)/include/amcodec
8  
-	cp -rf libamplayer/include/amcodec/* $(PREFIX)/include/amcodec/
  15
+	cp -rf $(PLATFORM)/libamplayer/include/amcodec/* $(PREFIX)/include/amcodec/
9 16
 	mkdir -p $(PREFIX)/include/amplayer
10  
-	cp -rf libamplayer/include/amplayer/* $(PREFIX)/include/amplayer/
  17
+	cp -rf $(PLATFORM)/libamplayer/include/amplayer/* $(PREFIX)/include/amplayer/
11 18
 	touch $@
12 19
 
13 20
 clean:
14 21
 	rm -f .installed-$(PLATFORM)
  22
+	rm -f .patched-$(PLATFORM)
15 23
 
16 24
 distclean:: clean
  25
+	rm -rf $(PLATFORM)
524  tools/depends/target/libamplayer/android-4.0-to-4.1.patch
... ...
@@ -0,0 +1,524 @@
  1
+--- a/libamplayer/include/amcodec/amports/aformat.h
  2
++++ b/libamplayer/include/amcodec/amports/aformat.h
  3
+@@ -7,7 +7,7 @@
  4
+ */
  5
+ /* Copyright (C) 2007-2011, Amlogic Inc.
  6
+ * All right reserved
  7
+-* 
  8
++*
  9
+ */
  10
+ 
  11
+ /*
  12
+@@ -57,14 +57,16 @@ typedef enum {
  13
+     AFORMAT_VORBIS    = 18,
  14
+     AFORMAT_AAC_LATM   = 19,
  15
+     AFORMAT_APE   = 20,
  16
++    AFORMAT_EAC3   = 21,
  17
++    AFORMAT_PCM_WIFIDISPLAY = 22,
  18
+     AFORMAT_UNSUPPORT ,
  19
+-    AFORMAT_MAX    
  20
++    AFORMAT_MAX
  21
+ 
  22
+ } aformat_t;
  23
+ 
  24
+ #define AUDIO_EXTRA_DATA_SIZE   (4096)
  25
+ #define IS_AFMT_VALID(afmt)	((afmt > AFORMAT_UNKNOWN) && (afmt < AFORMAT_MAX))
  26
+-    
  27
++
  28
+ #define IS_AUIDO_NEED_EXT_INFO(afmt) ((afmt == AFORMAT_ADPCM) \
  29
+ 								 ||(afmt == AFORMAT_WMA) \
  30
+ 								 ||(afmt == AFORMAT_WMAPRO) \
  31
+@@ -75,15 +77,23 @@ typedef enum {
  32
+ 								 ||(afmt == AFORMAT_AMR)\
  33
+ 								 ||(afmt == AFORMAT_ALAC)\
  34
+ 								 ||(afmt == AFORMAT_AC3) \
  35
++								 ||(afmt == AFORMAT_EAC3) \
  36
+ 								 ||(afmt == AFORMAT_APE) \
  37
+-								 ||(afmt == AFORMAT_FLAC) )
  38
++								 ||(afmt == AFORMAT_FLAC)\
  39
++								 ||(afmt == AFORMAT_PCM_WIFIDISPLAY))
  40
+ 
  41
+ 
  42
+ #define IS_AUDIO_NOT_SUPPORT_EXCEED_2CH(afmt) ((afmt == AFORMAT_RAAC) \
  43
+ 										||(afmt == AFORMAT_COOK) \
  44
+-										||(afmt == AFORMAT_FLAC))
  45
++										/*||(afmt == AFORMAT_FLAC)*/)
  46
+ 
  47
+-#define IS_AUIDO_NEED_PREFEED_HEADER(afmt) ((afmt == AFORMAT_VORBIS) )
  48
++#define IS_AUDIO_NOT_SUPPORT_EXCEED_6CH(afmt) ((afmt == AFORMAT_WMAPRO))
  49
++#define IS_AUDIO_NOT_SUPPORT_EXCEED_FS48k(afmt) ((afmt == AFORMAT_WMAPRO))
  50
+ 
  51
++
  52
++#define IS_AUIDO_NEED_PREFEED_HEADER(afmt) ((afmt == AFORMAT_VORBIS) )
  53
++#define IS_AUDIO_NOT_SUPPORTED_BY_AUDIODSP(afmt,codec)  \
  54
++							((afmt == AFORMAT_AAC_LATM || afmt == AFORMAT_AAC) \
  55
++							 &&codec->profile == 0/* FF_PROFILE_AAC_MAIN*/)
  56
+ #endif /* AFORMAT_H */
  57
+ 
  58
+--- a/libamplayer/include/amcodec/amports/amstream.h
  59
++++ b/libamplayer/include/amcodec/amports/amstream.h
  60
+@@ -83,6 +83,7 @@
  61
+ #define AMSTREAM_IOC_SET_DEC_RESET _IOW(AMSTREAM_IOC_MAGIC, 0x1c, int)
  62
+ #define AMSTREAM_IOC_TS_SKIPBYTE _IOW(AMSTREAM_IOC_MAGIC, 0x1d, int)
  63
+ #define AMSTREAM_IOC_SUB_TYPE    _IOW(AMSTREAM_IOC_MAGIC, 0x1e, int)
  64
++#define AMSTREAM_IOC_CLEAR_VIDEO    _IOW(AMSTREAM_IOC_MAGIC, 0x1f, int)
  65
+ #define AMSTREAM_IOC_APTS             _IOR(AMSTREAM_IOC_MAGIC, 0x40, unsigned long)
  66
+ #define AMSTREAM_IOC_VPTS             _IOR(AMSTREAM_IOC_MAGIC, 0x41, unsigned long)
  67
+ #define AMSTREAM_IOC_PCRSCR           _IOR(AMSTREAM_IOC_MAGIC, 0x42, unsigned long)
  68
+@@ -96,10 +97,35 @@
  69
+ #define AMSTREAM_IOC_SET_PCRSCR       _IOW(AMSTREAM_IOC_MAGIC, 0x4a, unsigned long)
  70
+ #define AMSTREAM_IOC_GET_VIDEO_AXIS   _IOR(AMSTREAM_IOC_MAGIC, 0x4b, unsigned long)
  71
+ #define AMSTREAM_IOC_SET_VIDEO_AXIS   _IOW(AMSTREAM_IOC_MAGIC, 0x4c, unsigned long)
  72
++#define AMSTREAM_IOC_GET_VIDEO_CROP   _IOR(AMSTREAM_IOC_MAGIC, 0x4d, unsigned long)
  73
++#define AMSTREAM_IOC_SET_VIDEO_CROP   _IOW(AMSTREAM_IOC_MAGIC, 0x4e, unsigned long)
  74
+ #define AMSTREAM_IOC_SUB_NUM	_IOR(AMSTREAM_IOC_MAGIC, 0x50, unsigned long)
  75
+ #define AMSTREAM_IOC_SUB_INFO	_IOR(AMSTREAM_IOC_MAGIC, 0x51, unsigned long)
  76
+-
  77
++#define AMSTREAM_IOC_GET_SCREEN_MODE _IOR(AMSTREAM_IOC_MAGIC, 0x58, int)
  78
++#define AMSTREAM_IOC_SET_SCREEN_MODE _IOW(AMSTREAM_IOC_MAGIC, 0x59, int)
  79
+ #define AMSTREAM_IOC_SET_DEMUX  _IOW(AMSTREAM_IOC_MAGIC, 0x90, unsigned long)
  80
++#define AMSTREAM_IOC_GET_SYNC_ADISCON_DIFF  _IOR(AMSTREAM_IOC_MAGIC, 0x83, unsigned long)
  81
++#define AMSTREAM_IOC_GET_SYNC_VDISCON_DIFF  _IOR(AMSTREAM_IOC_MAGIC, 0x84, unsigned long)
  82
++#define AMSTREAM_IOC_SET_SYNC_ADISCON_DIFF  _IOW(AMSTREAM_IOC_MAGIC, 0x85, unsigned long)
  83
++#define AMSTREAM_IOC_SET_SYNC_VDISCON_DIFF  _IOW(AMSTREAM_IOC_MAGIC, 0x86, unsigned long)
  84
++#define AMSTREAM_IOC_GET_FREERUN_MODE  _IOR(AMSTREAM_IOC_MAGIC, 0x87, unsigned long)
  85
++#define AMSTREAM_IOC_SET_FREERUN_MODE  _IOW(AMSTREAM_IOC_MAGIC, 0x88, unsigned long)
  86
++#define AMSTREAM_IOC_SET_VSYNC_UPINT   _IOW(AMSTREAM_IOC_MAGIC, 0x89, unsigned long)
  87
++
  88
++#define AMSTREAM_IOC_SET_VIDEO_DELAY_LIMIT_MS _IOW(AMSTREAM_IOC_MAGIC, 0xa0, unsigned long)
  89
++#define AMSTREAM_IOC_GET_VIDEO_DELAY_LIMIT_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa1, unsigned long)
  90
++#define AMSTREAM_IOC_SET_AUDIO_DELAY_LIMIT_MS _IOW(AMSTREAM_IOC_MAGIC, 0xa2, unsigned long)
  91
++#define AMSTREAM_IOC_GET_AUDIO_DELAY_LIMIT_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa3, unsigned long)
  92
++#define AMSTREAM_IOC_GET_AUDIO_CUR_DELAY_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa4, unsigned long)
  93
++#define AMSTREAM_IOC_GET_VIDEO_CUR_DELAY_MS _IOR(AMSTREAM_IOC_MAGIC, 0xa5, unsigned long)
  94
++#define AMSTREAM_IOC_GET_AUDIO_AVG_BITRATE_BPS _IOR(AMSTREAM_IOC_MAGIC, 0xa6, unsigned long)
  95
++#define AMSTREAM_IOC_GET_VIDEO_AVG_BITRATE_BPS _IOR(AMSTREAM_IOC_MAGIC, 0xa7, unsigned long)
  96
++
  97
++#define AMAUDIO_IOC_MAGIC  'A'
  98
++#define AMAUDIO_IOC_SET_RESAMPLE_ENA        _IOW(AMAUDIO_IOC_MAGIC, 0x19, unsigned long)
  99
++#define AMAUDIO_IOC_GET_RESAMPLE_ENA        _IOR(AMAUDIO_IOC_MAGIC, 0x1a, unsigned long)
  100
++#define AMAUDIO_IOC_SET_RESAMPLE_TYPE       _IOW(AMAUDIO_IOC_MAGIC, 0x1b, unsigned long)
  101
++#define AMAUDIO_IOC_GET_RESAMPLE_TYPE       _IOR(AMAUDIO_IOC_MAGIC, 0x1c, unsigned long)
  102
+ 
  103
+ struct buf_status {
  104
+     int size;
  105
+--- a/libamplayer/include/amcodec/amports/vformat.h
  106
++++ b/libamplayer/include/amcodec/amports/vformat.h
  107
+@@ -85,6 +85,7 @@ typedef enum {
  108
+ #define CODEC_TAG_MP43      (0x3334504d)
  109
+ #define CODEC_TAG_M4S2      (0x3253344d)
  110
+ #define CODEC_TAG_DIV4      (0x34564944)
  111
++#define CODEC_TAG_divx       (0x78766964)
  112
+ #define CODEC_TAG_DIVX      (0x58564944)
  113
+ #define CODEC_TAG_DIV5      (0x35564944)
  114
+ #define CODEC_TAG_DX50      (0x30355844)
  115
+@@ -108,5 +109,6 @@ typedef enum {
  116
+ #define CODEC_TAG_WVC1      (0x31435657)
  117
+ #define CODEC_TAG_WMVA      (0x41564d57)
  118
+ #define CODEC_TAG_FMP4      (0x34504d46)
  119
++#define CODEC_TAG_FVFW      (0x57465646)
  120
+ 
  121
+ #endif /* VFORMAT_H */
  122
+--- a/libamplayer/include/amcodec/codec.h
  123
++++ b/libamplayer/include/amcodec/codec.h
  124
+@@ -86,8 +86,32 @@ int codec_set_sync_audio_discont(codec_para_t *pcodec, int discontinue);
  125
+ int codec_get_sync_audio_discont(codec_para_t *pcodec);
  126
+ int codec_set_sync_video_discont(codec_para_t *pcodec, int discontinue);
  127
+ int codec_get_sync_video_discont(codec_para_t *pcodec);
  128
+-
  129
++unsigned long codec_get_sync_audio_discont_diff(codec_para_t *pcodec);
  130
++unsigned long codec_get_sync_video_discont_diff(codec_para_t *pcodec);
  131
++int codec_set_sync_audio_discont_diff(codec_para_t *pcodec, unsigned long discontinue_diff);
  132
++int codec_set_sync_video_discont_diff(codec_para_t *pcodec, unsigned long discontinue_diff);
  133
+ int codec_get_sub_num(codec_para_t *pcodec);
  134
+ int codec_get_sub_info(codec_para_t *pcodec, subtitle_info_t *sub_info);
  135
+ 
  136
++int codec_set_av_threshold(codec_para_t *pcodec, int threshold);
  137
++
  138
++int codec_get_freerun_mode(codec_para_t *pcodec);
  139
++int codec_set_freerun_mode(codec_para_t *pcodec, unsigned int mode);
  140
++
  141
++int codec_init_audio_utils(codec_para_t *pcodec);
  142
++int codec_release_audio_utils(codec_para_t *pcodec);
  143
++int codec_set_audio_resample_ena(codec_para_t *pcodec, unsigned long mode);
  144
++int codec_get_audio_resample_ena(codec_para_t *pcodec);
  145
++int codec_set_audio_resample_type(codec_para_t *pcodec, unsigned long type);
  146
++
  147
++int codec_set_video_delay_limited_ms(codec_para_t *pcodec,int delay_ms);
  148
++int codec_get_video_delay_limited_ms(codec_para_t *pcodec,int *delay_ms);
  149
++int codec_set_audio_delay_limited_ms(codec_para_t *pcodec,int delay_ms);
  150
++int codec_get_audio_delay_limited_ms(codec_para_t *pcodec,int *delay_ms);
  151
++int codec_get_audio_cur_delay_ms(codec_para_t *pcodec,int *delay_ms);
  152
++int codec_get_video_cur_delay_ms(codec_para_t *pcodec,int *delay_ms);
  153
++int codec_get_video_cur_bitrate(codec_para_t *pcodec,int *bitrate);
  154
++int codec_get_audio_cur_bitrate(codec_para_t *pcodec,int *bitrate);
  155
++
  156
++int codec_set_vsync_upint(codec_para_t *pcodec, unsigned int mode);
  157
+ #endif
  158
+--- a/libamplayer/include/amcodec/codec_type.h
  159
++++ b/libamplayer/include/amcodec/codec_type.h
  160
+@@ -7,7 +7,7 @@
  161
+ */
  162
+ /* Copyright (C) 2007-2011, Amlogic Inc.
  163
+ * All right reserved
  164
+-*
  165
++* 
  166
+ */
  167
+ #ifndef CODEC_TYPE_H_
  168
+ #define CODEC_TYPE_H_
  169
+@@ -15,6 +15,7 @@
  170
+ #include "amports/amstream.h"
  171
+ #include "amports/vformat.h"
  172
+ #include "amports/aformat.h"
  173
++#include "ppmgr/ppmgr.h"
  174
+ 
  175
+ typedef int CODEC_HANDLE;
  176
+ 
  177
+@@ -37,7 +38,7 @@ typedef struct {
  178
+     unsigned int    status;  ///< status of video stream
  179
+     unsigned int    ratio;   ///< aspect ratio of video source
  180
+     void *          param;   ///< other parameters for video decoder
  181
+-    unsigned long long ratio64; ///< aspect ratio of video source
  182
++    unsigned long long    ratio64;   ///< aspect ratio of video source
  183
+ } dec_sysinfo_t;
  184
+ 
  185
+ typedef struct {
  186
+@@ -48,7 +49,7 @@ typedef struct {
  187
+     int codec_id;            ///< codec format id
  188
+     int block_align;         ///< audio block align from ffmpeg
  189
+     int extradata_size;      ///< extra data size
  190
+-    char extradata[AUDIO_EXTRA_DATA_SIZE];   ///< extra data information for decoder
  191
++    char extradata[AUDIO_EXTRA_DATA_SIZE];;   ///< extra data information for decoder
  192
+ } audio_info_t;
  193
+ 
  194
+ typedef struct {
  195
+@@ -56,10 +57,14 @@ typedef struct {
  196
+     CODEC_HANDLE cntl_handle;   ///< video control device handler
  197
+     CODEC_HANDLE sub_handle;    ///< subtile device handler
  198
+     stream_type_t stream_type;  ///< stream type(es, ps, rm, ts)
  199
+-    unsigned int has_video:1;   ///< stream has video(1) or not(0)
  200
+-    unsigned int has_audio:1;   ///< stream has audio(1) or not(0)
  201
+-    unsigned int has_sub:1;     ///< stream has subtitle(1) or not(0)
  202
+-    unsigned int noblock:1;     ///< codec device is NONBLOCK(1) or not(0)
  203
++unsigned int has_video:
  204
++    1;                          ///< stream has video(1) or not(0)
  205
++unsigned int  has_audio:
  206
++    1;                          ///< stream has audio(1) or not(0)
  207
++unsigned int has_sub:
  208
++    1;                          ///< stream has subtitle(1) or not(0)
  209
++unsigned int noblock:
  210
++    1;                          ///< codec device is NONBLOCK(1) or not(0)
  211
+     int video_type;             ///< stream video type(H264, VC1...)
  212
+     int audio_type;             ///< stream audio type(PCM, WMA...)
  213
+     int sub_type;               ///< stream subtitle type(TXT, SSA...)
  214
+@@ -73,17 +78,20 @@ typedef struct {
  215
+     dec_sysinfo_t am_sysinfo;   ///< system information for video
  216
+     audio_info_t audio_info;    ///< audio information pass to audiodsp
  217
+     int packet_size;            ///< data size per packet
  218
+-    int avsync_threshold;       ///<for adec in ms>
  219
+-    void * adec_priv;           ///<for adec>
  220
++    int avsync_threshold;    ///<for adec in ms>
  221
++    void * adec_priv;          ///<for adec>
  222
++    int SessionID;
  223
++	int dspdec_not_supported;//check some profile that audiodsp decoder can not support,we switch to arm decoder
  224
++	int switch_audio_flag;		//<switch audio flag switching(1) else(0)
  225
+ } codec_para_t;
  226
+ 
  227
+-typedef struct
  228
++typedef struct 
  229
+ {
  230
+-    signed char id;
  231
++    signed char id;      
  232
+     unsigned char width;
  233
+     unsigned char height;
  234
+-    unsigned char type;
  235
+-} subtitle_info_t;
  236
++	unsigned char type;    
  237
++}subtitle_info_t;
  238
+ #define MAX_SUB_NUM			(32)
  239
+ 
  240
+ #define IS_VALID_PID(t)     (t>=0 && t<=0x1fff)
  241
+@@ -95,10 +103,13 @@ typedef struct
  242
+ typedef struct {
  243
+     int sample_rate;         ///< audio stream sample rate
  244
+     int channels;            ///< audio stream channels
  245
+-    int format;              ///< codec format id
  246
+-    int handle;              ///< codec device handler
  247
++    int format;            ///< codec format id
  248
++    int handle;        ///< codec device handler
  249
+     int extradata_size;      ///< extra data size
  250
+     char extradata[AUDIO_EXTRA_DATA_SIZE];
  251
++	int SessionID;
  252
++	int dspdec_not_supported;//check some profile that audiodsp decoder can not support,we switch to arm decoder	
  253
++	int droppcm_flag;				// drop pcm flag, if switch audio (1)
  254
+ } arm_audio_info;
  255
+ 
  256
+ //audio decoder type, default arc
  257
+new file mode 100644
  258
+--- /dev/null
  259
++++ b/libamplayer/include/amcodec/ppmgr/ppmgr.h
  260
+@@ -0,0 +1,24 @@
  261
++/**
  262
++* @file ppmgr.h
  263
++* @brief  Porting from ppmgr driver for codec ioctl commands
  264
++* @author Tim Yao <timyao@amlogic.com>
  265
++* @version 1.0.0
  266
++* @date 2011-02-24
  267
++*/
  268
++/* Copyright (C) 2007-2011, Amlogic Inc.
  269
++* All right reserved
  270
++* 
  271
++*/
  272
++
  273
++#ifndef PPMGR_H
  274
++#define PPMGR_H
  275
++
  276
++#define PPMGR_IOC_MAGIC  'P'
  277
++//#define PPMGR_IOC_2OSD0		_IOW(PPMGR_IOC_MAGIC, 0x00, unsigned int)
  278
++//#define PPMGR_IOC_ENABLE_PP _IOW(PPMGR_IOC_MAGIC,0X01,unsigned int)
  279
++//#define PPMGR_IOC_CONFIG_FRAME  _IOW(PPMGR_IOC_MAGIC,0X02,unsigned int)
  280
++#define PPMGR_IOC_GET_ANGLE  _IOR(PPMGR_IOC_MAGIC,0X03,unsigned long)
  281
++#define PPMGR_IOC_SET_ANGLE  _IOW(PPMGR_IOC_MAGIC,0X04,unsigned long)
  282
++
  283
++#endif /* PPMGR_H */
  284
++
  285
+--- a/libamplayer/include/amplayer/message.h
  286
++++ b/libamplayer/include/amplayer/message.h
  287
+@@ -1,7 +1,7 @@
  288
+ #ifndef PLAYER_MESSAGE_H
  289
+ #define PLAYER_MESSAGE_H
  290
+ 
  291
+-#define MESSAGE_MAX 4
  292
++#define MESSAGE_MAX 8
  293
+ 
  294
+ #define CTRL_CMD_RESPONSE   (0xffff)
  295
+ 
  296
+@@ -41,6 +41,7 @@ typedef enum {
  297
+     CMD_SET_STEREO      = (1 << 14),   
  298
+     CMD_EN_AUTOBUF      = (1 << 15),
  299
+     CMD_SET_AUTOBUF_LEV = (1 << 16),
  300
++    CMD_SET_FREERUN_MODE = (1 << 17),
  301
+     CMD_MODE_MAX        = (1 << 31),
  302
+ } ctrl_mode_t;
  303
+ 
  304
+@@ -85,6 +86,5 @@ typedef struct {
  305
+ int message_free(player_cmd_t * cmd);
  306
+ player_cmd_t * message_alloc(void);
  307
+ int cmd2str(player_cmd_t *cmd, char *buf);
  308
+-
  309
+ #endif
  310
+ 
  311
+--- a/libamplayer/include/amplayer/player.h
  312
++++ b/libamplayer/include/amplayer/player.h
  313
+@@ -6,7 +6,7 @@
  314
+ #include <player_type.h>
  315
+ #include <player_error.h>
  316
+ #include <message.h>
  317
+-
  318
++#include <player_dump.h>
  319
+ 
  320
+ #ifdef  __cplusplus
  321
+ extern "C" {
  322
+@@ -52,7 +52,8 @@ int 	audio_right_mono(int pid);
  323
+ int 	audio_stereo(int pid);
  324
+ int 	audio_set_spectrum_switch(int pid,int isStart,int interval);
  325
+ int 	player_register_update_callback(callback_t *cb,update_state_fun_t up_fn,int interval_s);
  326
+-char 	*player_status2str(player_status status);
  327
++char *player_status2str(player_status status);
  328
++char *player_value2str(char *key, int value);
  329
+ int 	player_cache_system_init(int enable,const char*dir,int max_size,int block_size);
  330
+ 
  331
+ //control interface
  332
+new file mode 100644
  333
+--- /dev/null
  334
++++ b/libamplayer/include/amplayer/player_ctrl.h
  335
+@@ -0,0 +1,4 @@
  336
++/*
  337
++Just for old code compatible,no this header file may get compare error.
  338
++we can add more player controls to here later.
  339
++*/
  340
+new file mode 100644
  341
+--- /dev/null
  342
++++ b/libamplayer/include/amplayer/player_dump.h
  343
+@@ -0,0 +1,14 @@
  344
++#ifndef _PLAYER_DUMP_H_
  345
++#define _PLAYER_DUMP_H_
  346
++#ifdef  __cplusplus
  347
++extern "C" {
  348
++#endif
  349
++ 
  350
++int player_dump_playinfo(int pid, int fd);
  351
++int player_dump_bufferinfo(int pid, int fd);
  352
++int player_dump_tsyncinfo(int pid, int fd);
  353
++#ifdef  __cplusplus
  354
++}
  355
++#endif
  356
++#endif
  357
++
  358
+--- a/libamplayer/include/amplayer/player_set_sys.h
  359
++++ b/libamplayer/include/amplayer/player_set_sys.h
  360
+@@ -40,6 +40,7 @@ int set_black_policy(int blackout);
  361
+ int get_black_policy();
  362
+ int get_karaok_flag();
  363
+ int set_tsync_enable(int enable);
  364
++int get_tsync_enable(void);
  365
+ int set_tsync_discontinue(int enable);
  366
+ int get_pts_discontinue();
  367
+ int set_fb0_blank(int blank);
  368
+@@ -61,8 +62,6 @@ int set_fb1_scale_height(int height);
  369
+ int check_audiodsp_fatal_err(void);
  370
+ int set_stb_source_hiu(void);
  371
+ int set_stb_demux_source_hiu(void);
  372
+-int get_stb_demux_source(char *strval, int size);
  373
+-int get_stb_source(char *strval, int size);
  374
+ 
  375
+ int set_subtitle_enable(int num);
  376
+ int set_subtitle_curr(int num);
  377
+@@ -72,6 +71,8 @@ int check_file_same(char *filename2);
  378
+ int set_amutils_enable(int isOn);
  379
+ int set_amutils_cmd(const char* cmd);
  380
+ int get_amutils_cmd(char* cmd);
  381
++int check_audio_output();
  382
++
  383
+ 
  384
+ #ifdef  __cplusplus
  385
+ }
  386
+--- a/libamplayer/include/amplayer/player_thumbnail.h
  387
++++ b/libamplayer/include/amplayer/player_thumbnail.h
  388
+@@ -19,6 +19,7 @@ int thumbnail_get_key_data(void* handle, char* key, const void** data, int* data
  389
+ void thumbnail_get_video_rotation(void *handle, int* rotation);
  390
+ int thumbnail_decoder_close(void *handle);
  391
+ void thumbnail_res_free(void* handle);
  392
++int thumbnail_get_tracks_info(void *handle, int *vtracks,int *atracks,int *stracks);
  393
+ 
  394
+ #ifdef  __cplusplus
  395
+ }
  396
+--- a/libamplayer/include/amplayer/player_type.h
  397
++++ b/libamplayer/include/amplayer/player_type.h
  398
+@@ -5,14 +5,7 @@
  399
+ #include <stream_format.h>
  400
+ 
  401
+ #define MSG_SIZE                    64
  402
+-#if defined(HAS_AMLPLAYER_CHAPTERS)
  403
+-#define MAX_CHAPTERS                64
  404
+-#endif
  405
+-#if defined(HAS_AMLPLAYER_VIDEO_STREAMS10)
  406
+ #define MAX_VIDEO_STREAMS           10
  407
+-#else
  408
+-#define MAX_VIDEO_STREAMS           8
  409
+-#endif
  410
+ #define MAX_AUDIO_STREAMS           8
  411
+ #define MAX_SUB_INTERNAL            8
  412
+ #define MAX_SUB_EXTERNAL            24
  413
+@@ -33,7 +26,7 @@ typedef enum
  414
+ 	PLAYER_INITING  	= 0x10001,
  415
+ 	PLAYER_TYPE_REDY  = 0x10002,
  416
+ 	PLAYER_INITOK   	= 0x10003,	
  417
+-
  418
++        
  419
+ 	/******************************
  420
+ 	* 0x2000x: 
  421
+ 	* playback status
  422
+@@ -51,7 +44,7 @@ typedef enum
  423
+ 
  424
+ 	PLAYER_PLAY_NEXT	= 0x20009,	
  425
+ 	PLAYER_BUFFER_OK	= 0x2000a,	
  426
+-	PLAYER_FOUND_SUB	= 0x2000b,
  427
++	PLAYER_FOUND_SUB	= 0x2000b,	
  428
+ 
  429
+ 	/******************************
  430
+ 	* 0x3000x: 
  431
+@@ -120,9 +113,6 @@ typedef struct
  432
+     aformat_t aformat;
  433
+     int duration;
  434
+ 	audio_tag_info *audio_tag;    
  435
+-#if defined(HAS_AMLPLAYER_AUDIO_LANG)
  436
+-    char audio_language[4];
  437
+-#endif
  438
+ }maudio_info_t;
  439
+ 
  440
+ typedef struct
  441
+@@ -157,33 +147,15 @@ typedef struct
  442
+     int cur_sub_index;	
  443
+     int seekable;
  444
+     int drm_check;
  445
+-#if defined(HAS_AMLPLAYER_VIDEO_STREAMS10)
  446
+-    int t1;
  447
+-    int t2;
  448
+-#endif
  449
+-#if defined(HAS_AMLPLAYER_CHAPTERS)
  450
+-    int has_chapter;
  451
+-    int total_chapter_num;
  452
+-#endif
  453
++	int adif_file_flag;
  454
+ }mstream_info_t;
  455
+ 
  456
+-#if defined(HAS_AMLPLAYER_CHAPTERS)
  457
+-typedef struct
  458
+-{
  459
+-    char    *name;
  460
+-    int64_t seekto_ms;
  461
+-} mchapter_info_t;
  462
+-#endif
  463
+-
  464
+ typedef struct
  465
+ {	
  466
+ 	mstream_info_t stream_info;
  467
+ 	mvideo_info_t *video_info[MAX_VIDEO_STREAMS];
  468
+ 	maudio_info_t *audio_info[MAX_AUDIO_STREAMS];
  469
+     msub_info_t *sub_info[MAX_SUB_STREAMS];
  470
+-#if defined(HAS_AMLPLAYER_CHAPTERS)
  471
+-	mchapter_info_t *chapter_info[MAX_CHAPTERS];
  472
+-#endif
  473
+ }media_info_t;
  474
+ 
  475
+ typedef struct player_info
  476
+@@ -210,6 +182,7 @@ typedef struct player_info
  477
+ 	int64_t	bufed_pos;
  478
+ 	int	bufed_time;/* Second*/
  479
+     unsigned int drm_rental;
  480
++	int64_t download_speed; //download speed
  481
+ }player_info_t;
  482
+ 
  483
+ typedef struct pid_info
  484
+@@ -252,13 +225,14 @@ typedef struct
  485
+     int vbufsize;
  486
+     int vdatasize;
  487
+     int abufused;
  488
+-    int abufsize;
  489
+-    int adatasize;
  490
++    int abufsize;	
  491
++    int adatasize;	
  492
+     int sbufused;
  493
+-    int sbufsize;
  494
+-    int sdatasize;
  495
++    int sbufsize;	
  496
++    int sdatasize;		
  497
+ }hwbufstats_t;
  498
+ 
  499
++
  500
+ typedef struct
  501
+ {
  502
+     update_state_fun_t update_statue_callback;
  503
+@@ -275,7 +249,7 @@ typedef struct
  504
+ 	int	video_index;						//video track, no assigned, please set to -1
  505
+ 	int	audio_index;						//audio track, no assigned, please set to -1
  506
+ 	int sub_index;							//subtitle track, no assigned, please set to -1
  507
+-	float t_pos;							//start postion, use second as unit
  508
++	float t_pos;								//start postion, use second as unit
  509
+ 	int	read_max_cnt;						//read retry maxium counts, if exceed it, return error
  510
+ 	int avsync_threshold;                             //for adec av sync threshold in ms
  511
+ 	union
  512
+--- a/libamplayer/include/amplayer/stream_format.h
  513
++++ b/libamplayer/include/amplayer/stream_format.h
  514
+@@ -37,7 +37,9 @@ typedef enum
  515
+     ASF_FILE        = 17,
  516
+     STREAM_FILE     = 18,
  517
+     APE_FILE		= 19,        
  518
+-    FILE_MAX		= 20,        
  519
++    AMR_FILE        = 20,
  520
++    AVS_FILE		= 21, 
  521
++    FILE_MAX		= 22,        
  522
+ }pfile_type;
  523
+ 
  524
+ #endif
38  tools/depends/target/libamplayer/android-4.1-to-4.2.patch
... ...
@@ -0,0 +1,38 @@
  1
+--- a/libamplayer/include/amcodec/codec_type.h
  2
++++ b/libamplayer/include/amcodec/codec_type.h
  3
+@@ -56,6 +56,7 @@ typedef struct {
  4
+     CODEC_HANDLE handle;        ///< codec device handler
  5
+     CODEC_HANDLE cntl_handle;   ///< video control device handler
  6
+     CODEC_HANDLE sub_handle;    ///< subtile device handler
  7
++    CODEC_HANDLE audio_utils_handle;  ///< audio utils handler
  8
+     stream_type_t stream_type;  ///< stream type(es, ps, rm, ts)
  9
+ unsigned int has_video:
  10
+     1;                          ///< stream has video(1) or not(0)
  11
+--- a/libamplayer/include/amplayer/player_type.h
  12
++++ b/libamplayer/include/amplayer/player_type.h
  13
+@@ -204,7 +204,7 @@ typedef struct player_file_type
  14
+ #define STATE_PRE(sta) (sta>>16)
  15
+ #define PLAYER_THREAD_IS_INITING(sta)	(STATE_PRE(sta)==0x1)
  16
+ #define PLAYER_THREAD_IS_RUNNING(sta)	(STATE_PRE(sta)==0x2)
  17
+-#define PLAYER_THREAD_IS_STOPPED(sta)	(STATE_PRE(sta)==0x3)
  18
++#define PLAYER_THREAD_IS_STOPPED(sta)  (sta==PLAYER_EXIT)
  19
+ 
  20
+ typedef int (*update_state_fun_t)(int pid,player_info_t *) ;
  21
+ typedef int (*notify_callback)(int pid,int msg,unsigned long ext1,unsigned long ext2);
  22
+@@ -217,6 +217,7 @@ typedef enum
  23
+	PLAYER_EVENTS_FILE_TYPE,				///<ext1=player_file_type_t*,ext2=0
  24
+	PLAYER_EVENTS_HTTP_WV,				        ///<(need use DRMExtractor),ext1=0, ext2=0
  25
+	PLAYER_EVENTS_HWBUF_DATA_SIZE_CHANGED,		///<(need use DRMExtractor),ext1=0, ext2=0
  26
++       PLAYER_EVENTS_NOT_SUPPORT_SEEKABLE,     //not support seek;
  27
+ }player_events;
  28
+ 
  29
+ typedef struct
  30
+@@ -284,6 +285,7 @@ typedef struct
  31
+ 	int buffing_starttime_s;			//for rest buffing_middle,buffering seconds data to start.
  32
+ 	int buffing_force_delay_s;
  33
+ 	int lowbuffermode_flag;
  34
++	int lowbuffermode_limited_ms;
  35
+ 	int reserved [56];					//reserved  for furthur used,some one add more ,can del reserved num
  36
+ 	int SessionID;
  37
+  }play_control_t; 
  38
+

0 notes on commit 309e015

Please sign in to comment.
Something went wrong with that request. Please try again.