#define PLAYER_TRACE_ASYNC_END(NAME, KEY)
#endif
-#define PLAYER_NETWORK_AVAILABLE_CHECK() \
-do \
-{ \
- bool enabled = FALSE; \
- bool supported = FALSE; \
- if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool("http://tizen.org/feature/network.wifi", &enabled)) \
- { \
- LOGI("[%s] wifi status = %d", __FUNCTION__, enabled); \
- if (enabled) supported = TRUE; \
- } \
- else \
- { \
- LOGE("[%s] SYSTEM_INFO_ERROR", __FUNCTION__); \
- } \
- if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool("http://tizen.org/feature/network.telephony", &enabled)) \
- { \
- LOGI("[%s] telephony status = %d", __FUNCTION__, enabled); \
- if (enabled) supported = TRUE; \
- } \
- else \
- { \
- LOGE("[%s] SYSTEM_INFO_ERROR", __FUNCTION__); \
- } \
- if (!supported) \
- { \
- LOGE("[%s] PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE", __FUNCTION__); \
- return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE; \
- } \
-} while (0)
-
typedef enum {
_PLAYER_EVENT_TYPE_PREPARE,
_PLAYER_EVENT_TYPE_COMPLETE,
return MEDIA_PACKET_FINALIZE;
}
+static bool _player_network_availability_check()
+{
+ #define _FEATURE_NAME_WIFI "http://tizen.org/feature/network.wifi"
+ #define _FEATURE_NAME_TELEPHONY "http://tizen.org/feature/network.telephony"
+ #define _FEATURE_NAME_ETHERNET "http://tizen.org/feature/network.ethernet"
+ bool enabled = FALSE;
+ bool supported = FALSE;
+
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_WIFI, &enabled))
+ {
+ LOGI("wifi status = %d", enabled);
+ if (enabled) supported = TRUE;
+ }
+ else
+ {
+ LOGE("SYSTEM_INFO_ERROR");
+ }
+
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_TELEPHONY, &enabled))
+ {
+ LOGI("telephony status = %d", enabled);
+ if (enabled) supported = TRUE;
+ }
+ else
+ {
+ LOGE("SYSTEM_INFO_ERROR");
+ }
+
+ if (SYSTEM_INFO_ERROR_NONE == system_info_get_platform_bool(_FEATURE_NAME_ETHERNET, &enabled))
+ {
+ LOGI("ethernet status = %d", enabled);
+ if (enabled) supported = TRUE;
+ }
+ else
+ {
+ LOGE("SYSTEM_INFO_ERROR");
+ }
+
+ if (!supported) return FALSE;
+
+ return TRUE;
+}
+
static player_interrupted_code_e __convert_interrupted_code(int code)
{
player_interrupted_code_e ret = PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT;
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
- player_s * handle = (player_s *) player;
if (_PLAYER_EVENT_TYPE_BUFFERING == type)
- PLAYER_NETWORK_AVAILABLE_CHECK();
+ {
+ if (!_player_network_availability_check())
+ return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
+ }
+
+ player_s * handle = (player_s *) player;
handle->user_cb[type] = callback;
handle->user_data[type] = user_data;
LOGI("[%s] Event type : %d ",__FUNCTION__, type);
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(path);
- PLAYER_NETWORK_AVAILABLE_CHECK();
+ if (!_player_network_availability_check())
+ return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
+
player_s * handle = (player_s *) player;
PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE);
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(callback);
- PLAYER_NETWORK_AVAILABLE_CHECK();
+ if (!_player_network_availability_check())
+ return PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE;
player_s * handle = (player_s *) player;
+
if (handle->state != PLAYER_STATE_IDLE && handle->state != PLAYER_STATE_READY)
{
LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);