* @since_tizen 2.3
*/
typedef enum {
- PLAYER_STATE_NONE, /**< Player is not created */
- PLAYER_STATE_IDLE, /**< Player is created, but not prepared */
- PLAYER_STATE_READY, /**< Player is ready to play media */
- PLAYER_STATE_PLAYING, /**< Player is playing media */
- PLAYER_STATE_PAUSED, /**< Player is paused while playing media */
+ PLAYER_STATE_NONE, /**< Player is not created */
+ PLAYER_STATE_IDLE, /**< Player is created, but not prepared */
+ PLAYER_STATE_READY, /**< Player is ready to play media */
+ PLAYER_STATE_PLAYING, /**< Player is playing media */
+ PLAYER_STATE_PAUSED, /**< Player is paused while playing media */
} player_state_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- PLAYER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- PLAYER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- PLAYER_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */
- PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
- PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on the device */
- PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
- PLAYER_ERROR_SEEK_FAILED = PLAYER_ERROR_CLASS | 0x01, /**< Seek operation failure */
- PLAYER_ERROR_INVALID_STATE = PLAYER_ERROR_CLASS | 0x02, /**< Invalid state */
- PLAYER_ERROR_NOT_SUPPORTED_FILE = PLAYER_ERROR_CLASS | 0x03, /**< File format not supported */
- PLAYER_ERROR_INVALID_URI = PLAYER_ERROR_CLASS | 0x04, /**< Invalid URI */
- PLAYER_ERROR_SOUND_POLICY = PLAYER_ERROR_CLASS | 0x05, /**< Sound policy error */
- PLAYER_ERROR_CONNECTION_FAILED = PLAYER_ERROR_CLASS | 0x06, /**< Streaming connection failed */
- PLAYER_ERROR_VIDEO_CAPTURE_FAILED = PLAYER_ERROR_CLASS | 0x07, /**< Video capture failed */
- 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_NOT_PERMITTED = PLAYER_ERROR_CLASS | 0x0b, /**< Format not permitted */
- PLAYER_ERROR_RESOURCE_LIMIT = PLAYER_ERROR_CLASS | 0x0c, /**< Resource limit */
- PLAYER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
- PLAYER_ERROR_SERVICE_DISCONNECTED = PLAYER_ERROR_CLASS | 0x0d, /**< Socket connection lost (Since 3.0) */
- PLAYER_ERROR_BUFFER_SPACE = TIZEN_ERROR_BUFFER_SPACE, /**< No buffer space available (Since 3.0)*/
+ PLAYER_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
+ PLAYER_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ PLAYER_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ PLAYER_ERROR_NO_SUCH_FILE = TIZEN_ERROR_NO_SUCH_FILE, /**< No such file or directory */
+ PLAYER_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid operation */
+ PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE = TIZEN_ERROR_FILE_NO_SPACE_ON_DEVICE, /**< No space left on the device */
+ PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+ PLAYER_ERROR_SEEK_FAILED = PLAYER_ERROR_CLASS | 0x01, /**< Seek operation failure */
+ PLAYER_ERROR_INVALID_STATE = PLAYER_ERROR_CLASS | 0x02, /**< Invalid state */
+ PLAYER_ERROR_NOT_SUPPORTED_FILE = PLAYER_ERROR_CLASS | 0x03, /**< File format not supported */
+ PLAYER_ERROR_INVALID_URI = PLAYER_ERROR_CLASS | 0x04, /**< Invalid URI */
+ PLAYER_ERROR_SOUND_POLICY = PLAYER_ERROR_CLASS | 0x05, /**< Sound policy error */
+ PLAYER_ERROR_CONNECTION_FAILED = PLAYER_ERROR_CLASS | 0x06, /**< Streaming connection failed */
+ PLAYER_ERROR_VIDEO_CAPTURE_FAILED = PLAYER_ERROR_CLASS | 0x07, /**< Video capture failed */
+ 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_NOT_PERMITTED = PLAYER_ERROR_CLASS | 0x0b, /**< Format not permitted */
+ PLAYER_ERROR_RESOURCE_LIMIT = PLAYER_ERROR_CLASS | 0x0c, /**< Resource limit */
+ PLAYER_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ PLAYER_ERROR_SERVICE_DISCONNECTED = PLAYER_ERROR_CLASS | 0x0d, /**< Socket connection lost (Since 3.0) */
+ PLAYER_ERROR_BUFFER_SPACE = TIZEN_ERROR_BUFFER_SPACE, /**< No buffer space available (Since 3.0)*/
} player_error_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- PLAYER_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
- PLAYER_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency (Deprecated since 3.0)*/
- PLAYER_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_COMPLETED = 0, /**< Interrupt completed (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_BY_MEDIA, /**< Interrupted by a non-resumable media application (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_BY_CALL, /**< Interrupted by an incoming call (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG, /**< Interrupted by unplugging headphones (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, /**< Interrupted by a resource conflict */
+ PLAYER_INTERRUPTED_BY_ALARM, /**< Interrupted by an alarm (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_BY_EMERGENCY, /**< Interrupted by an emergency (Deprecated since 3.0)*/
+ PLAYER_INTERRUPTED_BY_NOTIFICATION, /**< Interrupted by a notification (Deprecated since 3.0)*/
} player_interrupted_code_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- PLAYER_PD_STARTED = 0, /**< Progressive download is started */
- PLAYER_PD_COMPLETED, /**< Progressive download is completed */
+ PLAYER_PD_STARTED = 0, /**< Progressive download is started */
+ PLAYER_PD_COMPLETED, /**< Progressive download is completed */
} player_pd_message_type_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */
- PLAYER_DISPLAY_TYPE_EVAS, /**< Evas image object surface display */
- PLAYER_DISPLAY_TYPE_NONE, /**< This disposes off buffers */
+ PLAYER_DISPLAY_TYPE_OVERLAY = 0, /**< Overlay surface display */
+ PLAYER_DISPLAY_TYPE_EVAS, /**< Evas image object surface display */
+ PLAYER_DISPLAY_TYPE_NONE, /**< This disposes off buffers */
} player_display_type_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
- AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
- AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
+ AUDIO_LATENCY_MODE_LOW = 0, /**< Low audio latency mode */
+ AUDIO_LATENCY_MODE_MID, /**< Middle audio latency mode */
+ AUDIO_LATENCY_MODE_HIGH, /**< High audio latency mode */
} audio_latency_mode_e;
/**
* @since_tizen 2.4
*/
typedef enum {
- PLAYER_STREAM_TYPE_DEFAULT, /**< Container type */
- PLAYER_STREAM_TYPE_AUDIO, /**< Audio element stream type */
- PLAYER_STREAM_TYPE_VIDEO, /**< Video element stream type */
- PLAYER_STREAM_TYPE_TEXT, /**< Text type */
+ PLAYER_STREAM_TYPE_DEFAULT, /**< Container type */
+ PLAYER_STREAM_TYPE_AUDIO, /**< Audio element stream type */
+ PLAYER_STREAM_TYPE_VIDEO, /**< Video element stream type */
+ PLAYER_STREAM_TYPE_TEXT, /**< Text type */
} player_stream_type_e;
/**
* @since_tizen 2.4
*/
typedef enum {
- PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
- PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
+ PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN,
+ PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW,
} player_media_stream_buffer_status_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- PLAYER_DISPLAY_ROTATION_NONE, /**< Display is not rotated */
- PLAYER_DISPLAY_ROTATION_90, /**< Display is rotated 90 degrees */
- PLAYER_DISPLAY_ROTATION_180, /**< Display is rotated 180 degrees */
- PLAYER_DISPLAY_ROTATION_270, /**< Display is rotated 270 degrees */
+ PLAYER_DISPLAY_ROTATION_NONE, /**< Display is not rotated */
+ PLAYER_DISPLAY_ROTATION_90, /**< Display is rotated 90 degrees */
+ PLAYER_DISPLAY_ROTATION_180, /**< Display is rotated 180 degrees */
+ PLAYER_DISPLAY_ROTATION_270, /**< Display is rotated 270 degrees */
} player_display_rotation_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- PLAYER_DISPLAY_MODE_LETTER_BOX = 0, /**< Letter box */
- PLAYER_DISPLAY_MODE_ORIGIN_SIZE, /**< Origin size */
- PLAYER_DISPLAY_MODE_FULL_SCREEN, /**< Full-screen */
- PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen */
- PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
- PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode (Deprecated since [3.0]).*/
- PLAYER_DISPLAY_MODE_NUM
+ PLAYER_DISPLAY_MODE_LETTER_BOX = 0, /**< Letter box */
+ PLAYER_DISPLAY_MODE_ORIGIN_SIZE, /**< Origin size */
+ PLAYER_DISPLAY_MODE_FULL_SCREEN, /**< Full-screen */
+ PLAYER_DISPLAY_MODE_CROPPED_FULL, /**< Cropped full-screen */
+ PLAYER_DISPLAY_MODE_ORIGIN_OR_LETTER, /**< Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size) */
+ PLAYER_DISPLAY_MODE_DST_ROI, /**< Dst ROI mode (Deprecated since [3.0]).*/
+ PLAYER_DISPLAY_MODE_NUM
} player_display_mode_e;
/**
* @since_tizen 2.3
*/
typedef enum {
- PLAYER_CONTENT_INFO_ALBUM, /**< Album */
- PLAYER_CONTENT_INFO_ARTIST, /**< Artist */
- PLAYER_CONTENT_INFO_AUTHOR, /**< Author */
- PLAYER_CONTENT_INFO_GENRE, /**< Genre */
- PLAYER_CONTENT_INFO_TITLE, /**< Title */
- PLAYER_CONTENT_INFO_YEAR, /**< Year */
+ PLAYER_CONTENT_INFO_ALBUM, /**< Album */
+ PLAYER_CONTENT_INFO_ARTIST, /**< Artist */
+ PLAYER_CONTENT_INFO_AUTHOR, /**< Author */
+ PLAYER_CONTENT_INFO_GENRE, /**< Genre */
+ PLAYER_CONTENT_INFO_TITLE, /**< Title */
+ PLAYER_CONTENT_INFO_YEAR, /**< Year */
} player_content_info_e;
/**
* @since_tizen 2.3
*
* @remarks This function is issued in the context of gstreamer so the UI update code should not be directly invoked.\n
- * the packet should be released by media_packet_destroy() after use. \n
- * Otherwises, decoder can't work more because it can't have enough buffer to fill decoded frame.
+ * the packet should be released by media_packet_destroy() after use. \n
+ * Otherwises, decoder can't work more because it can't have enough buffer to fill decoded frame.
*
* @param[in] pkt Reference pointer to the media packet
* @param[in] user_data The user data passed from the callback registration function
* @param[in] width The width of the captured image
* @param[in] height The height of the captured image
* @param[in] fps The frame per second of the video \n
- It can be @c 0 if there is no video stream information.
+ * It can be @c 0 if there is no video stream information.
* @param[in] bit_rate The video bit rate [Hz] \n
* It can be an invalid value if there is no video stream information.
* @param[in] user_data The user data passed from the callback registration function
* @see legacy_player_unprepare()
* @see legacy_player_set_uri()
*/
-int legacy_player_prepare_async (player_h player, player_prepared_cb callback, void* user_data);
+int legacy_player_prepare_async(player_h player, player_prepared_cb callback, void* user_data);
/**
* @brief Resets the media player.
/**
* @brief Sets the player's volume.
* @since_tizen 2.3
- * @details Setting this volume adjusts the player's instance volume, not the system volume.
- * The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0.
+ * @details Setting this volume adjusts the player's instance volume, not the system volume.
+ * The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0.
* To change system volume, use the @ref CAPI_MEDIA_SOUND_MANAGER_MODULE API.
- * Finally, it does not support to set other value into each channel currently.
+ * Finally, it does not support to set other value into each channel currently.
*
* @param[in] player The handle to the media player
* @param[in] left The left volume scalar
* @remarks AAC can be supported.
* @remarks H.264 can be supported.
* @remarks This API should be called before calling the legacy_player_prepare() or legacy_player_prepare_async() \n
- to reflect the media information when pipeline is created.
+ * to reflect the media information when pipeline is created.
* @param[in] player The handle to media player
* @param[in] type The type of target stream
* @param[in] format The media format to set audio information
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @see legacy_player_set_display_rotation()
*/
-int legacy_player_get_display_rotation( player_h player, player_display_rotation_e *rotation);
+int legacy_player_get_display_rotation(player_h player, player_display_rotation_e *rotation);
/**
* @}
* @see legacy_player_audio_effect_set_equalizer_band_level()
* @see legacy_player_audio_effect_set_equalizer_all_bands()
*/
-int legacy_player_audio_effect_get_equalizer_bands_count (player_h player, int *count);
+int legacy_player_audio_effect_get_equalizer_bands_count(player_h player, int *count);
/**
* @brief Sets the gain set for the given equalizer band.
* @pre The player state must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
* @pre The path value can be @c NULL for reset when the player state is set to #PLAYER_STATE_IDLE by calling legacy_player_create() or legacy_player_unprepare().
*/
-int legacy_player_set_subtitle_path(player_h player,const char *path);
+int legacy_player_set_subtitle_path(player_h player, const char *path);
/**
* @brief Registers a callback function to be invoked when a subtitle updates.
* @see legacy_player_unset_video_stream_changed_cb()
* @see legacy_player_video_stream_changed_cb()
*/
-int legacy_player_set_video_stream_changed_cb (player_h player, player_video_stream_changed_cb callback, void *user_data);
+int legacy_player_set_video_stream_changed_cb(player_h player, player_video_stream_changed_cb callback, void *user_data);
/**
* @brief Unregisters the video stream changed callback function.
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @see legacy_player_set_video_stream_changed_cb()
*/
-int legacy_player_unset_video_stream_changed_cb (player_h player);
+int legacy_player_unset_video_stream_changed_cb(player_h player);
/**
* @brief Gets current track index.
#define LOG_TAG "TIZEN_N_PLAYER"
//#define USE_ECORE_FUNCTIONS
-#define PLAYER_CHECK_CONDITION(condition,error,msg) \
- if(condition) {} else \
- { LOGE("[%s] %s(0x%08x)",__FUNCTION__, msg,error); return error;}; \
+#define PLAYER_CHECK_CONDITION(condition, error, msg) \
+ 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")
+ 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")
+#define PLAYER_STATE_CHECK(player, expected_state) \
+ PLAYER_CHECK_CONDITION(player->state == expected_state, PLAYER_ERROR_INVALID_STATE, "PLAYER_ERROR_INVALID_STATE")
#define PLAYER_NULL_ARG_CHECK(arg) \
- PLAYER_CHECK_CONDITION(arg != NULL,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER")
+ PLAYER_CHECK_CONDITION(arg != NULL, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER")
#define PLAYER_RANGE_ARG_CHECK(arg, min, max) \
- PLAYER_CHECK_CONDITION(arg <= max,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER") \
- PLAYER_CHECK_CONDITION(arg >= min,PLAYER_ERROR_INVALID_PARAMETER,"PLAYER_ERROR_INVALID_PARAMETER")
+ PLAYER_CHECK_CONDITION(arg <= max, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER") \
+ PLAYER_CHECK_CONDITION(arg >= min, PLAYER_ERROR_INVALID_PARAMETER, "PLAYER_ERROR_INVALID_PARAMETER")
/* user_cb_lock */
-#define LEGACY_PLAYER_USER_CB_LOCK(x_handle,type) \
+#define LEGACY_PLAYER_USER_CB_LOCK(x_handle, type) \
do { \
if (_check_enabled_user_cb_lock(type)) \
g_mutex_lock(&((player_s*)x_handle)->user_cb_lock[type]); \
} while (0)
-#define LEGACY_PLAYER_USER_CB_UNLOCK(x_handle,type) \
+#define LEGACY_PLAYER_USER_CB_UNLOCK(x_handle, type) \
do { \
if (_check_enabled_user_cb_lock(type)) \
g_mutex_unlock(&((player_s*)x_handle)->user_cb_lock[type]); \
#include <ttrace.h>
#define PLAYER_TRACE_BEGIN(NAME) traceBegin(TTRACE_TAG_VIDEO, NAME)
#define PLAYER_TRACE_END() traceEnd(TTRACE_TAG_VIDEO)
-#define PLAYER_TRACE_ASYNC_BEGIN(NAME, COOKIE) traceAsyncBegin (TTRACE_TAG_VIDEO, COOKIE, NAME);
+#define PLAYER_TRACE_ASYNC_BEGIN(NAME, COOKIE) traceAsyncBegin(TTRACE_TAG_VIDEO, COOKIE, NAME);
#define PLAYER_TRACE_ASYNC_END(NAME, COOKIE) traceAsyncEnd(TTRACE_TAG_VIDEO, COOKIE, NAME);
#else
#define PLAYER_TRACE_BEGIN(NAME)
PLAYER_MESSAGE_EOS,
PLAYER_MESSAGE_LOOP_EXIT,
PLAYER_MESSAGE_MAX
-}_player_message_e;
+} _player_message_e;
#endif
-typedef struct _player_s{
+typedef struct _player_s {
MMHandleType mm_handle;
const void* user_cb[MUSE_PLAYER_EVENT_TYPE_NUM];
void* user_data[MUSE_PLAYER_EVENT_TYPE_NUM];