update doxygen
[platform/core/api/video-util.git] / include / video_util_type.h
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17
18 #ifndef __TIZEN_MEDIA_VIDEO_UTIL_TYPE_H__
19 #define __TIZEN_MEDIA_VIDEO_UTIL_TYPE_H__
20
21 #include <tizen.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* __cplusplus */
26
27 #ifndef DEPRECATED_API
28 #define DEPRECATED_API __attribute__ ((deprecated))
29 #endif
30
31 #define VIDEO_UTIL_ERROR_CLASS TIZEN_ERROR_VIDEO_UTIL
32 #define TRANSCODER_FEATURE_PATH "http://tizen.org/feature/multimedia.transcoder"
33 /**
34  * @file video_util_type.h
35  */
36
37 /**
38 * @addtogroup CAPI_MEDIA_VIDEO_UTIL_MODULE
39 * @{
40 */
41
42 /**
43  * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE
44  * @brief Enumeration for errors of a video util.
45  * @since_tizen 2.3
46  */
47 typedef enum
48 {
49         VIDEO_UTIL_ERROR_NONE                                   = TIZEN_ERROR_NONE,                             /**< Successful */
50         VIDEO_UTIL_ERROR_INVALID_PARAMETER              = TIZEN_ERROR_INVALID_PARAMETER,        /**< Invalid parameter */
51         VIDEO_UTIL_ERROR_OUT_OF_MEMORY                  = TIZEN_ERROR_OUT_OF_MEMORY,            /**< Out of memory */
52         VIDEO_UTIL_ERROR_INVALID_OPERATION                      = TIZEN_ERROR_INVALID_OPERATION,        /**< Invalid operation */
53         VIDEO_UTIL_ERROR_BUSY                                           = TIZEN_ERROR_RESOURCE_BUSY,    /**< Device or resource busy */
54         VIDEO_UTIL_ERROR_NOT_SUPPORTED_FORMAT   = TIZEN_ERROR_VIDEO_UTIL | 0x01,        /**< Not supported format */
55         VIDEO_UTIL_ERROR_PERMISSION_DENIED                      = TIZEN_ERROR_PERMISSION_DENIED,        /**< Permission denied  */
56         VIDEO_UTIL_ERROR_NOT_SUPPORTED                  = TIZEN_ERROR_NOT_SUPPORTED     /**< Not supported */
57 } video_util_error_e;
58
59 /**
60  * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE
61  * @brief Enumeration for video codec.
62  * @since_tizen 2.3
63  */
64 typedef enum
65 {
66         VIDEO_UTIL_VIDEO_CODEC_MPEG4 = 0,               /**< MPEG4 */
67         VIDEO_UTIL_VIDEO_CODEC_H263,                    /**< H.263 */
68         VIDEO_UTIL_VIDEO_CODEC_H264,                    /**< H.264 */
69         VIDEO_UTIL_VIDEO_CODEC_NONE                     /**< No transcoding for video */
70
71 }video_util_video_codec_e;
72
73 /**
74  * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE
75  * @brief Enumeration for audio codec.
76  * @since_tizen 2.3
77  */
78 typedef enum
79 {
80         VIDEO_UTIL_AUDIO_CODEC_AAC      = 0,            /**< AAC */
81         VIDEO_UTIL_AUDIO_CODEC_AMRNB,           /**< AMRNB */
82         VIDEO_UTIL_AUDIO_CODEC_NONE                     /**< No transcoding for audio */
83 }video_util_audio_codec_e;
84
85
86 /**
87  * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE
88  * @brief Enumeration for formats of a media.
89  * @since_tizen 2.3
90  */
91 typedef enum
92 {
93         VIDEO_UTIL_FILE_FORMAT_3GP      = 0,            /**< 3GP */
94         VIDEO_UTIL_FILE_FORMAT_MP4,                     /**< MP4 */
95         VIDEO_UTIL_FILE_FORMAT_MAX                      /**< MAX */
96 }video_util_file_format_e;
97
98 /**
99  * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE
100  * @brief Video util handle.
101  * @since_tizen 2.3
102  */
103 typedef struct video_util_s *video_util_h;
104
105 /**
106  * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE
107  * @brief Called regularly during the video transcoding.
108  * @since_tizen 2.3
109  *
110  * @details The interval of callback invocation depends on the framework.
111  *
112  * @param[in] current_position The current position in milliseconds
113  * @param[in] duration The duration in seconds
114  * @param[in] user_data The user data passed from the callback registration function
115  *
116  * @pre This callback function is invoked if you register this callback using video_util_set_progress_transcoding_cb().
117  *
118  * @see video_util_start_transcoding()
119  */
120 typedef void (*video_util_transcoding_progress_cb)(unsigned long current_position, unsigned long duration, void *user_data);
121
122 /**
123  * @ingroup CAPI_MEDIA_VIDEO_UTIL_MODULE
124  * @brief Called when transcoding is finished just before storing in the file.
125  * @since_tizen 2.3
126  *
127  * @param[in] error_code The error code of video util
128  * @param[in] user_data The user data passed from the callback registration function
129  *
130  * @pre video_util_start_transcoding() will invoke this function.
131  */
132 typedef void (*video_util_transcoding_completed_cb)(video_util_error_e error_code, void *user_data);
133
134 /**
135  * @brief Called iteratively to notify you about the supported file formats.
136  * @since_tizen 2.3
137  *
138  * @param[in] format The format of media files
139  * @param[in] user_data The user data passed from the foreach function
140  *
141  * @return @c true to continue with the next iteration of the loop,
142  *               otherwise @c false to break out of the loop
143  *
144  * @pre video_util_foreach_supported_file_format() will invoke this callback.
145  */
146 typedef bool (*video_util_supported_file_format_cb)(video_util_file_format_e format, void *user_data);
147
148 /**
149  * @brief Called iteratively to notify you of supported video codec.
150  * @since_tizen 2.3
151  *
152  * @param[in] format The codec of video
153  * @param[in] user_data The user data passed from the foreach function
154  *
155  * @return @c true to continue with the next iteration of the loop,
156  *               otherwise @c false to break out of the loop
157  *
158  * @pre video_util_foreach_supported_video_codec() will invoke this callback.
159  */
160 typedef bool (*video_util_supported_video_encoder_cb)(video_util_video_codec_e codec, void *user_data);
161
162 /**
163  * @brief Called iteratively to notify you about the supported audio codec.
164  * @since_tizen 2.3
165  *
166  * @param[in] format The codec of audio
167  * @param[in] user_data The user data passed from the foreach function
168  *
169  * @return @c true to continue with the next iteration of the loop,
170  *               otherwise @c false to break out of the loop
171  *
172  * @pre video_util_foreach_supported_audio_codec() will invoke this callback.
173  */
174 typedef bool (*video_util_supported_audio_encoder_cb)(video_util_audio_codec_e codec, void *user_data);
175
176 __attribute__ ((deprecated)) typedef bool (*video_util_progress_transcoding_cb)(video_util_error_e error, unsigned long current_position, unsigned long duration, void *user_data);
177
178
179 /**
180  * @}
181  */
182
183 #ifdef __cplusplus
184 }
185 #endif /* __cplusplus */
186
187
188 #endif /*__TIZEN_MEDIA_VIDEO_UTIL_TYPE_H__*/