PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC = PLAYER_ERROR_CLASS | 0x0e, /**< Not supported audio codec but video can be played (Since 4.0) */
PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC = PLAYER_ERROR_CLASS | 0x0f, /**< Not supported video codec but audio can be played (Since 4.0) */
PLAYER_ERROR_NOT_SUPPORTED_SUBTITLE = PLAYER_ERROR_CLASS | 0x10, /**< Not supported subtitle format (Since 4.0) */
+ PLAYER_ERROR_NOT_SUPPORTED_FORMAT = PLAYER_ERROR_CLASS | 0x11, /**< Not supported format (Since 5.5) */
} player_error_e;
/**
int player_push_media_stream(player_h player, media_packet_h packet);
/**
+ * @brief Retrieves all supported media format for playback of external media stream.
+ * @details The supported media format can vary depending on the device capabilities.
+ * @since_tizen 5.5
+ * @param[in] player The handle to the media player
+ * @param[in] callback The iteration callback function
+ * @param[in] user_data The user data to be passed to the callback function
+ * @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
+ * @see player_supported_media_format_cb()
+ * @see player_set_media_stream_info()
+ * @see player_push_media_stream()
+ */
+int player_foreach_media_stream_supported_format(player_h player, player_supported_media_format_cb callback, void *user_data);
+
+/**
* @brief Sets contents information for media stream.
* @since_tizen @if WEARABLE 3.0 @else 2.4 @endif
* @remarks AV format must be set before pushing elementary stream with player_push_media_stream().
* @remarks This function must be called before calling the player_prepare() or player_prepare_async()
* to reflect the media information.
- * @remarks AAC can be supported.
- * @remarks H.264 can be supported.
+ * @remarks The supported media format MIME type can be checked
+ * by calling player_foreach_media_stream_supported_format(). (Since 5.5)
* @param[in] player The handle to media player
* @param[in] type The type of target stream
* @param[in] format The media format to set media information
* @retval #PLAYER_ERROR_NONE Successful
* @retval #PLAYER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #PLAYER_ERROR_INVALID_STATE Invalid state
+ * @retval #PLAYER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #PLAYER_ERROR_NOT_SUPPORTED_FORMAT Not supported format (Since 5.5)
* @pre The player state must be set to #PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
- * @see player_push_media_stream()
+ * @see player_push_media_stream()
+ * @see player_foreach_media_stream_supported_format()
*/
int player_set_media_stream_info(player_h player, player_stream_type_e type, media_format_h format);
return ret;
}
+int player_foreach_media_stream_supported_format(player_h player, player_supported_media_format_cb callback, void *user_data)
+{
+ int ret = PLAYER_ERROR_NONE;
+ player_cli_s *pc = (player_cli_s *)player;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_MEDIA_STREAM_SUPPORTED_FORMAT;
+ char *ret_buf = NULL;
+ int format_info[MAX_SUPPORTED_MEDIA_FORMAT] = {0,};
+ int len = 0, idx = 0;
+
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+
+ LOGD("ENTER");
+
+ PLAYER_SEND_MSG(api, pc, ret_buf, ret);
+
+ player_msg_get_type(len, ret_buf, INT);
+ player_msg_get_array(format_info, ret_buf);
+
+ LOGD("num of format %d", len);
+ for (idx = 0 ; idx < len ; idx++) {
+ if (!callback(format_info[idx], user_data)) {
+ LOGW("stop foreach callback");
+ break;
+ }
+ }
+
+ LOGD("LEAVE 0x%X", ret);
+ g_free(ret_buf);
+ return ret;
+}
+
int player_set_media_stream_info(player_h player, player_stream_type_e type, media_format_h format)
{
g_return_val_if_fail(format, PLAYER_ERROR_INVALID_OPERATION);
LOGE("seek offset of audio is %llu", offset);
}
+static bool _supported_media_format_cb(media_format_mimetype_e format, void *user_data)
+{
+ g_print("- supported format mimetype 0x%X\n", format);
+ return true;
+}
+
static int app_reset(bundle *b, void *data)
{
/* Take necessary actions when application becomes visible. */
goto FAILED;
}
+ player_foreach_media_stream_supported_format(ad->player_handle, _supported_media_format_cb, ad->player_handle);
+
/* send media packet to player */
player_set_media_stream_info(ad->player_handle, PLAYER_STREAM_TYPE_VIDEO, ad->video_fmt);