Name: libmm-player
Summary: Multimedia Framework Player Library
-Version: 0.6.152
+Version: 0.6.153
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0
* code.
*/
int mm_player_select_track(MMHandleType player, MMPlayerTrackType type, int index);
-#ifdef _MULTI_TRACK
-/**
- * This function is to add the track when user want multi subtitle
- *
- * @param player [in] handle of player.
- * @param index [in] the index of the track
- *
- * @return This function returns zero on success, or negative value with error
- * code.
- */
-int mm_player_track_add_subtitle_language(MMHandleType player, int index);
-
-/**
- * This function is to remove the track when user want multi subtitle
- *
- * @param player [in] handle of player.
- * @param index [in] the index of the track
- *
- * @return This function returns zero on success, or negative value with error
- * code.
- */
-int mm_player_track_remove_subtitle_language(MMHandleType player, int index);
/**
- * This function is to notify which sutitle track is in use
- *
- * @param player [in] handle of player.
- * @param callback [in] callback function to register
- * @param user_data [in] user data to be passed to the callback function
- *
- * @return This function returns zero on success, or negative value with error
- * code.
- */
-int mm_player_track_foreach_selected_subtitle_language(MMHandleType player, mm_player_track_selected_subtitle_language_callback callback, void *user_param);
-#endif
-/**
* This function is to get the track language
*
* @param player [in] handle of player.
#endif
#define DEFAULT_TRACK 0
-#ifdef _MULTI_TRACK
-typedef bool (*_mmplayer_track_selected_subtitle_language_cb)(int track_num, void *user_data);
-#endif
+
void __mmplayer_track_initialize(mm_player_t *player);
void __mmplayer_track_destroy(mm_player_t *player);
int _mmplayer_get_track_count(MMHandleType hplayer, MMPlayerTrackType type, int *count);
int _mmplayer_select_track(MMHandleType hplayer, MMPlayerTrackType type, int index);
-#ifdef _MULTI_TRACK
-int _mmplayer_track_add_subtitle_language(MMHandleType hplayer, int index);
-int _mmplayer_track_remove_subtitle_language(MMHandleType hplayer, int index);
-#endif
int _mmplayer_get_track_language_code(MMHandleType hplayer, MMPlayerTrackType type, int index, char **code);
int _mmplayer_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index);
-#ifdef _MULTI_TRACK
-int _mmplayer_track_foreach_selected_subtitle_language(MMHandleType hplayer, _mmplayer_track_selected_subtitle_language_cb callback, void *user_data);
-#endif
#ifdef __cplusplus
}
#endif
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 result = MM_ERROR_NONE;
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)
{
}
/* Note : Textbin is not linked to the video or audio bin.
- * It needs to send the event to the text sink seperatelly.
- */
- if (player->play_subtitle && player->pipeline) {
+ * It needs to send the event to the text sink seperatelly.
+ */
+ if (player->play_subtitle && player->pipeline) {
GstElement *text_sink = GST_ELEMENT_CAST(player->pipeline->textbin[MMPLAYER_T_FAKE_SINK].gst);
if (GST_IS_ELEMENT(text_sink)) {
gst_event_ref(event2);
if ((res = gst_element_send_event(text_sink, event2)))
- LOGD("sending event[%s] to subtitle sink element [%s] success!\n",
- GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink));
+ LOGD("sending event[%s] to subtitle sink element [%s] success!",
+ GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink));
else
- LOGE("sending event[%s] to subtitle sink element [%s] failed!\n",
- GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink));
+ LOGE("sending event[%s] to subtitle sink element [%s] failed!",
+ GST_EVENT_TYPE_NAME(event2), GST_ELEMENT_NAME(text_sink));
gst_event_unref(event2);
}
- }
+ }
gst_event_unref(event);
player->textsink_linked = 1;
player->external_text_idx = 0;
- LOGI("player->textsink_linked set to 1\n");
+ LOGI("textsink is linked");
} else {
textbin = player->pipeline->textbin;
LOGD("text bin has been created. reuse it.");
goto ERROR;
}
}
-
gst_element_set_base_time(textbin[MMPLAYER_T_BIN].gst, base_time);
gst_element_set_start_time(textbin[MMPLAYER_T_BIN].gst, start_time);
return ret;
}
-#ifdef _MULTI_TRACK
-int _mmplayer_track_add_subtitle_language(MMHandleType hplayer, int index)
-{
- int ret = MM_ERROR_NONE;
- mm_player_t* player = (mm_player_t*) hplayer;
- MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- MMPLAYER_FENTER();
-
- MMPLAYER_SUBTITLE_INFO_LOCK(player);
- if (!player->pipeline || !player->pipeline->mainbin[MMPLAYER_M_T_SUBMUX_EXTERNAL].gst) {
- ret = MM_ERROR_PLAYER_NOT_INITIALIZED;
- goto EXIT;
- }
-
- if (player->subtitle_language_list) {
- GstElement *subparse = NULL;
- MMPlayerLangStruct *temp = NULL;
-
- temp = g_list_nth_data(player->subtitle_language_list, index);
- if (!temp) {
- LOGE("fail to get lang from list");
- ret = MM_ERROR_PLAYER_INTERNAL;
- goto EXIT;
- }
- temp->active = TRUE;
-
- subparse = player->pipeline->mainbin[MMPLAYER_M_T_SUBMUX_EXTERNAL].gst;
- LOGD("adding to language %s", temp->language_code);
- g_object_set(G_OBJECT(subparse), "current-language", temp->language_key, NULL);
- g_object_set(G_OBJECT(subparse), "lang-list", player->subtitle_language_list, NULL);
-
- _mmplayer_sync_subtitle_pipeline(player);
- } else {
- LOGW("It is for just subtitle track");
- ret = MM_ERROR_PLAYER_NO_OP;
- goto EXIT;
- }
-
-EXIT:
- MMPLAYER_SUBTITLE_INFO_UNLOCK(player);
- MMPLAYER_FLEAVE();
- return ret;
-}
-
-int _mmplayer_track_remove_subtitle_language(MMHandleType hplayer, int index)
-{
- int ret = MM_ERROR_NONE;
- mm_player_t* player = (mm_player_t*) hplayer;
- MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- MMPLAYER_FENTER();
-
- MMPLAYER_SUBTITLE_INFO_LOCK(player);
- if (!player->pipeline || !player->pipeline->mainbin[MMPLAYER_M_T_SUBMUX_EXTERNAL].gst) {
- ret = MM_ERROR_PLAYER_NOT_INITIALIZED;
- goto EXIT;
- }
-
- if (player->subtitle_language_list) {
- GstElement *subparse = NULL;
- MMPlayerLangStruct *temp = NULL;
-
- temp = g_list_nth_data(player->subtitle_language_list, index);
- if (!temp) {
- LOGE("fail to get lang from list");
- ret = MM_ERROR_PLAYER_INTERNAL;
- goto EXIT;
- }
- temp->active = FALSE;
-
- subparse = player->pipeline->mainbin[MMPLAYER_M_T_SUBMUX_EXTERNAL].gst;
- LOGD("removing to language %s", temp->language_code);
- g_object_set(G_OBJECT(subparse), "current-language", temp->language_key, NULL);
- g_object_set(G_OBJECT(subparse), "lang-list", player->subtitle_language_list, NULL);
-
- _mmplayer_sync_subtitle_pipeline(player);
- } else {
- LOGW("It is for just subtitle track");
- ret = MM_ERROR_PLAYER_NO_OP;
- goto EXIT;
- }
-
-EXIT:
- MMPLAYER_SUBTITLE_INFO_UNLOCK(player);
- MMPLAYER_FLEAVE();
- return ret;
-}
-#endif
int _mmplayer_get_current_track(MMHandleType hplayer, MMPlayerTrackType type, int *index)
{
int ret = MM_ERROR_NONE;
MMPLAYER_FLEAVE();
return ret;
}
-#ifdef _MULTI_TRACK
-int _mmplayer_track_foreach_selected_subtitle_language(MMHandleType hplayer, _mmplayer_track_selected_subtitle_language_cb foreach_cb, void *user_data)
-{
- int ret = MM_ERROR_NONE;
- mm_player_t* player = (mm_player_t*) hplayer;
- MMPLAYER_RETURN_VAL_IF_FAIL(player, MM_ERROR_PLAYER_NOT_INITIALIZED);
- MMPLAYER_FENTER();
-
- int index = -1;
- MMPLAYER_SUBTITLE_INFO_LOCK(player);
-
- if (player->subtitle_language_list) {
- int total_track_count = 0;
- MMPlayerLangStruct *temp = NULL;
- MMHandleType attrs = 0;
-
- attrs = MMPLAYER_GET_ATTRS(player);
- if (!attrs) {
- LOGE("cannot get content attribute");
- ret = MM_ERROR_PLAYER_INTERNAL;
- goto EXIT;
- }
- mm_attrs_get_int_by_name(attrs, "content_text_track_num", &total_track_count);
-
- if (!total_track_count) {
- LOGW("There are no subtitle track selected.");
- ret = MM_ERROR_PLAYER_NO_OP;
- goto EXIT;
- }
-
- while (total_track_count) {
- temp = g_list_nth_data(player->subtitle_language_list, total_track_count - 1);
- if (temp) {
- LOGD("find the list");
- if (temp->active) {
- index = total_track_count - 1;
- LOGD("active subtitle track index is %d", index);
- if (!foreach_cb(index, user_data)) {
- ret = MM_ERROR_PLAYER_INTERNAL;
- goto CALLBACK_ERROR;
- }
- }
- }
- total_track_count--;
- }
-
- LOGD("we will return -1 for notifying the end to user");
-
- /* After returning all selected indexs, we will return -1 for notifying the end to user */
- if (!foreach_cb(-1, user_data)) {
- ret = MM_ERROR_PLAYER_INTERNAL;
- goto CALLBACK_ERROR;
- }
- }
-
-CALLBACK_ERROR:
- LOGE("foreach callback returned error");
-
-EXIT:
- MMPLAYER_SUBTITLE_INFO_UNLOCK(player);
- MMPLAYER_FLEAVE();
- return ret;
-
-
-}
-#endif