X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fmm_player.c;h=e572e20fc83bc45945ec1c3170e72cc43746c920;hb=3f3a09d41e764f459083c62119e610a5629eeadb;hp=33c02f8415d188bb267579f9a5a975500b3aff22;hpb=20faab669b8da03a2d43acc90f1a5dce13f1a30b;p=platform%2Fcore%2Fmultimedia%2Flibmm-player.git diff --git a/src/mm_player.c b/src/mm_player.c index 33c02f8..e572e20 100644 --- a/src/mm_player.c +++ b/src/mm_player.c @@ -36,28 +36,27 @@ #include "mm_player_tracks.h" #include "mm_player_es.h" #include "mm_player_360.h" +#include "mm_player_gst.h" int mm_player_create(MMHandleType *player) { int result = MM_ERROR_PLAYER_INTERNAL; - mm_player_t* new_player = NULL; + mmplayer_t *new_player = NULL; MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); /* alloc player structure */ - new_player = g_malloc(sizeof(mm_player_t)); + new_player = g_try_new0(mmplayer_t, 1); if (!new_player) { LOGE("Cannot allocate memory for player\n"); result = MM_ERROR_PLAYER_RESOURCE_LIMIT; goto ERROR; } - memset(new_player, 0, sizeof(mm_player_t)); - /* create player lock */ - g_mutex_init(&new_player->cmd_lock); - - /* create player lock */ - g_mutex_init(&new_player->playback_lock); + /* create player lock and cond */ + MMPLAYER_CMD_LOCK_INIT(new_player); + g_mutex_init(&new_player->reconfigure_lock); + g_cond_init(&new_player->reconfigure_cond); /* load ini files */ if (MM_ERROR_NONE != mm_player_ini_load(&new_player->ini)) { @@ -87,9 +86,9 @@ ERROR: if (new_player) { _mmplayer_destroy((MMHandleType)new_player); - g_mutex_clear(&new_player->cmd_lock); - g_mutex_clear(&new_player->playback_lock); - + MMPLAYER_CMD_LOCK_DEINIT(new_player); + g_mutex_clear(&new_player->reconfigure_lock); + g_cond_clear(&new_player->reconfigure_cond); MMPLAYER_FREEIF(new_player); } @@ -97,15 +96,16 @@ ERROR: return result; /* MM_ERROR_PLAYER_INTERNAL or MM_ERROR_PLAYER_RESOURCE_LIMIT */ } -int mm_player_destroy(MMHandleType player) +int mm_player_destroy(MMHandleType player) { int result = MM_ERROR_NONE; MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); + _mmplayer_bus_watcher_remove(player); /* destroy the gst bus msg thread if it is remained. this funct have to be called before getting cmd lock. */ - __mmplayer_bus_msg_thread_destroy(player); + _mmplayer_bus_msg_thread_destroy(player); MMPLAYER_CMD_LOCK(player); @@ -113,13 +113,17 @@ int mm_player_destroy(MMHandleType player) MMPLAYER_CMD_UNLOCK(player); - g_mutex_clear(&((mm_player_t*)player)->cmd_lock); - g_mutex_clear(&((mm_player_t*)player)->playback_lock); + MMPLAYER_CMD_LOCK(player); + MMPLAYER_CMD_UNLOCK(player); + + MMPLAYER_CMD_LOCK_DEINIT(player); + g_mutex_clear(&((mmplayer_t *)player)->reconfigure_lock); + g_cond_clear(&((mmplayer_t *)player)->reconfigure_cond); - memset((mm_player_t*)player, 0x00, sizeof(mm_player_t)); + memset((mmplayer_t *)player, 0x00, sizeof(mmplayer_t)); /* free player */ - g_free((void*)player); + g_free((void *)player); return result; } @@ -145,8 +149,9 @@ int mm_player_abort_pause(MMHandleType player) MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); + _mmplayer_bus_watcher_remove(player); /* destroy the gst bus msg thread not to be blocked in pause(without cmd lock). */ - __mmplayer_bus_msg_thread_destroy(player); + _mmplayer_bus_msg_thread_destroy(player); /* abort the pause operation for preparing(without cmd lock). */ result = _mmplayer_abort_pause(player); @@ -184,18 +189,7 @@ int mm_player_set_message_callback(MMHandleType player, MMMessageCallback callba return result; } -int mm_player_set_pd_message_callback(MMHandleType player, MMMessageCallback callback, void *user_param) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - result = _mm_player_set_pd_downloader_message_cb(player, callback, user_param); - - return result; -} - -int mm_player_set_audio_stream_callback_ex(MMHandleType player, bool sync, mm_player_audio_stream_callback_ex callback, void *user_param) +int mm_player_set_audio_decoded_callback(MMHandleType player, mmplayer_audio_extract_opt_e opt, mm_player_audio_decoded_callback callback, void *user_param) { int result = MM_ERROR_NONE; @@ -203,14 +197,14 @@ int mm_player_set_audio_stream_callback_ex(MMHandleType player, bool sync, mm_pl MMPLAYER_CMD_LOCK(player); - result = _mmplayer_set_audiostream_cb_ex(player, sync, callback, user_param); + result = _mmplayer_set_audio_decoded_cb(player, opt, callback, user_param); MMPLAYER_CMD_UNLOCK(player); return result; } -int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_stream_callback callback, void *user_param) +int mm_player_set_video_decoded_callback(MMHandleType player, mm_player_video_decoded_callback callback, void *user_param) { int result = MM_ERROR_NONE; @@ -218,7 +212,7 @@ int mm_player_set_video_stream_callback(MMHandleType player, mm_player_video_str MMPLAYER_CMD_LOCK(player); - result = _mmplayer_set_videostream_cb(player, callback, user_param); + result = _mmplayer_set_video_decoded_cb(player, callback, user_param); MMPLAYER_CMD_UNLOCK(player); @@ -240,23 +234,22 @@ int mm_player_do_video_capture(MMHandleType player) return result; } -int mm_player_set_volume(MMHandleType player, MMPlayerVolumeType *volume) +int mm_player_set_volume(MMHandleType player, float volume) { int result = MM_ERROR_NONE; MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - MMPLAYER_RETURN_VAL_IF_FAIL(volume, MM_ERROR_INVALID_ARGUMENT); MMPLAYER_CMD_LOCK(player); - result = _mmplayer_set_volume(player, *volume); + result = _mmplayer_set_volume(player, volume); MMPLAYER_CMD_UNLOCK(player); return result; } -int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume) +int mm_player_get_volume(MMHandleType player, float *volume) { int result = MM_ERROR_NONE; @@ -272,7 +265,7 @@ int mm_player_get_volume(MMHandleType player, MMPlayerVolumeType *volume) return result; } -int mm_player_set_mute(MMHandleType player, int mute) +int mm_player_set_mute(MMHandleType player, bool mute) { int result = MM_ERROR_NONE; @@ -287,7 +280,7 @@ int mm_player_set_mute(MMHandleType player, int mute) return result; } -int mm_player_get_mute(MMHandleType player, int *mute) +int mm_player_get_mute(MMHandleType player, bool *mute) { int result = MM_ERROR_NONE; @@ -303,7 +296,7 @@ int mm_player_get_mute(MMHandleType player, int *mute) return result; } -int mm_player_get_state(MMHandleType player, MMPlayerStateType *state) +int mm_player_get_state(MMHandleType player, mmplayer_state_e *state) { int result = MM_ERROR_NONE; @@ -312,13 +305,13 @@ int mm_player_get_state(MMHandleType player, MMPlayerStateType *state) *state = MM_PLAYER_STATE_NULL; - result = _mmplayer_get_state(player, (int*)state); + result = _mmplayer_get_state(player, (int *)state); return result; } /* NOTE : It does not support some use cases, eg using colorspace converter */ -int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, void *display_overlay) +int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display_surface_type, int wl_surface_id) { int result = MM_ERROR_NONE; @@ -326,7 +319,7 @@ int mm_player_change_videosink(MMHandleType player, MMDisplaySurfaceType display MMPLAYER_CMD_LOCK(player); - result = _mmplayer_change_videosink(player, display_surface_type, display_overlay); + result = _mmplayer_change_videosink(player, display_surface_type, wl_surface_id); MMPLAYER_CMD_UNLOCK(player); @@ -432,7 +425,7 @@ int mm_player_get_position(MMHandleType player, int64_t *pos) MMPLAYER_CMD_LOCK(player); - result = _mmplayer_get_position(player, pos); + result = _mmplayer_gst_get_position((mmplayer_t *)player, pos); MMPLAYER_CMD_UNLOCK(player); @@ -456,23 +449,23 @@ int mm_player_get_duration(MMHandleType player, int64_t *dur) } -int mm_player_get_buffer_position(MMHandleType player, MMPlayerPosFormatType format, unsigned long *start_pos, unsigned long *stop_pos) +int mm_player_get_buffer_position(MMHandleType player, int *start_pos, int *end_pos) { int result = MM_ERROR_NONE; MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - MMPLAYER_RETURN_VAL_IF_FAIL(start_pos && stop_pos, MM_ERROR_COMMON_INVALID_ARGUMENT); + MMPLAYER_RETURN_VAL_IF_FAIL(start_pos && end_pos, MM_ERROR_COMMON_INVALID_ARGUMENT); MMPLAYER_CMD_LOCK(player); - result = _mmplayer_get_buffer_position(player, (int)format, start_pos, stop_pos); + result = _mmplayer_get_buffer_position(player, start_pos, end_pos); MMPLAYER_CMD_UNLOCK(player); return result; } -int mm_player_set_external_subtitle_path(MMHandleType player, const char* path) +int mm_player_set_external_subtitle_path(MMHandleType player, const char *path) { int result = MM_ERROR_NONE; @@ -486,20 +479,15 @@ int mm_player_set_external_subtitle_path(MMHandleType player, const char* path) return result; } -int mm_player_adjust_subtitle_position(MMHandleType player, MMPlayerPosFormatType format, int pos) +int mm_player_adjust_subtitle_position(MMHandleType player, int pos) { int result = MM_ERROR_NONE; MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - if (format >= MM_PLAYER_POS_FORMAT_NUM) { - LOGE("wrong format(%d) \n", format); - return MM_ERROR_INVALID_ARGUMENT; - } - MMPLAYER_CMD_LOCK(player); - result = _mmplayer_adjust_subtitle_postion(player, format, pos); + result = _mmplayer_adjust_subtitle_position(player, pos); MMPLAYER_CMD_UNLOCK(player); @@ -521,7 +509,7 @@ int mm_player_set_subtitle_silent(MMHandleType player, int silent) return result; } -int mm_player_get_subtitle_silent(MMHandleType player, int* silent) +int mm_player_get_subtitle_silent(MMHandleType player, int *silent) { int result = MM_ERROR_NONE; @@ -566,7 +554,7 @@ int mm_player_get_attribute(MMHandleType player, char **err_attr_name, const ch return result; } -int mm_player_get_attribute_info(MMHandleType player, const char *attribute_name, MMPlayerAttrsInfo *info) +int mm_player_get_attribute_info(MMHandleType player, const char *attribute_name, mmplayer_attrs_info_t *info) { int result = MM_ERROR_NONE; @@ -580,20 +568,7 @@ int mm_player_get_attribute_info(MMHandleType player, const char *attribute_nam return result; } -int mm_player_get_pd_status(MMHandleType player, guint64 *current_pos, guint64 *total_size) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - MMPLAYER_RETURN_VAL_IF_FAIL(current_pos, MM_ERROR_COMMON_INVALID_ARGUMENT); - MMPLAYER_RETURN_VAL_IF_FAIL(total_size, MM_ERROR_COMMON_INVALID_ARGUMENT); - - result = _mmplayer_get_pd_downloader_status(player, current_pos, total_size); - - return result; -} - -int mm_player_get_track_count(MMHandleType player, MMPlayerTrackType type, int *count) +int mm_player_get_track_count(MMHandleType player, mmplayer_track_type_e type, int *count) { int result = MM_ERROR_NONE; @@ -609,7 +584,7 @@ int mm_player_get_track_count(MMHandleType player, MMPlayerTrackType type, int * return result; } -int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index) +int mm_player_select_track(MMHandleType player, mmplayer_track_type_e type, int index) { int result = MM_ERROR_NONE; @@ -623,39 +598,8 @@ int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int inde return result; } -#ifdef _MULTI_TRACK -int mm_player_track_add_subtitle_language(MMHandleType player, int index) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_track_add_subtitle_language(player, index); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} -int mm_player_track_remove_subtitle_language(MMHandleType player, int index) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_track_remove_subtitle_language(player, index); - - MMPLAYER_CMD_UNLOCK(player); - - return result; - -} -#endif -int mm_player_get_current_track(MMHandleType player, MMPlayerTrackType type, int *index) +int mm_player_get_current_track(MMHandleType player, mmplayer_track_type_e type, int *index) { int result = MM_ERROR_NONE; @@ -671,7 +615,7 @@ int mm_player_get_current_track(MMHandleType player, MMPlayerTrackType type, int return result; } -int mm_player_get_track_language_code(MMHandleType player, MMPlayerTrackType type, int index, char **code) +int mm_player_get_track_language_code(MMHandleType player, mmplayer_track_type_e type, int index, char **code) { int result = MM_ERROR_NONE; @@ -686,70 +630,6 @@ int mm_player_get_track_language_code(MMHandleType player, MMPlayerTrackType ty return result; } -int mm_player_set_video_share_master_clock(MMHandleType player, int64_t clock, int64_t clock_delta, - int64_t video_time, int64_t media_clock, int64_t audio_time) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_set_video_share_master_clock(player, clock, clock_delta, video_time, media_clock, audio_time); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - -int mm_player_get_video_share_master_clock(MMHandleType player, int64_t *video_time, int64_t *media_clock, int64_t *audio_time) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - MMPLAYER_RETURN_VAL_IF_FAIL(video_time, MM_ERROR_COMMON_INVALID_ARGUMENT); - MMPLAYER_RETURN_VAL_IF_FAIL(media_clock, MM_ERROR_COMMON_INVALID_ARGUMENT); - MMPLAYER_RETURN_VAL_IF_FAIL(audio_time, MM_ERROR_COMMON_INVALID_ARGUMENT); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_get_video_share_master_clock(player, video_time, media_clock, audio_time); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - -int mm_player_set_video_hub_download_mode(MMHandleType player, bool mode) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_set_video_hub_download_mode(player, mode); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - -int mm_player_enable_sync_handler(MMHandleType player, bool enable) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_enable_sync_handler(player, enable); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - int mm_player_set_uri(MMHandleType player, const char *uri) { int result = MM_ERROR_NONE; @@ -797,22 +677,6 @@ int mm_player_get_next_uri(MMHandleType player, char **uri) return result; } -#ifdef _MULTI_TRACK -int mm_player_track_foreach_selected_subtitle_language(MMHandleType player, mm_player_track_selected_subtitle_language_callback callback, void *user_param) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_track_foreach_selected_subtitle_language(player, callback, user_param); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} -#endif int mm_player_has_closed_caption(MMHandleType player, bool *exist) { @@ -887,7 +751,7 @@ int mm_player_set_audio_info(MMHandleType player, media_format_h format) return result; } -int mm_player_set_subtitle_info(MMHandleType player, MMPlayerSubtitleStreamInfo *subtitle_stream_info) +int mm_player_set_subtitle_info(MMHandleType player, mmplayer_subtitle_stream_info_t *subtitle_stream_info) { int result = MM_ERROR_NONE; @@ -904,7 +768,7 @@ int mm_player_set_subtitle_info(MMHandleType player, MMPlayerSubtitleStreamInfo return result; } -int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long max_size) +int mm_player_set_media_stream_buffer_max_size(MMHandleType player, mmplayer_stream_type_e type, unsigned long long max_size) { int result = MM_ERROR_NONE; @@ -921,7 +785,7 @@ int mm_player_set_media_stream_buffer_max_size(MMHandleType player, MMPlayerStre return result; } -int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStreamType type, unsigned long long *max_size) +int mm_player_get_media_stream_buffer_max_size(MMHandleType player, mmplayer_stream_type_e type, unsigned long long *max_size) { int result = MM_ERROR_NONE; guint64 _max_size = 0; @@ -941,7 +805,7 @@ int mm_player_get_media_stream_buffer_max_size(MMHandleType player, MMPlayerStre return result; } -int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned min_percent) +int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, mmplayer_stream_type_e type, unsigned min_percent) { int result = MM_ERROR_NONE; @@ -958,7 +822,7 @@ int mm_player_set_media_stream_buffer_min_percent(MMHandleType player, MMPlayerS return result; } -int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerStreamType type, unsigned int *min_percent) +int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, mmplayer_stream_type_e type, unsigned int *min_percent) { int result = MM_ERROR_NONE; @@ -976,40 +840,6 @@ int mm_player_get_media_stream_buffer_min_percent(MMHandleType player, MMPlayerS return result; } -int mm_player_set_media_stream_buffer_status_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_buffer_status_callback callback, void * user_param) -{ - int result = MM_ERROR_NONE; - - LOGD("\n"); - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_set_media_stream_buffer_status_cb(player, type, callback, user_param); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - -int mm_player_set_media_stream_seek_data_callback(MMHandleType player, MMPlayerStreamType type, mm_player_media_stream_seek_data_callback callback, void * user_param) -{ - int result = MM_ERROR_NONE; - - LOGD("\n"); - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_set_media_stream_seek_data_cb(player, type, callback, user_param); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param) { int result = MM_ERROR_NONE; @@ -1025,21 +855,6 @@ int mm_player_set_audio_stream_changed_callback(MMHandleType player, mm_player_s return result; } -int mm_player_set_video_stream_changed_callback(MMHandleType player, mm_player_stream_changed_callback callback, void *user_param) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_set_videostream_changed_cb(player, callback, user_param); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - int mm_player_get_timeout(MMHandleType player, int *timeout) { int result = MM_ERROR_NONE; @@ -1056,22 +871,6 @@ int mm_player_get_timeout(MMHandleType player, int *timeout) return result; } -int mm_player_get_num_of_video_out_buffers(MMHandleType player, int *num, int *extra_num) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - MMPLAYER_RETURN_VAL_IF_FAIL(num && extra_num, MM_ERROR_COMMON_INVALID_ARGUMENT); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_get_num_of_video_out_buffers(player, num, extra_num); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc) { int result = MM_ERROR_NONE; @@ -1087,7 +886,7 @@ int mm_player_set_media_stream_dynamic_resolution(MMHandleType player, bool drc) return result; } -int mm_player_release_video_stream_bo(MMHandleType player, void* bo) +int mm_player_release_video_stream_bo(MMHandleType player, void *bo) { int result = MM_ERROR_NONE; @@ -1103,21 +902,6 @@ int mm_player_release_video_stream_bo(MMHandleType player, void* bo) return result; } -int mm_player_set_file_buffering_path(MMHandleType player, const char *file_path) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_set_file_buffering_path(player, file_path); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - int mm_player_set_sound_stream_info(MMHandleType player, char *stream_type, int stream_index) { int result = MM_ERROR_NONE; @@ -1196,30 +980,16 @@ int mm_player_get_max_adaptive_variant_limit(MMHandleType player, int *bandwidth return result; } -int mm_player_set_streaming_buffering_time(MMHandleType player, int buffer_ms, int rebuffer_ms) -{ - int result = MM_ERROR_NONE; - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_set_streaming_buffering_time(player, buffer_ms, rebuffer_ms); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - -int mm_player_get_streaming_buffering_time(MMHandleType player, int *buffer_ms, int *rebuffer_ms) +int mm_player_get_streaming_buffering_time(MMHandleType player, int *prebuffer_ms, int *rebuffer_ms) { int result = MM_ERROR_NONE; MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - MMPLAYER_RETURN_VAL_IF_FAIL(buffer_ms && rebuffer_ms, MM_ERROR_INVALID_ARGUMENT); + MMPLAYER_RETURN_VAL_IF_FAIL(prebuffer_ms && rebuffer_ms, MM_ERROR_INVALID_ARGUMENT); MMPLAYER_CMD_LOCK(player); - result = _mmplayer_get_streaming_buffering_time(player, buffer_ms, rebuffer_ms); + result = _mmplayer_get_streaming_buffering_time(player, prebuffer_ms, rebuffer_ms); MMPLAYER_CMD_UNLOCK(player); @@ -1240,22 +1010,6 @@ int mm_player_set_audio_only(MMHandleType player, bool audio_only) return result; } -int mm_player_get_audio_only(MMHandleType player, bool *audio_only) -{ - int result = MM_ERROR_NONE; - - MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); - MMPLAYER_RETURN_VAL_IF_FAIL(audio_only, MM_ERROR_INVALID_ARGUMENT); - - MMPLAYER_CMD_LOCK(player); - - result = _mmplayer_get_audio_only(player, audio_only); - - MMPLAYER_CMD_UNLOCK(player); - - return result; -} - int mm_player_360_is_content_spherical(MMHandleType player, bool *is_spherical) { int result = MM_ERROR_NONE; @@ -1392,7 +1146,7 @@ int mm_player_360_get_field_of_view(MMHandleType player, int *horizontal_degrees return result; } -int mm_player_set_codec_type(MMHandleType player, MMPlayerStreamType stream_type, MMPlayerVideoCodecType codec_type) +int mm_player_set_codec_type(MMHandleType player, mmplayer_stream_type_e stream_type, mmplayer_codec_type_e codec_type) { int result = MM_ERROR_NONE; @@ -1467,3 +1221,48 @@ int mm_player_get_video_roi_area(MMHandleType player, double *scale_x, double *s return result; } + +int mm_player_set_client_pid(MMHandleType player, int pid) +{ + int result = MM_ERROR_NONE; + + MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); + + MMPLAYER_CMD_LOCK(player); + + result = _mmplayer_set_client_pid(player, pid); + + MMPLAYER_CMD_UNLOCK(player); + + return result; +} + +int mm_player_audio_offload_is_activated(MMHandleType player, bool *activated) +{ + int result = MM_ERROR_NONE; + + MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); + MMPLAYER_RETURN_VAL_IF_FAIL(activated, MM_ERROR_INVALID_ARGUMENT); + + MMPLAYER_CMD_LOCK(player); + + result = _mmplayer_audio_offload_is_activated(player, activated); + + MMPLAYER_CMD_UNLOCK(player); + + return result; +} + +int mm_player_is_audio_control_available(MMHandleType player, mmplayer_audio_control_opt_e opt, bool *available) +{ + int result = MM_ERROR_NONE; + + MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED); + MMPLAYER_RETURN_VAL_IF_FAIL(available, MM_ERROR_INVALID_ARGUMENT); + + MMPLAYER_CMD_LOCK(player); + result = _mmplayer_is_audio_control_available(player, opt, available); + MMPLAYER_CMD_UNLOCK(player); + + return result; +}