audioplayer.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 82 行

H
82
字号
#ifndef __AUDIO_PLAYER_APP_H
#define __AUDIO_PLAYER_APP_H

#include "includes.h"
#include "aw_windows.h"

typedef enum {
	AUDIO_PLAYER_INIT, 
    AUDIO_PLAYER_PLAY,                   /* normal seamless playback */ 
    AUDIO_PLAYER_PAUSE,                  /* paused during normal seamless playback */ 
    AUDIO_PLAYER_SEAMLESS_FF,
    AUDIO_PLAYER_SEAMLESS_FB,
    AUDIO_PLAYER_STOP, 
    AUDIO_PLAYER_ERROR,
    AUDIO_PLAYER_QUIT,
}audio_player_status;

typedef struct {
    unsigned duration;
    unsigned bitrate;
    unsigned audio_sample_rate;
    unsigned char audio_channels;
    unsigned char* audio_codec;
} audio_player_clip_info;

typedef struct {
    int targetfd_a;
    unsigned char audio_started;
    OS_EVENT *audio_msgq;

   int audio_file_fd;
    int audio_dec_fd;
    int audio_stream_buffer_size;

    /* current playing time, unit 0.1s */
    int play_time; 
    /* for FF/FB */
    int fskip_time;  
    int fplay_time;
    int fnext_cmd_time;
    /* for resume playing */
    int start_play_time; 
     /* current status */
     audio_player_status stat;      
     unsigned char seek_disable;
} audio_player_play_t;

typedef struct {
    int type;  // 0 - default, 1- user setting	
    unsigned char* buf;
    int len;
    int left;
} audio_player_buffer_t;

#if 1
typedef struct{
    void *src; // if default, src is a array, if user setting,  src is a file path
    int type;  // 0 - default, 1- user setting
    int size;
    int left;
    int play_size;			
}audio_player_para_t;
#endif

typedef struct {
    PAPPTASKARG         	app;            /* application handle */
    audio_player_play_t     play;           /* playback control and running info */
    audio_player_buffer_t  	buffer;         
    audio_player_para_t *param;
    AVSysEvent_t        	internal_cmd_handle;
    EventSubscriber_t   	*listener;      /* event loop listener */
    audio_player_clip_info  *clip_info;
    AUDIO_STREAM_INFO audio_info;	
    char* filename;
} audio_player_t;

void AudioPlayerTaskProcess(void *opt);
void AudioPlayerAppGetInfo(void* pInfo);

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?