Edit online

数据结构设计

// 事件回调函数
typedef s32 (*event_handler)(void* app_data,s32 event,s32 data1,s32 data2);

// 事件
enum aic_player_event {
        AIC_PLAYER_EVENT_PLAY_END = 0,  // 文件播放结束
        AIC_PLAYER_EVENT_PLAY_TIME,             //播放时刻,pts = data1<<32|data2
        AIC_PLAYER_EVENT_DEMUXER_FORMAT_DETECTED,//文件解析成功
        AIC_PLAYER_EVENT_DEMUXER_FORMAT_NOT_DETECTED//文件解析失败
};

//抓拍结构体信息
// now do not support  setting  nWidth and  nHeight,just only support setting pFilePath
struct aic_capture_info {
        s8 *pFilePath;
        s32 nWidth;
        s32 nHeight;
};

struct aic_video_stream {
        s32   width;
        s32   height;
};

struct aic_audio_stream {
        s32 nb_channel;
        s32 bits_per_sample;
        s32 sample_rate;
};
// 媒体信息
struct av_media_info {
        s64  file_size;
        s64  duration;
        u8   has_video;
        u8   has_audio;
        u8   seek_able;
        struct aic_video_stream video_stream;
        struct aic_audio_stream audio_stream;
};