1 /* 2 * Copyright (C) 2014 Amlogic Corporation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef _PLAYER_H_ 18 #define _PLAYER_H_ 19 20 21 #include <stdint.h> 22 //#include <codec.h> 23 #include <player_type.h> 24 #include <player_error.h> 25 #include <message.h> 26 #include <player_dump.h> 27 #include <player_set_sys.h> 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 int player_init(); 34 int player_start(play_control_t *p, unsigned long priv); 35 int player_stop(int pid); 36 int player_stop_async(int pid); 37 int player_exit(int pid); 38 int player_pause(int pid); 39 int player_resume(int pid); 40 int player_timesearch(int pid, float s_time); 41 int player_forward(int pid, int speed); 42 int player_backward(int pid, int speed); 43 int player_aid(int pid, int audio_id); 44 int player_sid(int pid, int sub_id); 45 int player_switch_program(int pid, int video_pid, int audio_pid); 46 int player_progress_exit(void); 47 int player_list_allpid(pid_info_t *pid); 48 int check_pid_valid(int pid); 49 int player_get_play_info(int pid, player_info_t *info); 50 int player_get_media_info(int pid, media_info_t *minfo); 51 int player_video_overlay_en(unsigned enable); 52 int player_start_play(int pid); 53 int player_send_message(int pid, player_cmd_t *cmd); 54 player_status player_get_state(int pid); 55 unsigned int player_get_extern_priv(int pid); 56 int player_enable_autobuffer(int pid, int enable); 57 int player_set_autobuffer_level(int pid, float min, float middle, float max); 58 int player_set_disp_lastframe(int pid, int disp); 59 int player_get_bitrate(int pid); 60 int audio_set_mute(int pid, int mute); 61 int audio_get_volume_range(int pid, float *min, float *max); 62 int audio_set_volume(int pid, float val); 63 int audio_get_volume(int pid, float *val); 64 // set audio adec pre_gain dB format 65 int audio_set_pre_gain(int pid, float gain); 66 int audio_get_pre_gain(int pid, float *gain); 67 int audio_set_pre_mute(int pid, uint32_t mute); 68 int audio_get_pre_mute(int pid, uint32_t *mute); 69 70 int audio_set_lrvolume(int pid, float lvol, float rvol); 71 int audio_get_lrvolume(int pid, float* lvol, float* rvol); 72 73 int audio_set_volume_balance(int pid, int balance); 74 int audio_swap_left_right(int pid); 75 int audio_left_mono(int pid); 76 int audio_right_mono(int pid); 77 int audio_stereo(int pid); 78 int audio_lr_mix_set(int pid, int enable); 79 int audio_cur_pcmpara_Applied_get(int pid, int *pfs, int *pch,int *lfepresent); 80 81 int audio_set_spectrum_switch(int pid, int isStart, int interval); 82 int player_register_update_callback(callback_t *cb, update_state_fun_t up_fn, int interval_s); 83 char *player_status2str(player_status status); 84 char *player_value2str(char *key, int value); 85 int player_cache_system_init(int enable, const char*dir, int max_size, int block_size); 86 int resume_auto_refresh_rate(); 87 //control interface 88 int player_loop(int pid); 89 int player_noloop(int pid); 90 91 int check_url_type(char *filename); 92 int play_list_player(play_control_t *pctrl, unsigned long priv); 93 94 //freescale 95 int enable_freescale(int cfg); 96 int disable_freescale(int cfg); 97 int disable_freescale_MBX(); 98 int enable_2Xscale(); 99 int enable_2XYscale(); 100 int enable_freescale_MBX(); 101 int disable_2X_2XYscale(); 102 int GL_2X_scale(int mSwitch); 103 int wait_play_end(); 104 int wait_video_unreg(); 105 int clear_video_buf(); 106 int freescale_is_enable(); 107 int64_t player_get_lpbufbuffedsize(int pid); 108 int64_t player_get_streambufbuffedsize(int pid); 109 int audio_get_decoder_enable(int pid); 110 int player_closeCodec(int pid); 111 //int player_get_sub_odata(int pid, amsub_info_t *amsub_info); 112 int player_get_sub_start_pts(int pid, unsigned int *start_pts); 113 int player_set_sub_filename(int pid, const char* filename); 114 int player_get_current_time(int pid, unsigned int* curr_timeMs); 115 int player_get_curr_sub_id(int pid, int *curr_sub_id); 116 117 // streaming protocol api, hls/dash etc. 118 int player_get_source_type(int pid); 119 int player_get_streaming_track_count(int pid, int * trackNum); 120 int player_get_streaming_track_info(int pid, int * info_num, av_stream_info_t *** info_t); 121 int player_select_streaming_track(int pid, int index, int select); 122 int player_get_streaming_selected_track(int pid, int type, int * selected_track); 123 int audio_set_playback_rate(int pid,void *rate); 124 int player_set_inner_exit(int pid); 125 int player_is_inner_exit(int pid); 126 127 #ifdef __cplusplus 128 } 129 #endif 130 131 #endif 132 133