2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #ifndef __TIZEN_VIDEO_META_H__
19 #define __TIZEN_VIDEO_META_H__
21 #include <media_content_type.h>
25 #endif /* __cplusplus */
29 * @brief This file contains the video metadata API and related functions to proceed with video metadata. \n
30 * Functions include cloning and destroying video metadata, getting video metadata such as width, height, \n
31 * album, genre, played parameters etc. and updating video to DB.
35 * @addtogroup CAPI_CONTENT_MEDIA_VIDEO_META_MODULE
40 * @brief Clones the video metadata.
41 * @details This function copies the video metadata handle from a source to destination.
43 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
45 * @remarks You must release the destination handle using video_meta_destroy().
47 * @param[out] dst The destination handle to the video metadata
48 * @param[in] src The source handle to the video metadata
50 * @return @c 0 on success,
51 * otherwise a negative error value
53 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
54 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
55 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
56 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
58 * @see video_meta_destroy()
60 int video_meta_clone(video_meta_h *dst, video_meta_h src);
63 * @brief Destroys the video metadata.
64 * @details This function frees all resources related to the video metadata handle. This handle
65 * no longer can be used to perform any operation. A new handle has to
66 * be created before the next use.
68 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
70 * @param[in] video The video metadata handle
72 * @return @c 0 on success,
73 * otherwise a negative error value
75 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
76 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
77 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
79 * @pre Get copy of video metadata handle by calling video_meta_clone().
81 * @see video_meta_clone()
83 int video_meta_destroy(video_meta_h video);
86 * @brief Gets the ID of the media of the given video metadata.
87 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
89 * @remarks You must release @a media_id using free().
91 * @param[in] video The video metadata handle
92 * @param[out] media_id The ID of the video
94 * @return @c 0 on success,
95 * otherwise a negative error value
97 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
98 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
99 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
100 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
102 int video_meta_get_media_id(video_meta_h video, char **media_id);
105 * @brief Gets the album of the given video metadata.
106 * @details If the value is an empty string, the method returns "Unknown".
108 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
110 * @remarks You must release @a album using free().
112 * @param[in] video The video metadata handle
113 * @param[out] album The album of the video metadata
115 * @return @c 0 on success,
116 * otherwise a negative error value
118 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
119 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
120 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
121 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
123 int video_meta_get_album(video_meta_h video, char **album);
126 * @brief Gets the artist of the given video metadata.
127 * @details If the value is an empty string, the method returns "Unknown".
129 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
131 * @remarks You must release @a artist using free().
133 * @param[in] video The video metadata handle
134 * @param[out] artist The artist of the video metadata
136 * @return @c 0 on success,
137 * otherwise a negative error value
139 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
140 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
141 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
142 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
144 int video_meta_get_artist(video_meta_h video, char **artist);
147 * @brief Gets the video album artist.
148 * @details If the value is an empty string, the method returns "Unknown".
150 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
152 * @remarks You must release @a album_artist using free().
154 * @param[in] video The video metadata handle
155 * @param[out] album_artist The album artist of the video metadata
157 * @return @c 0 on success,
158 * otherwise a negative error value
160 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
161 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
162 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
163 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
165 int video_meta_get_album_artist(video_meta_h video, char **album_artist);
168 * @brief Gets the genre of the given video metadata.
169 * @details If the value is an empty string, the method returns "Unknown".
171 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
173 * @remarks You must release @a genre using free().
175 * @param[in] video The video metadata handle
176 * @param[out] genre The genre of the video metadata
178 * @return @c 0 on success,
179 * otherwise a negative error value
181 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
182 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
183 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
184 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
186 int video_meta_get_genre(video_meta_h video, char **genre);
189 * @brief Gets the composer of the given video metadata.
190 * @details If the value is an empty string, the method returns "Unknown".
192 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
194 * @remarks You must release @a composer using free().
196 * @param[in] video The video metadata handle
197 * @param[out] composer The composer of the video metadata
199 * @return @c 0 on success,
200 * otherwise a negative error value
202 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
203 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
204 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
205 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
207 int video_meta_get_composer(video_meta_h video, char **composer);
210 * @brief Gets the year of the given video metadata.
211 * @details If the value is an empty string, the method returns "Unknown".
213 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
215 * @remarks You must release @a year using free().
217 * @param[in] video The video metadata handle
218 * @param[out] year The year of the video metadata
220 * @return @c 0 on success,
221 * otherwise a negative error value
223 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
224 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
225 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
226 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
228 int video_meta_get_year(video_meta_h video, char **year);
231 * @brief Gets the recorded date of the video.
232 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
234 * @remarks You must release @a recorded_date using free().
236 * @param[in] video The video metadata handle
237 * @param[out] recorded_date The recorded date of the video metadata
239 * @return @c 0 on success,
240 * otherwise a negative error value
242 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
243 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
244 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
245 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
247 int video_meta_get_recorded_date(video_meta_h video, char **recorded_date);
250 * @brief Gets the copyright notice of the given video metadata.
251 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
253 * @remarks You must release @a copyright using free().
255 * @param[in] video The video metadata handle
256 * @param[out] copyright The copyright of the video metadata
258 * @return @c 0 on success,
259 * otherwise a negative error value
261 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
262 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
263 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
264 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
266 int video_meta_get_copyright(video_meta_h video, char **copyright);
269 * @brief Gets the track number of the given videoo metadata.
270 * @details If the value is an empty string, the method returns "Unknown".
272 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
274 * @remarks You must release @a track_num using free().
276 * @param[in] video The video metadata handle
277 * @param[out] track_num The track number of the video metadata
279 * @return @c 0 on success,
280 * otherwise a negative error value
282 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
283 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
284 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
285 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
287 int video_meta_get_track_num(video_meta_h video, char **track_num);
290 * @brief Gets the bitrate of the given video metadata in bitrate per second.
291 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
293 * @param[in] video The video metadata handle
294 * @param[out] bit_rate The video bit rate in bit per second [bps]
296 * @return @c 0 on success,
297 * otherwise a negative error value
299 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
300 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
301 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
303 int video_meta_get_bit_rate(video_meta_h video, int *bit_rate);
306 * @brief Gets the track duration of the given videoo metadata.
307 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
309 * @param[in] video The video metadata handle
310 * @param[out] duration The video duration in milliseconds
312 * @return @c 0 on success,
313 * otherwise a negative error value
315 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
316 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
317 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
319 int video_meta_get_duration(video_meta_h video, int *duration);
322 * @brief Gets the width of the given videoo metadata.
323 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
325 * @param[in] video The video metadata handle
326 * @param[out] width The video width in pixels
328 * @return @c 0 on success,
329 * otherwise a negative error value
331 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
332 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
333 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
335 int video_meta_get_width(video_meta_h video, int *width);
338 * @brief Gets the height of the given videoo metadata.
339 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
341 * @param[in] video The video metadata handle
342 * @param[out] height The video height in pixels
344 * @return @c 0 on success,
345 * otherwise a negative error value
347 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
348 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
349 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
351 int video_meta_get_height(video_meta_h video, int *height);
354 * @deprecated Deprecated since 2.4. [Use media_info_get_played_count() instead]
355 * @brief Gets the played count of the video.
356 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
358 * @param[in] video The video metadata handle
359 * @param[out] played_count The counter of the video played
361 * @return @c 0 on success,
362 * otherwise a negative error value
364 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
365 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
366 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
368 int video_meta_get_played_count(video_meta_h video, int *played_count);
371 * @deprecated Deprecated since 2.4. [Use media_info_get_played_time() instead]
372 * @brief Gets the last played time parameter of the video.
373 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
375 * @param[in] video The video metadata handle
376 * @param[out] played_time The last played time of the video
378 * @return @c 0 on success,
379 * otherwise a negative error value
381 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
382 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
383 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
385 int video_meta_get_played_time(video_meta_h video, time_t *played_time);
388 * @deprecated Deprecated since 2.4.
389 * @brief Gets the played position parameter of the video.
390 * @details This function returns the elapsed playback position parameter of the video as period
391 * starting from the beginning of the movie.
393 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
395 * @param[in] video The video metadata handle
396 * @param[out] played_position The elapsed time of the video
398 * @return @c 0 on success,
399 * otherwise a negative error value
401 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
402 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
403 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
405 int video_meta_get_played_position(video_meta_h video, int *played_position);
408 * @deprecated Deprecated since 2.4. [Use media_info_increase_played_count() instead]
409 * @brief Sets the played count of the video.
410 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
412 * @param[in] video The video metadata handle
413 * @param[in] played_count The number of played
415 * @return @c 0 on success,
416 * otherwise a negative error value
418 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
419 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
420 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
422 * @post video_meta_update_to_db().
424 int video_meta_set_played_count(video_meta_h video, int played_count);
427 * @deprecated Deprecated since 2.4. [Use media_info_set_played_time() instead]
428 * @brief Sets the last played time of the video.
429 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
431 * @param[in] video The video metadata handle
432 * @param[in] played_time The last played time of the video
434 * @return @c 0 on success,
435 * otherwise a negative error value
437 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
438 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
439 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
441 * @post video_meta_update_to_db().
443 int video_meta_set_played_time(video_meta_h video, time_t played_time);
446 * @deprecated Deprecated since 2.4.
447 * @brief Sets the played position of the video.
449 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
451 * @remarks It is NOT recommended to use this attribute for your application-specific purpose because this attribute can be overwritten by other applications (even 0).
453 * @param[in] video The video metadata handle
454 * @param[in] played_position The position from the beginning of the video (in milliseconds)
456 * @return @c 0 on success,
457 * otherwise a negative error value
459 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
460 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
461 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
463 * @post video_meta_update_to_db().
465 int video_meta_set_played_position(video_meta_h video, int played_position);
468 * @brief Updates an video metadata with modified attributes in the media database.
469 * @details The function updates the given video meta in the media database. The function should be called after any change in video attributes, to be updated to the media
470 * database. For example, for setting the played time using video_meta_get_played_time(), after that the video_meta_update_to_db() function should be called to update media database.
472 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
475 * @privilege %http://tizen.org/privilege/content.write
477 * @remarks Do not call this function in callback function of foreach function like media_info_foreach_media_from_db().
479 * @param[in] video The video metadata handle
481 * @return @c 0 on success,
482 * otherwise a negative error value
484 * @retval #MEDIA_CONTENT_ERROR_NONE Successful
485 * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
486 * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY Out of memory
487 * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
488 * @retval #MEDIA_CONTENT_ERROR_DB_FAILED DB Operation failed
489 * @retval #MEDIA_CONTENT_ERROR_DB_BUSY DB Operation busy
490 * @retval #MEDIA_CONTENT_ERROR_NETWORK Network fail
491 * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
493 * @pre This function requires opened connection to content service by media_content_connect().
495 * @see media_content_connect()
496 * @see video_meta_set_played_time()
497 * @see video_meta_set_played_count()
498 * @see video_meta_set_played_position()
500 int video_meta_update_to_db(video_meta_h video);
508 #endif /* __cplusplus */
510 #endif /*__TIZEN_VIDEO_META_H__*/