- can fix the video codec type among the sw, hw and default.
- in case of 'default', the higher priority video codec will be selected as before.
Change-Id: I731c41d766b937e7eb34c372aa36b3408331f0e9
* @{
*/
+/**
+ * @brief Enumeration for video codec type.
+ * @since_tizen 4.0
+ */
+typedef enum
+{
+ PLAYER_VIDEO_CODEC_TYPE_DEFAULT = 0, /**< This is an optional flag for using codec which has higher priority */
+ PLAYER_VIDEO_CODEC_TYPE_HW, /**< This is an optional flag for using the h/w codec */
+ PLAYER_VIDEO_CODEC_TYPE_SW, /**< This is an optional flag for using the s/w codec */
+} player_video_codec_type_e;
+
/**
* @brief This file contains the media player API for custom features.
* @since_tizen 2.4
int legacy_player_enable_media_packet_video_frame_decoded_cb(player_h player, bool enable);
/**
- * @}
+ * @brief Set video codec type as h/w codec or s/w codec.
+ * @since_tizen 4.0
+ * @details The default video codec type of the player is #PLAYER_VIDEO_CODEC_TYPE_DEFAULT.
+ * Usually the H/W codec has higher priority than S/W codec if it exist.
+ * @param[in] player The handle to the media player
+ * @param[in] type The video codec type
+ * @return @c 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 must be #PLAYER_STATE_IDLE by player_create() or player_unprepare().
+ * @see legacy_player_get_video_codec_type()
+ */
+int legacy_player_set_video_codec_type(player_h player, player_video_codec_type_e type);
+
+/**
+ * @brief Get video codec type.
+ * @since_tizen 4.0
+ * @param[in] player The handle to the media player
+ * @param[out] ptype The video codec type
+ * @return @c 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 must be one of these: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED.
+ * @see legacy_player_set_video_codec_type()
*/
+int legacy_player_get_video_codec_type(player_h player, player_video_codec_type_e *type);
+/**
+ * @}
+ */
#ifdef __cplusplus
}
if (handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE]) {
int w;
int h;
+ MMPlayerVideoCapture *capture = (MMPlayerVideoCapture *)msg->data;
int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_WIDTH, &w, MM_PLAYER_VIDEO_HEIGHT, &h, (char *)NULL);
if (ret != MM_ERROR_NONE && handle->user_cb[MUSE_PLAYER_EVENT_TYPE_ERROR]) {
LOGE("[%s] PLAYER_ERROR_VIDEO_CAPTURE_FAILED (0x%08x) : Failed to get video size on video captured (0x%x)", __FUNCTION__, PLAYER_ERROR_VIDEO_CAPTURE_FAILED, ret);
err_code = PLAYER_ERROR_VIDEO_CAPTURE_FAILED;
} else {
- MMPlayerVideoCapture *capture = (MMPlayerVideoCapture *)msg->data;
-
switch (msg->captured_frame.orientation) {
case 0:
case 180:
/* call application callback */
((player_video_captured_cb)handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE])(capture->data, w, h, capture->size, handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE]);
+ }
- if (capture->data) {
- g_free(capture->data);
- capture->data = NULL;
- }
+ /* capure->data have to be released to avoid mem leak even if _get_attribute got failed. */
+ if (capture && capture->data) {
+ g_free(capture->data);
+ capture->data = NULL;
}
+
handle->user_cb[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
handle->user_data[MUSE_PLAYER_EVENT_TYPE_CAPTURE] = NULL;
}
else
return PLAYER_ERROR_NONE;
}
+
+int legacy_player_set_video_codec_type(player_h player, player_video_codec_type_e type)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ player_s * handle = (player_s *) player;
+ PLAYER_STATE_CHECK(handle, PLAYER_STATE_IDLE);
+
+ LOGI("video codec type : %d", type);
+ int ret = mm_player_set_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_CODEC_TYPE, type, (char*)NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char*)__FUNCTION__);
+ else
+ return PLAYER_ERROR_NONE;
+}
+
+int legacy_player_get_video_codec_type(player_h player, player_video_codec_type_e *type)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(type);
+ player_s * handle = (player_s *) player;
+
+ int ret = mm_player_get_attribute(handle->mm_handle, NULL, MM_PLAYER_VIDEO_CODEC_TYPE, type, (char*)NULL);
+ if (ret != MM_ERROR_NONE)
+ return __player_convert_error_code(ret, (char*)__FUNCTION__);
+ else
+ return PLAYER_ERROR_NONE;
+}
+
360_set_zoom
360_get_zoom
360_set_field_of_view
-360_get_field_of_view
\ No newline at end of file
+360_get_field_of_view
+set_video_codec_type
+get_video_codec_type
\ No newline at end of file
player_msg_return2(api, ret, module, DOUBLE, h_val, DOUBLE, v_val);
return ret;
}
+
+int player_disp_set_video_codec_type(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_handle_s *muse_player = NULL;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_VIDEO_CODEC_TYPE;
+ int type = 0;
+
+ muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
+ player_msg_get(type, muse_server_module_get_msg(module));
+
+ ret = legacy_player_set_video_codec_type(muse_player->player_handle, (player_video_codec_type_e)type);
+
+ player_msg_return(api, ret, module);
+
+ return ret;
+}
+
+int player_disp_get_video_codec_type(muse_module_h module)
+{
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_handle_s *muse_player = NULL;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_CODEC_TYPE;
+ player_video_codec_type_e type = 0;
+
+ muse_player = (muse_player_handle_s *)muse_server_ipc_get_handle(module);
+
+ ret = legacy_player_get_video_codec_type(muse_player->player_handle, &type);
+
+ player_msg_return1(api, ret, module, INT, type);
+
+ return ret;
+}
+
Name: mmsvc-player
Summary: A Media Player module for muse server
-Version: 0.2.67
+Version: 0.2.68
Release: 0
Group: Multimedia/Libraries
License: Apache-2.0