- can fix the video codec type among the sw, hw and default.
- in case of 'PLAYER_VIDEO_CODEC_TYPE_DEFAULT',
the higher priority video codec will be selected as before.
Change-Id: I7efd32057112552dba905e8b767e5c96c7e73a6c
* @addtogroup CAPI_MEDIA_PLAYER_MODULE
* @{
*/
-
typedef enum {
ELM_WAYLAND_WIN = 1,
ECORE_WAYLAND_WIN
} wl_window_type;
/**
+ * @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 player_360_get_field_of_view(player_h player, int *horizontal_degrees, int *vertical_degrees);
/**
+ * @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 player_get_video_codec_type()
+ */
+int 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 player_set_video_codec_type()
+ */
+int player_get_video_codec_type(player_h player, player_video_codec_type_e *ptype);
+
+/**
* @}
*/
#endif
#endif /*__TIZEN_MEDIA_PLAYER_INTERNAL_H__*/
-
Name: capi-media-player
Summary: A Media Player API
-Version: 0.3.78
+Version: 0.3.79
Release: 0
Group: Multimedia/API
License: Apache-2.0
g_free(ret_buf);
return ret;
}
+
+int player_set_video_codec_type(player_h player, player_video_codec_type_e type)
+{
+ PLAYER_INSTANCE_CHECK(player);
+
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_VIDEO_CODEC_TYPE;
+ player_cli_s *pc = (player_cli_s *)player;
+ char *ret_buf = NULL;
+
+ LOGD("ENTER %d", type);
+
+ player_msg_send1(api, pc, ret_buf, ret, INT, type);
+
+ g_free(ret_buf);
+ LOGD("LEAVE");
+ return ret;
+}
+
+int player_get_video_codec_type(player_h player, player_video_codec_type_e *ptype)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(ptype);
+
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_CODEC_TYPE;
+ player_cli_s *pc = (player_cli_s *) player;
+ char *ret_buf = NULL;
+ int type = 0;
+
+ LOGD("ENTER");
+
+ player_msg_send(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_get(type, ret_buf);
+ *ptype = type;
+ }
+
+ g_free(ret_buf);
+ LOGD("LEAVE");
+ return ret;
+}
CURRENT_STATUS_SET_AUDIO_ONLY,
CURRENT_STATUS_SET_PRE_BUFFERING_SIZE,
CURRENT_STATUS_SET_RE_BUFFERING_SIZE,
+ CURRENT_STATUS_VIDEO_CODEC_TYPE,
};
typedef struct {
g_print(" ==> [Player_Test] Duration: [%d ] msec\n", duration);
}
+static void set_video_codec_type(int type)
+{
+ int ret;
+ if (type < PLAYER_VIDEO_CODEC_TYPE_DEFAULT || type > PLAYER_VIDEO_CODEC_TYPE_SW)
+ type = PLAYER_VIDEO_CODEC_TYPE_DEFAULT;
+ ret = player_set_video_codec_type(g_player[0], type);
+ g_print(" ==> [Player_Test] player_set_video_codec_type(%d) return: %d\n", type, ret);
+}
+
+static void get_video_codec_type()
+{
+ player_video_codec_type_e type = 0;
+ int ret;
+ ret = player_get_video_codec_type(g_player[0], &type);
+ g_print(" ==> [Player_Test] player_get_video_codec_type() return : %d\n", ret);
+ g_print(" ==> [Player_Test] Codec type: [%d]\n", type);
+}
+
static void audio_frame_decoded_cb_ex(bool sync)
{
int ret;
g_menu_state = CURRENT_STATUS_SET_AUDIO_ONLY;
} else if (strncmp(cmd, "bf", 2) == 0) {
g_menu_state = CURRENT_STATUS_SET_PRE_BUFFERING_SIZE;
+ } else if (strncmp(cmd, "C1", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_VIDEO_CODEC_TYPE;
+ } else if (strncmp(cmd, "C2", 2) == 0) {
+ get_video_codec_type();
} else {
g_print("unknown menu \n");
}
g_print("[subtitle] A. Set(or change) subtitle path\n");
g_print("[subtitle] ss. Select(or change) subtitle track\n");
g_print("[Video Capture] C. Capture \n");
+ g_print("[Video Codec] C1. Set vcodec type (1:HW, 2:SW)\t");
+ g_print("C2. Get vcodec type\n");
g_print("[next uri] su. set next uri. \t");
g_print("gu. get next uri. \t");
g_print("sg. set gapless. \n");
g_print("*** set pre buffering size (ms) \n");
} else if (g_menu_state == CURRENT_STATUS_SET_RE_BUFFERING_SIZE) {
g_print("*** set re buffering size (ms) \n");
+ } else if (g_menu_state == CURRENT_STATUS_VIDEO_CODEC_TYPE) {
+ g_print("*** set video codec type (1: HW, 2: SW) \n");
} else {
g_print("*** unknown status.\n");
quit_program();
reset_menu_state();
}
break;
+ case CURRENT_STATUS_VIDEO_CODEC_TYPE:
+ {
+ int value = atoi(cmd);
+ set_video_codec_type(value);
+ reset_menu_state();
+ }
+ break;
}