add handling about resource limit error and apply mused temp file path for file buffering 74/76574/5
authorEunhae Choi <eunhae1.choi@samsung.com>
Fri, 24 Jun 2016 08:45:12 +0000 (17:45 +0900)
committerEunhae Choi <eunhae1.choi@samsung.com>
Thu, 30 Jun 2016 09:04:00 +0000 (18:04 +0900)
Change-Id: I5e7b4501c23bdf7b82e6b733a1076240e4a3418f

legacy/include/legacy_player_private.h
legacy/src/legacy_player.c
muse/src/muse_player.c
muse/src/muse_player_dispatcher.c
packaging/mmsvc-player.spec

index 02ec168..a143e69 100644 (file)
@@ -114,7 +114,7 @@ int legacy_player_set_audio_policy_info_for_mused(player_h player, char *stream_
 int legacy_player_sound_register(player_h player, int pid);
 int legacy_player_get_timeout_for_muse(player_h player, int *timeout);
 int legacy_player_get_num_of_video_out_buffers(player_h player, int *num, int *extra_num);
-
+int legacy_player_set_file_buffering_path(player_h player, const char *file_path);
 
 #ifdef __cplusplus
 }
index 926b120..2ed74d7 100644 (file)
@@ -2615,8 +2615,10 @@ int legacy_player_unset_media_packet_video_frame_decoded_cb(player_h player)
 {
        PLAYER_INSTANCE_CHECK(player);
        player_s *handle = (player_s *)player;
+
        handle->user_cb[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = NULL;
        handle->user_data[MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME] = NULL;
+
        LOGI("Event type : %d ", MUSE_PLAYER_EVENT_TYPE_MEDIA_PACKET_VIDEO_FRAME);
 
        int ret = mm_player_set_video_stream_callback(handle->mm_handle, NULL, NULL);
@@ -3262,3 +3264,18 @@ int legacy_player_get_num_of_video_out_buffers(player_h player, int *num, int *e
 
        return PLAYER_ERROR_NONE;
 }
+
+int legacy_player_set_file_buffering_path(player_h player, const char *file_path)
+{
+       PLAYER_INSTANCE_CHECK(player);
+       PLAYER_NULL_ARG_CHECK(file_path);
+       player_s *handle = (player_s *)player;
+       PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+
+       int ret = mm_player_set_file_buffering_path(handle->mm_handle, file_path);
+
+       if (ret != MM_ERROR_NONE)
+               return __player_convert_error_code(ret, (char *)__FUNCTION__);
+       else
+               return PLAYER_ERROR_NONE;
+}
index 0919f8f..807e7f7 100644 (file)
@@ -962,11 +962,16 @@ int player_disp_set_uri(muse_module_h module)
 
        muse_player = (muse_player_handle_s *)muse_core_ipc_get_handle(module);
        player_msg_get_string(uri, muse_core_client_get_msg(module));
-
        ret = legacy_player_set_uri(muse_player->player_handle, uri);
 
        player_msg_return(api, ret, module);
 
+       const char* file_buffering_path = muse_core_client_get_temporal_path();
+
+       LOGD("file buffering path : %s", file_buffering_path);
+       if (file_buffering_path)
+               legacy_player_set_file_buffering_path(muse_player->player_handle, file_buffering_path);
+
        return ret;
 }
 
index cbf5701..5617e66 100644 (file)
@@ -20,6 +20,7 @@
 #include "muse_player.h"
 #include "muse_player_api.h" /* generated during build, ref ../make_api.py */
 #include "muse_player_private.h"
+#include "muse_player_msg.h"
 #include "legacy_player.h"
 
 static int player_cmd_shutdown(muse_module_h module)
@@ -61,10 +62,23 @@ static int player_cmd_shutdown(muse_module_h module)
        return PLAYER_ERROR_NONE;
 }
 
+static int player_cmd_resouce_not_available(muse_module_h module)
+{
+       int ret = PLAYER_ERROR_RESOURCE_LIMIT;
+       muse_player_api_e api = MUSE_PLAYER_API_CREATE;
+       LOGD("return PLAYER_ERROR_RESOURCE_LIMIT");
+
+       player_msg_return(api, ret, module);
+
+       return PLAYER_ERROR_NONE;
+}
+
 int (*cmd_dispatcher[MUSE_MODULE_COMMAND_MAX])(muse_module_h module) = {
        NULL,   /* MUSE_MODULE_COMMAND_INITIALIZE */
        player_cmd_shutdown,    /* MUSE_MODULE_COMMAND_SHUTDOWN */
        NULL,   /* MUSE_MODULE_COMMAND_DEBUG_INFO_DUMP */
+       NULL,   /* MUSE_MODULE_COMMAND_CREATE_SERVER_ACK */
+       player_cmd_resouce_not_available,       /* MUSE_MODULE_COMMAND_RESOURCE_NOT_AVAILABLE */
 };
 
 /**
index 04ef79d..7aa923a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       mmsvc-player
 Summary:    A Media Player module for muse server
-Version:    0.2.16
+Version:    0.2.17
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0