MEDIA_PACKET_FINALIZE, /**< Destroy packet handle */
} media_packet_finalize_cb_ret_t;
+/**
+ * @brief Enumeration for media packet rotation method.
+ * @since_tizen 5.0
+ */
+typedef enum {
+ MEDIA_PACKET_ROTATE_IDENTITY, /**< None */
+ MEDIA_PACKET_ROTATE_90, /**< Rotate 90 degrees */
+ MEDIA_PACKET_ROTATE_180, /**< Rotate 180 degrees */
+ MEDIA_PACKET_ROTATE_270, /**< Rotate 270 degrees */
+ MEDIA_PACKET_ROTATE_HORIZONTAL_FLIP, /**< Flip horizontal */
+ MEDIA_PACKET_ROTATE_VERTICAL_FLIP /**< Flip vertical */
+} media_packet_rotate_method_e;
+
/**
* @brief Called when the media packet is destroyed.
* @details It will be invoked when media_packet_destroy() is called.
* @param[in] packet The media packet handle
* @param[in] error_code The error code of #media_packet_error_e
* @param[in] user_data The user data passed from the callback registration function
- *
- * @pre It will be invoked when media packet is destroyed.
- *
* @retval #MEDIA_PACKET_REUSE Packet handle is not destroyed, the handle will be reused.
* @retval #MEDIA_PACKET_FINALIZE Destroy media packet handle, the handle will not be reused.
- *
+ * @pre It will be invoked when media packet is destroyed.
* @see media_packet_destroy()
* @see media_packet_create_alloc()
* @see media_packet_create()
/**
* @brief Creates a media packet handle and allocates buffer.
* @details The buffer will be allocated to heap or tbm_surface.
- *
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
- *
- * @remarks The @c packet must be released by using media_packet_destroy().
+ * @remarks The @a packet should be released using media_packet_destroy().
* @param[in] fmt The allocated #media_format_h by caller
* @param[in] fcb The media_packet_finalize_cb() to register
* @param[in] fcb_data The user data to be passed to the media_packet_finalize_cb() function
int media_packet_set_flags(media_packet_h packet, media_buffer_flags_e flags);
/**
- * @brief Unsets media_buffer_flags_e of media packet
+ * @brief Unsets media_buffer_flags_e of media packet.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @param[in] packet The media packet handle
- * @param[in] flags The media_buffer_flags_e of media packet to unset
+ * @param[in] flags The #media_buffer_flags_e of media packet to unset
*
* @return @c 0 on success,
* otherwise a negative error value
/**
* @brief Gets codec data and the codec data size of media packet.
- *
* @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
- *
+ * @remarks The @a codec_data should be released using free().
* @param[in] packet The media packet handle
* @param[out] codec_data The codec data to get
* @param[out] codec_data_size The codec data size to get
*/
int media_packet_destroy(media_packet_h packet);
+/**
+ * @brief Sets the rotation method.
+ * @since_tizen 5.0
+ *
+ * @param[in] packet The media packet handle
+ * @param[in] method The rotation method
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #MEDIA_PACKET_ERROR_NONE Successful
+ * @retval #MEDIA_PACKET_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_PACKET_ERROR_INVALID_OPERATION Invalid operation
+ */
+int media_packet_set_rotate_method(media_packet_h packet, media_packet_rotate_method_e method);
+
+/**
+ * @brief Gets the rotation method.
+ * @since_tizen 5.0
+ *
+ * @param[in] packet The media packet handle
+ * @param[out] method The rotation method
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ * @retval #MEDIA_PACKET_ERROR_NONE Successful
+ * @retval #MEDIA_PACKET_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #MEDIA_PACKET_ERROR_INVALID_OPERATION Invalid operation
+ */
+int media_packet_get_rotate_method(media_packet_h packet, media_packet_rotate_method_e *method);
/**
* @}
*/
pkt->pts = CLOCK_TIME_NONE;
pkt->dts = CLOCK_TIME_NONE;
pkt->duration = CLOCK_TIME_NONE;
+ pkt->method = MEDIA_PACKET_ROTATE_IDENTITY;
if (pkt->type == MEDIA_BUFFER_TYPE_NORMAL) {
/* need to use format,width,height to get buffer size */
free(ptr);
ptr = NULL;
}
+
+int media_packet_set_rotate_method(media_packet_h packet, media_packet_rotate_method_e method)
+{
+ media_packet_s *handle;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+
+ MEDIA_PACKET_INSTANCE_CHECK(packet);
+
+ handle = (media_packet_s *)packet;
+
+ handle->method = method;
+
+ return ret;
+}
+
+int media_packet_get_rotate_method(media_packet_h packet, media_packet_rotate_method_e *method)
+{
+ media_packet_s *handle;
+ int ret = MEDIA_PACKET_ERROR_NONE;
+
+ MEDIA_PACKET_INSTANCE_CHECK(packet);
+ MEDIA_PACKET_NULL_ARG_CHECK(method);
+
+ handle = (media_packet_s *)packet;
+
+ *method = handle->method;
+
+ return ret;
+}