#define PLAYER_NULL_ARG_CHECK(arg) \
PLAYER_CHECK_CONDITION(arg != NULL,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER")
-#define CALLBACK_TIME_OUT 30 /* FIXME: need to consider the type of playback */
+#define CALLBACK_TIME_OUT 5
+#define MAX_SERVER_TIME_OUT 35
typedef struct _ret_msg_s{
gint api;
typedef struct {
intptr_t bo;
- gboolean is_streaming;
gint timeout;
} server_info_s; // to check
/* server tbm bo */
#define SERVER_TBM_BO(h) ((h)->server.bo)
-/* content type is streaming */
-#define IS_STREAMING_CONTENT(h) ((h)->server.is_streaming)
/* server state change timeout */
#define SERVER_TIMEOUT(h) ((h)->server.timeout)
-int _get_api_timeout(player_cli_s *pc, muse_player_api_e api);
-int wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out);
int player_set_evas_object_cb(player_h player, Evas_Object * eo);
int player_unset_evas_object_cb(player_h player);
+int client_get_api_timeout(player_cli_s *pc, muse_player_api_e api);
+int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out);
#ifdef __cplusplus
}
g_free(cb_info);
}
-int _get_api_timeout(player_cli_s *pc, muse_player_api_e api)
+int client_get_api_timeout(player_cli_s *pc, muse_player_api_e api)
{
int timeout = 0;
return timeout;
}
-int wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out)
+int client_wait_for_cb_return(muse_player_api_e api, callback_cb_info_s *cb_info, char **ret_buf, int time_out)
{
int ret = PLAYER_ERROR_NONE;
gint64 end_time = g_get_monotonic_time() + time_out * G_TIME_SPAN_SECOND;
goto ErrorExit;
}
- ret = wait_for_cb_return(api, pc->cb_info, &ret_buf, CALLBACK_TIME_OUT);
+ ret = client_wait_for_cb_return(api, pc->cb_info, &ret_buf, CALLBACK_TIME_OUT);
if (ret == PLAYER_ERROR_NONE) {
intptr_t module_addr;
*player = (player_h)pc;
muse_core_send_client_addr(module_addr, pc->cb_info->data_fd);
LOGD("Data channel fd %d, muse module addr %p", pc->cb_info->data_fd, module_addr);
}
+ SERVER_TIMEOUT(pc) = MAX_SERVER_TIME_OUT; /* will be update after prepare phase. */
} else
goto ErrorExit;
pc->cb_info->user_data[MUSE_PLAYER_EVENT_TYPE_PREPARE] = user_data;
}
player_msg_send(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ int timeout = 0;
+ player_msg_get_type(timeout, ret_buf, INT);
+
+ LOGD("server timeout will be %d", timeout);
+ SERVER_TIMEOUT(pc) = timeout;
+ }
+
g_free(ret_buf);
return ret;
}
LOGD("ENTER");
player_msg_send(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ int timeout = 0;
+ player_msg_get_type(timeout, ret_buf, INT);
+
+ LOGD("server timeout will be %d", timeout);
+ SERVER_TIMEOUT(pc) = timeout;
+ }
+
g_free(ret_buf);
return ret;
}