* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
-* limitations under the License.
+* limitations under the License.
*/
#ifndef __TIZEN_MEDIA_PLAYER_H__
PLAYER_ERROR_VIDEO_CAPTURE_FAILED = PLAYER_ERROR_CLASS | 0x07, /**< Video capture failure */
PLAYER_ERROR_DRM_EXPIRED = PLAYER_ERROR_CLASS | 0x08, /**< Expired license */
PLAYER_ERROR_DRM_NO_LICENSE = PLAYER_ERROR_CLASS | 0x09, /**< No license */
- PLAYER_ERROR_DRM_FUTURE_USE = PLAYER_ERROR_CLASS | 0x0a /**< License for future use */
+ PLAYER_ERROR_DRM_FUTURE_USE = PLAYER_ERROR_CLASS | 0x0a, /**< License for future use */
+ PLAYER_ERROR_DRM_NOT_PERMITTED = PLAYER_ERROR_CLASS | 0x0b /**< Not permitted format */
} player_error_e;
/**
/**
* @brief
* Enumerations of display type
- */
+ */
typedef enum
{
PLAYER_DISPLAY_TYPE_X11 = 0, /**< X surface display */
/**
* @brief Enumerations of x surface display aspect ratio
- */
+ */
typedef enum
{
PLAYER_DISPLAY_MODE_LETTER_BOX = 0, /**< Letter box*/
/**
* @brief Called when the buffering percentage of media playback is updated.
- * @details If the buffer is full, it will return 100%.
+ * @details If the buffer is full, it will return 100%.
* @param[in] percent The percentage of buffering completed (0~100)
* @param[in] user_data The user data passed from the callback registration function
* @see player_set_buffering_cb()
/**
* @brief Called when the video is captured.
* @remarks The color space format of the captured image is #IMAGE_UTIL_COLORSPACE_RGB888.
- * @param[in] data The captured image buffer
+ * @param[in] data The captured image buffer
* @param[in] width The width of captured image
* @param[in] height The height of captured image
* @param[in] size The size of captured image
/**
* @brief Called when the video frame is decoded.
* @remarks The color space format of the captured image is #IMAGE_UTIL_COLORSPACE_RGB888.
- * @param[in] data The decoded video frame data
+ * @param[in] data The decoded video frame data
* @param[in] width The width of video frame
* @param[in] height The height of video frame
* @param[in] size The size of video frame
/**
* @brief Called when the audio frame is decoded.
- * @param[in] data The decoded audio frame data
+ * @param[in] data The decoded audio frame data
* @param[in] size The size of audio frame
* @param[in] user_data The user data passed from the callback registration function
* @see player_set_audio_frame_decoded_cb()
/**
* @brief Creates a player handle for playing multimedia content.
* @remarks @a player must be released player_destroy() by you.
- * @remarks
+ * @remarks
* Although you can create multiple player handles at the same time,
* the player cannot guarantee proper operation because of limited resources, such as
* audio or display device.
* @details
* The most recently used media is reset and no longer associated with the player.
* Playback is no longer possible. If you want to use the player again, you will have to set the data URI and call
- * player_prepare() again.
+ * player_prepare() again.
* @param[in] player The handle to media player
* @return 0 on success, otherwise a negative error value.
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
* @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
- * @pre The player state should be #PLAYER_STATE_READY by player_prepare() or player_stop().
+ * @pre The player state should be #PLAYER_STATE_READY by player_prepare() or player_stop().
* @post The player state will be #PLAYER_STATE_IDLE.
* @see player_prepare()
*/
* @brief Sets the data source (file-path, http or rtsp URI) to use.
*
* @details
- * Associates media contents, referred to by the URI, with the player.
+ * Associates media contents, referred to by the URI, with the player.
* If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.
*
- * @remarks
+ * @remarks
* If you use http or rtsp, URI should start with "http://" or "rtsp://". The default protocol is "file://".
* If you provide an invalid URI, you won't receive an error message until you call player_start().
*
* @param[in] player The handle to media player
- * @param[in] uri Specifies the content location, such as the file path, the URI of the http or rtsp stream you want to play
+ * @param[in] uri Specifies the content location, such as the file path, the URI of the http or rtsp stream you want to play
*
* @return 0 on success, otherwise a negative error value.
* @retval #PLAYER_ERROR_NONE Successful
* Associates media content, cached in memory, with the player. Unlike the case of player_set_uri(), the media resides in memory.
* If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.
*
- * @remarks
+ * @remarks
* If you provide an invalid data, you won't receive an error message until you call player_start().
*
- *
- * @param[in] player The handle to media player
+ *
+ * @param[in] player The handle to media player
* @param[in] data The memory pointer of media data
* @param[in] size The size of media data
* @return 0 on success, otherwise a negative error value.
*
* @details
* The range of @a left and @c right is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0.
- * Setting this volume adjusts the player volume, not the system volume.
+ * Setting this volume adjusts the player volume, not the system volume.
* To change system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
*
* @param[in] player The handle to media player
/**
* @brief Gets the player's current volume factor.
*
- * @details The range of @a left and @a right is from 0 to 1.0, inclusive (1.0 = 100%). This function gets the player volume, not the system volume.
+ * @details The range of @a left and @a right is from 0 to 1.0, inclusive (1.0 = 100%). This function gets the player volume, not the system volume.
* To get the system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
*
* @param[in] player The handle to media player
* @return 0 on success, otherwise a negative error value.
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre The player state must be #PLAYER_STATE_IDLE by player_create().
* @see sound_manager_get_current_sound_type()
*/
int player_set_sound_type(player_h player, sound_type_e type);
* @brief Starts or resumes playback.
*
* @details Plays current media content, or resumes play if paused.
- *
+ *
* @param[in] player The handle to media player
* @return 0 on success, otherwise a negative error value.
* @retval #PLAYER_ERROR_NONE Successful
int player_set_position_ratio(player_h player, int percent, player_seek_completed_cb callback, void *user_data);
/**
- * @brief Gets current position in milliseconds.
+ * @brief Gets current position in milliseconds.
* @param[in] player The handle to media player
* @param[out] millisecond The current position in milliseconds
* @return 0 on success, otherwise a negative error value.
* @brief Gets the player's looping status.
*
* @details If the looping status is @c true, playback will automatically restart upon finishing. If @c false, it won't.
- *
+ *
* @param[in] player The handle to media player
* @param[out] looping The looping status: (@c true = looping, @c false = non-looping )
* @return 0 on success, otherwise a negative error value.
int player_get_display_mode(player_h player, player_display_mode_e *mode);
/**
- * @brief Sets the playback rate
+ * @brief Sets the playback rate
* @details The default value is 1.0.
* @remarks #PLAYER_ERROR_INVALID_OPERATION occured if streaming playbak.
- * @remarks No operation is performed, if @a rate is 0.
+ * @remarks No operation is performed, if @a rate is 0.
* @remarks The sound is muted, when playback rate is under 0.0 and over 2.0.
* @param[in] player The handle to media player
* @param[in] rate The playback rate (-5.0x ~ 5.0x)
* @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
* @retval #PLAYER_ERROR_INVALID_STATE Invalid player state
* @pre The player state must be #PLAYER_STATE_PLAYING by player_start().
+ * @pre The player state must be #PLAYER_STATE_READY by player_prepare() or #PLAYER_STATE_PLAYING by player_start() or #PLAYER_STATE_PAUSED by player_pause().
*/
int player_set_playback_rate(player_h player, float rate);
* @post player_buffering_cb() will be invoked
* @see player_unset_buffering_cb()
* @see player_set_uri()
- * @see player_buffering_cb()
+ * @see player_buffering_cb()
*/
int player_set_buffering_cb(player_h player, player_buffering_cb callback, void *user_data);
if(condition) {} else \
{ LOGE("[%s] %s(0x%08x)",__FUNCTION__, msg,error); return error;}; \
-
#define PLAYER_INSTANCE_CHECK(player) \
PLAYER_CHECK_CONDITION(player != NULL, PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER")
-
+
#define PLAYER_STATE_CHECK(player,expected_state) \
PLAYER_CHECK_CONDITION(player->state == expected_state,PLAYER_ERROR_INVALID_STATE,"PLAYER_ERROR_INVALID_STATE")
break;
}
LOGE("[%s] %s(0x%08x) : core fw error(0x%x)",func_name,msg, ret, code);
- return ret;
+ return ret;
}
static player_interrupted_code_e __convert_interrupted_code(int code)
ret = PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT;
break;
}
- LOGE("[%s] incoming(0x%08x) => ret(%d)",__FUNCTION__,code, ret);
+ LOGE("[%s] interrupted code(%d) => ret(%d)",__FUNCTION__,code, ret);
return ret;
}
if( handle->user_cb[_PLAYER_EVENT_TYPE_COMPLETE] )
{
((player_completed_cb)handle->user_cb[_PLAYER_EVENT_TYPE_COMPLETE])(handle->user_data[_PLAYER_EVENT_TYPE_COMPLETE]);
- }
+ }
break;
case MM_MESSAGE_BUFFERING: //0x103
if( handle->user_cb[_PLAYER_EVENT_TYPE_BUFFERING] )
if( handle->user_cb[_PLAYER_EVENT_TYPE_SUBTITLE] )
{
((player_subtitle_updated_cb)handle->user_cb[_PLAYER_EVENT_TYPE_SUBTITLE])(msg->subtitle.duration, (char*)msg->data,handle->user_data[_PLAYER_EVENT_TYPE_SUBTITLE]);
- }
+ }
break;
case MM_MESSAGE_VIDEO_NOT_CAPTURED: //0x113
LOGE("[%s] PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x)",__FUNCTION__, PLAYER_ERROR_VIDEO_CAPTURE_FAILED);
if( handle->user_cb[_PLAYER_EVENT_TYPE_ERROR] )
{
((player_error_cb)handle->user_cb[_PLAYER_EVENT_TYPE_ERROR])(PLAYER_ERROR_VIDEO_CAPTURE_FAILED,handle->user_data[_PLAYER_EVENT_TYPE_ERROR]);
- }
+ }
break;
case MM_MESSAGE_VIDEO_CAPTURED: //0x110
if( handle->user_cb[_PLAYER_EVENT_TYPE_CAPTURE] )
}
handle->user_cb[_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
handle->user_data[_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
- }
- break;
+ }
+ break;
case MM_MESSAGE_FILE_NOT_SUPPORTED: //0x10f
LOGE("[%s] PLAYER_ERROR_NOT_SUPPORTED_FILE (0x%08x) : FILE_NOT_SUPPORTED" ,__FUNCTION__, PLAYER_ERROR_NOT_SUPPORTED_FILE);
err_code = PLAYER_ERROR_NOT_SUPPORTED_FILE;
((player_video_frame_decoded_cb)handle->user_cb[_PLAYER_EVENT_TYPE_VIDEO_FRAME])((unsigned char *)stream, width, height, stream_size, handle->user_data[_PLAYER_EVENT_TYPE_VIDEO_FRAME]);
else
LOGE("[%s] Skip stream - current state : %d", __FUNCTION__,handle->state);
- }
+ }
return TRUE;
}
((player_audio_frame_decoded_cb)handle->user_cb[_PLAYER_EVENT_TYPE_AUDIO_FRAME])((unsigned char *)stream, stream_size, handle->user_data[_PLAYER_EVENT_TYPE_AUDIO_FRAME]);
else
LOGE("[%s] Skip stream - current state : %d", __FUNCTION__,handle->state);
- }
+ }
return TRUE;
}
MMTA_ACUM_ITEM_BEGIN("[CAPI] player_create", 0);
player_s * handle;
handle = (player_s*)malloc( sizeof(player_s));
- if (handle != NULL)
+ if (handle != NULL)
+ {
+ LOGE("[%s] Start, %p", __FUNCTION__, handle);
memset(handle, 0 , sizeof(player_s));
+ }
else
{
LOGE("[%s] PLAYER_ERROR_OUT_OF_MEMORY(0x%08x)" ,__FUNCTION__,PLAYER_ERROR_OUT_OF_MEMORY);
handle->display_type = MM_DISPLAY_SURFACE_NULL; // means DISPLAY_TYPE_NONE(3)
handle->is_stopped=false;
handle->is_display_visible=true;
- LOGE("[%s] End", __FUNCTION__);
+ LOGE("[%s] End, new handle : %p", __FUNCTION__, *player);
return PLAYER_ERROR_NONE;
}
}
-
int player_destroy (player_h player)
{
- LOGE("[%s] Start", __FUNCTION__);
+ LOGE("[%s] Start, handle to destroy : %p", __FUNCTION__, player);
PLAYER_INSTANCE_CHECK(player);
player_s * handle = (player_s *) player;
MMTA_ACUM_ITEM_SHOW_RESULT_TO(MMTA_SHOW_FILE);
+ MMTA_RELEASE();
+
+ if (handle->prepare_async_thread)
+ {
+ pthread_join(handle->prepare_async_thread, NULL);
+ handle->prepare_async_thread = 0;
+ }
if (mm_player_destroy(handle->mm_handle)!= MM_ERROR_NONE)
{
}
}
-int player_prepare_async (player_h player, player_prepared_cb callback, void* user_data)
+static void *
+__prepare_async_thread_func(void *data)
+{
+ player_s *handle = data;
+ int ret = MM_ERROR_NONE;
+ LOGE("[%s] Start", __FUNCTION__);
+
+ ret = mm_player_pause(handle->mm_handle);
+ if(ret != MM_ERROR_NONE) // MM_MESSAGE_ERROR should be posted through __msg_callback
+ {
+ LOGE("[%s] Failed to pause - core fw error(0x%x)", __FUNCTION__, ret);
+ }
+ LOGE("[%s] End", __FUNCTION__);
+ return NULL;
+}
+
+int player_prepare_async (player_h player, player_prepared_cb callback, void* user_data)
{
LOGE("[%s] Start", __FUNCTION__);
PLAYER_INSTANCE_CHECK(player);
{
LOGE("[%s] Failed to set profile_async_start '1' (0x%x)" ,__FUNCTION__, ret);
}
+
ret = mm_player_realize(handle->mm_handle);
if(ret != MM_ERROR_NONE)
{
+ LOGE("[%s] Failed to realize - 0x%x", __FUNCTION__, ret);
return __convert_error_code(ret,(char*)__FUNCTION__);
}
if (!handle->is_progressive_download)
- ret = mm_player_pause(handle->mm_handle);
-
- if(ret != MM_ERROR_NONE)
{
- return __convert_error_code(ret,(char*)__FUNCTION__);
- }
- else
- {
- LOGE("[%s] End", __FUNCTION__);
- return PLAYER_ERROR_NONE;
+ ret = pthread_create(&handle->prepare_async_thread, NULL,
+ (void *)__prepare_async_thread_func, (void *)handle);
+
+ if (ret != 0)
+ {
+ LOGE("[%s] failed to create thread ret = %d", __FUNCTION__, ret);
+ return PLAYER_ERROR_OUT_OF_MEMORY;
+ }
}
+
+ LOGE("[%s] End", __FUNCTION__);
+ return PLAYER_ERROR_NONE;
}
-int player_prepare (player_h player)
+int player_prepare (player_h player)
{
LOGE("[%s] Start", __FUNCTION__);
PLAYER_INSTANCE_CHECK(player);
}
}
-int player_unprepare (player_h player)
+int player_unprepare (player_h player)
{
LOGE("[%s] Start", __FUNCTION__);
PLAYER_INSTANCE_CHECK(player);
LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
return PLAYER_ERROR_INVALID_STATE;
}
-
+
int ret = mm_player_unrealize(handle->mm_handle);
if(ret != MM_ERROR_NONE)
{
}
}
-int player_set_uri (player_h player, const char *uri)
+int player_set_uri (player_h player, const char *uri)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(uri);
return PLAYER_ERROR_NONE;
}
-int player_set_memory_buffer (player_h player, const void *data, int size)
+int player_set_memory_buffer (player_h player, const void *data, int size)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(data);
PLAYER_CHECK_CONDITION(size>=0,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" );
player_s * handle = (player_s *) player;
PLAYER_STATE_CHECK(handle,PLAYER_STATE_IDLE);
-
+
char uri[PATH_MAX] ;
-
+
snprintf(uri, sizeof(uri),"mem:///ext=%s,size=%d","", size);
int ret = mm_player_set_attribute(handle->mm_handle, NULL,MM_PLAYER_CONTENT_URI, uri, strlen(uri), MM_PLAYER_MEMORY_SRC, data,size,(char*)NULL);
if(ret != MM_ERROR_NONE)
return PLAYER_ERROR_NONE;
}
-int player_get_state (player_h player, player_state_e *state)
+int player_get_state (player_h player, player_state_e *state)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(state);
return PLAYER_ERROR_NONE;
}
-int player_set_volume (player_h player, float left, float right)
+int player_set_volume (player_h player, float left, float right)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_CHECK_CONDITION(left>=0 && left <= 1.0 ,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" );
}
}
-int player_get_volume (player_h player, float *left, float *right)
+int player_get_volume (player_h player, float *left, float *right)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(left);
PLAYER_INSTANCE_CHECK(player);
player_s * handle = (player_s *) player;
+ if (!__player_state_validate(handle, PLAYER_STATE_IDLE))
+ {
+ LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
+ return PLAYER_ERROR_INVALID_STATE;
+ }
+
int ret = mm_player_set_attribute(handle->mm_handle, NULL,"sound_volume_type" , type, (char*)NULL);
if(ret != MM_ERROR_NONE)
{
return PLAYER_ERROR_NONE;
}
-int player_start (player_h player)
+int player_start (player_h player)
{
LOGE("[%s] Start", __FUNCTION__);
PLAYER_INSTANCE_CHECK(player);
}
}
-int player_stop (player_h player)
+int player_stop (player_h player)
{
LOGE("[%s] Start", __FUNCTION__);
PLAYER_INSTANCE_CHECK(player);
}
}
-int player_pause (player_h player)
+int player_pause (player_h player)
{
LOGE("[%s] Start", __FUNCTION__);
PLAYER_INSTANCE_CHECK(player);
player_s * handle = (player_s *) player;
PLAYER_STATE_CHECK(handle,PLAYER_STATE_PLAYING);
-
+
int ret = mm_player_pause(handle->mm_handle);
if(ret != MM_ERROR_NONE)
{
}
}
-int player_set_position (player_h player, int millisecond, player_seek_completed_cb callback, void *user_data)
+int player_set_position (player_h player, int millisecond, player_seek_completed_cb callback, void *user_data)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_CHECK_CONDITION(millisecond>=0 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" );
}
}
-int player_set_position_ratio (player_h player, int percent, player_seek_completed_cb callback, void *user_data)
+int player_set_position_ratio (player_h player, int percent, player_seek_completed_cb callback, void *user_data)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_CHECK_CONDITION(percent>=0 && percent <= 100 ,PLAYER_ERROR_INVALID_PARAMETER ,"PLAYER_ERROR_INVALID_PARAMETER" );
}
}
-
-int player_get_position (player_h player, int *millisecond)
+int player_get_position (player_h player, int *millisecond)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(millisecond);
}
}
-int player_get_position_ratio (player_h player,int *percent)
+int player_get_position_ratio (player_h player,int *percent)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(percent);
}
}
-int player_set_mute (player_h player, bool muted)
+int player_set_mute (player_h player, bool muted)
{
PLAYER_INSTANCE_CHECK(player);
player_s * handle = (player_s *) player;
}
}
-int player_is_muted (player_h player, bool *muted)
+int player_is_muted (player_h player, bool *muted)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(muted);
else
{
*muted = FALSE;
- }
+ }
return PLAYER_ERROR_NONE;
}
}
value = -1;
}
int ret = mm_player_set_attribute(handle->mm_handle, NULL,MM_PLAYER_PLAYBACK_COUNT , value, (char*)NULL);
-
+
if(ret != MM_ERROR_NONE)
{
return __convert_error_code(ret,(char*)__FUNCTION__);
}
}
-int player_is_looping (player_h player, bool *looping)
+int player_is_looping (player_h player, bool *looping)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(looping);
}
}
-int player_get_duration (player_h player, int *duration)
+int player_get_duration (player_h player, int *duration)
{
PLAYER_INSTANCE_CHECK(player);
PLAYER_NULL_ARG_CHECK(duration);
{
PLAYER_INSTANCE_CHECK(player);
player_s * handle = (player_s *) player;
-
+
int ret = mm_player_set_attribute(handle->mm_handle, NULL,"display_method" , mode, (char*)NULL);
if(ret != MM_ERROR_NONE)
{
int player_set_playback_rate(player_h player, float rate)
{
+ LOGE("[%s] rate : %0.1f", __FUNCTION__, rate);
PLAYER_INSTANCE_CHECK(player);
PLAYER_CHECK_CONDITION(rate>=-5.0 && rate <= 5.0 ,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER" );
player_s * handle = (player_s *) player;
- PLAYER_STATE_CHECK(handle,PLAYER_STATE_PLAYING);
+
+ if (!__player_state_validate(handle, PLAYER_STATE_READY))
+ {
+ LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
+ return PLAYER_ERROR_INVALID_STATE;
+ }
int ret = mm_player_set_play_speed(handle->mm_handle, rate);
switch (ret)
{
- case MM_ERROR_NONE:
- case MM_ERROR_PLAYER_NO_OP:
- ret = PLAYER_ERROR_NONE;
- break;
- case MM_ERROR_NOT_SUPPORT_API:
- case MM_ERROR_PLAYER_SEEK:
- LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x) : seek error",__FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
- ret = PLAYER_ERROR_INVALID_OPERATION;
- break;
- default:
- return __convert_error_code(ret,(char*)__FUNCTION__);
+ case MM_ERROR_NONE:
+ case MM_ERROR_PLAYER_NO_OP:
+ ret = PLAYER_ERROR_NONE;
+ break;
+ case MM_ERROR_NOT_SUPPORT_API:
+ case MM_ERROR_PLAYER_SEEK:
+ LOGE("[%s] PLAYER_ERROR_INVALID_OPERATION(0x%08x) : seek error",__FUNCTION__, PLAYER_ERROR_INVALID_OPERATION);
+ ret = PLAYER_ERROR_INVALID_OPERATION;
+ break;
+ default:
+ return __convert_error_code(ret,(char*)__FUNCTION__);
}
return ret;
}
{
*visible = TRUE;
}
-
+
return PLAYER_ERROR_NONE;
}
}
}
else
{
- LOGI("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_CAPTURE);
+ LOGE("[%s] Event type : %d ",__FUNCTION__, _PLAYER_EVENT_TYPE_CAPTURE);
handle->user_cb[_PLAYER_EVENT_TYPE_CAPTURE] = callback;
handle->user_data[_PLAYER_EVENT_TYPE_CAPTURE] = user_data;
}
handle->user_cb[_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
handle->user_data[_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
return PLAYER_ERROR_INVALID_STATE;
- }
+ }
}
int player_set_streaming_cookie(player_h player, const char *cookie, int size)
}
}
-int player_set_completed_cb (player_h player, player_completed_cb callback, void *user_data)
+int player_set_completed_cb (player_h player, player_completed_cb callback, void *user_data)
{
return __set_callback(_PLAYER_EVENT_TYPE_COMPLETE,player,callback,user_data);
}
-int player_unset_completed_cb (player_h player)
+int player_unset_completed_cb (player_h player)
{
return __unset_callback(_PLAYER_EVENT_TYPE_COMPLETE,player);
}
-int player_set_interrupted_cb (player_h player, player_interrupted_cb callback, void *user_data)
+int player_set_interrupted_cb (player_h player, player_interrupted_cb callback, void *user_data)
{
return __set_callback(_PLAYER_EVENT_TYPE_INTERRUPT,player,callback,user_data);
}
-int player_unset_interrupted_cb (player_h player)
+int player_unset_interrupted_cb (player_h player)
{
return __unset_callback(_PLAYER_EVENT_TYPE_INTERRUPT,player);
}
-int player_set_error_cb (player_h player, player_error_cb callback, void *user_data)
+int player_set_error_cb (player_h player, player_error_cb callback, void *user_data)
{
return __set_callback(_PLAYER_EVENT_TYPE_ERROR,player,callback,user_data);
}
-int player_unset_error_cb (player_h player)
+int player_unset_error_cb (player_h player)
{
return __unset_callback(_PLAYER_EVENT_TYPE_ERROR,player);
}
-int player_set_buffering_cb (player_h player, player_buffering_cb callback, void *user_data)
+int player_set_buffering_cb (player_h player, player_buffering_cb callback, void *user_data)
{
return __set_callback(_PLAYER_EVENT_TYPE_BUFFERING,player,callback,user_data);
}
-int player_unset_buffering_cb (player_h player)
+int player_unset_buffering_cb (player_h player)
{
return __unset_callback(_PLAYER_EVENT_TYPE_BUFFERING,player);
}
-int player_set_subtitle_updated_cb(player_h player, player_subtitle_updated_cb callback, void* user_data )
+int player_set_subtitle_updated_cb(player_h player, player_subtitle_updated_cb callback, void* user_data )
{
return __set_callback(_PLAYER_EVENT_TYPE_SUBTITLE,player,callback,user_data);
}
-int player_unset_subtitle_updated_cb (player_h player)
+int player_unset_subtitle_updated_cb (player_h player)
{
return __unset_callback(_PLAYER_EVENT_TYPE_SUBTITLE,player);
}
LOGE("[%s] PLAYER_ERROR_INVALID_STATE(0x%08x) : current state - %d" ,__FUNCTION__,PLAYER_ERROR_INVALID_STATE, handle->state);
return PLAYER_ERROR_INVALID_STATE;
}
-
+
int ret = mm_player_set_video_stream_callback(handle->mm_handle, __video_stream_callback, (void*)handle);
if(ret != MM_ERROR_NONE)
return __convert_error_code(ret,(char*)__FUNCTION__);