Code migration
[platform/core/api/media-content.git] / include_product / media_playlist.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 #ifndef __TIZEN_MEDIA_PLAYLIST_H__
18 #define __TIZEN_MEDIA_PLAYLIST_H__
19
20 #include <media_content_type.h>
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25
26 /**
27  * @file
28  * @brief This file contains the playlist API and functions related with handling playlists. \n
29  *        Functions include operations to get the number of playlists, the number of media-info for the playlist  \n
30  *        and all media files in the playlist, to clone, destroy, insert and delete playlist from DB,  \n
31  *        to handle with name, ID, thumbnail, played order and media info of the playlist.
32  */
33
34 /**
35  * @addtogroup CAPI_CONTENT_MEDIA_PLAYLIST_MODULE
36  * @{
37  */
38
39
40 /**
41  * @brief Gets the number of playlists for the passed @a filter from the media database.
42  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
43  *
44  * @param[in]  filter         The handle to the filter
45  * @param[out] playlist_count The count of the media playlist
46  *
47  * @return @c 0 on success,
48  *         otherwise a negative error value
49  *
50  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
51  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
52  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
53  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
54  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
55  *
56  * @pre This function requires opened connection to content service by media_content_connect().
57  *
58  * @see media_content_connect()
59  */
60 int media_playlist_get_playlist_count_from_db(filter_h filter, int *playlist_count);
61
62 /**
63  * @brief Iterates through the media playlists with an optional @a filter from the media database.
64  * @details This function gets all media playlists meeting the given filter.
65  *          The callback function will be invoked for every retrieved media playlist.
66  *          If @c NULL is passed to the filter, no filtering is applied.
67  *
68  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
69  *
70  * @param[in] filter    The handle to the audio filter
71  * @param[in] callback  The callback function to be invoked
72  * @param[in] user_data The user data to be passed to the callback function
73  *
74  * @return @c 0 on success,
75  *         otherwise a negative error value
76  *
77  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
78  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
79  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
80  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
81  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
82  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
83  *
84  * @pre  This function requires opened connection to content service by media_content_connect().
85  * @post This function invokes media_playlist_cb().
86  *
87  * @see media_playlist_cb()
88  * @see media_content_connect()
89  * @see media_filter_create()
90  */
91 int media_playlist_foreach_playlist_from_db(filter_h filter, media_playlist_cb callback, void *user_data);
92
93 /**
94  * @brief Gets the number of the media info for the given playlist present in the media database.
95  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
96  *
97  * @param[in]  playlist_id  The ID of the media playlist
98  * @param[in]  filter       The media filter handle
99  * @param[out] media_count  The number of media items
100  *
101  * @return @c 0 on success,
102  *         otherwise a negative error value
103  *
104  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
105  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
106  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
107  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
108  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
109  *
110  * @pre This function requires opened connection to content service by media_content_connect().
111  *
112  * @see media_content_connect()
113  */
114 int media_playlist_get_media_count_from_db(int playlist_id, filter_h filter, int *media_count);
115
116 /**
117  * @brief Iterates through the media files with an optional @a filter in the given audio playlist from the media database.
118  * @details This function gets all media files associated with the given media playlist and
119  *          meeting desired filter option and calls registered callback function for
120  *          every retrieved media info. If @c NULL is passed to the @a filter, no filtering is applied.
121  *
122  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
123  *
124  * @param[in] playlist_id The ID of the media playlist
125  * @param[in] filter      The audio filter handle
126  * @param[in] callback    The callback function to be invoked
127  * @param[in] user_data   The user data to be passed to the callback function
128  *
129  * @return @c 0 on success,
130  *         otherwise a negative error value
131  *
132  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
133  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
134  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
135  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
136  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
137  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
138  *
139  * @pre  This function requires opened connection to content service by media_content_connect().
140  * @post This function invokes media_info_cb().
141  *
142  * @see media_info_cb()
143  * @see media_content_connect()
144  * @see media_filter_create()
145  */
146 int media_playlist_foreach_media_from_db(int playlist_id, filter_h filter, playlist_member_cb callback, void *user_data);
147
148 /**
149  * @brief Inserts a new playlist with the given name into the media database.
150  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
151  *
152  * @privlevel public
153  * @privilege %http://tizen.org/privilege/content.write
154  *
155  * @remarks You must release the created handle using media_playlist_destroy().
156  *
157  * @param[in]  name     The name of the inserted playlist
158  * @param[out] playlist A created handle to media playlist
159  *
160  * @return @c 0 on success,
161  *         otherwise a negative error value
162  *
163  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
164  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
165  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
166  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
167  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
168  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
169  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
170  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
171  *
172  * @pre This function requires opened connection to content service by media_content_connect().
173  *
174  * @see media_content_connect()
175  * @see media_playlist_delete_from_db()
176  */
177 int media_playlist_insert_to_db(const char *name, media_playlist_h *playlist);
178
179 /**
180  * @brief Deletes the given playlist from the media database.
181  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
182  *
183  * @privlevel public
184  * @privilege %http://tizen.org/privilege/content.write
185  *
186  * @param[in] playlist_id The ID of media playlist
187  *
188  * @return @c 0 on success,
189  *         otherwise a negative error value
190  *
191  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
192  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
193  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
194  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
195  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
196  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
197  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
198  *
199  * @pre This function requires opened connection to content service by media_content_connect().
200  *
201  * @see media_content_connect()
202  * @see media_playlist_insert_to_db()
203  */
204 int media_playlist_delete_from_db(int playlist_id);
205
206 /**
207  * @brief Gets the media playlist from the media database.
208  *
209  * @details This function creates a new media playlist handle from the media database by the given @a playlist_id.
210  *          The media playlist will be created and will be filled with the playlist information.
211  *
212  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
213  *
214  * @remarks You must release @a playlist using media_playlist_destroy().
215  *
216  * @param[in]  playlist_id The ID of the media playlist
217  * @param[out] playlist    The media playlist handle associated with the playlist ID
218  *
219  * @return @c 0 on success,
220  *         otherwise a negative error value
221  *
222  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
223  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
224  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
225  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
226  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
227  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
228  *
229  * @pre This function requires opened connection to content service by media_content_connect().
230  *
231  * @see media_content_connect()
232  * @see media_playlist_destroy()
233  */
234 int media_playlist_get_playlist_from_db(int playlist_id, media_playlist_h *playlist);
235
236 /**
237  * @brief Destroys a playlist handle.
238  * @details This function frees all resources related to the playlist handle. This
239  *          handle no longer can be used to perform any operation. A new handle has to
240  *          be created before next usage.
241  *
242  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
243  *
244  * @param[in] playlist The media playlist handle
245  *
246  * @return @c 0 on success,
247  *         otherwise a negative error value
248  *
249  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
250  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
251  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
252  *
253  * @pre Get a copy of playlist handle by calling media_playlist_clone() or media_playlist_insert_to_db().
254  *
255  * @see media_playlist_clone()
256  */
257 int media_playlist_destroy(media_playlist_h playlist);
258
259 /**
260  * @brief Clones a playlist handle.
261  * @details This function copies the media playlist handle from a source to
262  *          destination. There is no media_playlist_create() function. The media_playlist_h is created internally and available through
263  *          media playlist foreach function such as media_playlist_foreach_playlist_from_db().
264  *          To use this handle outside of these foreach functions, use this function.
265  *
266  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
267  *
268  * @remarks The destination handle must be released using media_playlist_destroy().
269  *
270  * @param[in]  src  The source handle of a media playlist
271  * @param[out] dst  The destination handle to a media playlist
272  *
273  * @return @c 0 on success,
274  *         otherwise a negative error value
275  *
276  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
277  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
278  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
279  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
280  *
281  * @see media_playlist_destroy()
282  * @see media_playlist_foreach_playlist_from_db()
283  */
284 int media_playlist_clone(media_playlist_h *dst, media_playlist_h src);
285
286 /**
287  * @brief Gets the media playlist ID.
288  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
289  *
290  * @param[in]  playlist    The media playlist handle
291  * @param[out] playlist_id The ID of the media playlist
292  *
293  * @return @c 0 on success,
294  *         otherwise a negative error value
295  *
296  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
297  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
298  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
299  */
300 int media_playlist_get_playlist_id(media_playlist_h playlist, int *playlist_id);
301
302 /**
303  * @brief Gets a name of the playlist.
304  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
305  *
306  * @remarks You must release @a playlist_name using free().
307  *
308  * @param[in]  playlist      The media playlist handle
309  * @param[out] playlist_name The playlist name
310  *
311  * @return @c 0 on success,
312  *         otherwise a negative error value
313  *
314  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
315  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
316  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
317  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
318  */
319 int media_playlist_get_name(media_playlist_h playlist, char **playlist_name);
320
321 /**
322  * @brief Sets the name of the playlist.
323  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
324  *
325  * @param[in] playlist      The media playlist handle
326  * @param[in] playlist_name The name of the media playlist
327  *
328  * @return @c 0 on success,
329  *         otherwise a negative error value
330  *
331  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
332  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
333  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
334  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
335  *
336  * @post media_playlist_update_to_db()
337  *
338  */
339 int media_playlist_set_name(media_playlist_h playlist, const char *playlist_name);
340
341 /**
342  * @brief Gets a thumbnail path of the playlist.
343  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
344  *
345  * @remarks You must release @a path using free().
346  *
347  * @param[in]  playlist The media playlist handle
348  * @param[out] path     The path of the thumbnail
349  *
350  * @return @c 0 on success,
351  *         otherwise a negative error value
352  *
353  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
354  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
355  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
356  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
357  */
358 int media_playlist_get_thumbnail_path(media_playlist_h playlist, char **path);
359
360 /**
361  * @brief Sets the thumbnail path of the playlist.
362  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
363  *
364  * @param[in] playlist The media playlist handle
365  * @param[in] path     The path of the thumbnail
366  *
367  * @return @c 0 on success,
368  *         otherwise a negative error value
369  *
370  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
371  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
372  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
373  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
374  *
375  * @post media_playlist_update_to_db()
376  */
377 int media_playlist_set_thumbnail_path(media_playlist_h playlist, const char *path);
378
379
380 /**
381  * @brief Sets the playing order in the playlist.
382  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
383  *
384  * @param[in] playlist           The media playlist handle
385  * @param[in] playlist_member_id The playlist member ID
386  * @param[in] play_order         The playing order
387  *
388  * @return @c 0 on success,
389  *         otherwise a negative error value
390  *
391  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
392  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
393  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
394  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
395  *
396  * @post media_playlist_update_to_db()
397  */
398 int media_playlist_set_play_order(media_playlist_h playlist, int playlist_member_id, int play_order);
399
400 /**
401  * @brief Adds a new media info to the playlist.
402  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
403  *
404  * @param[in] playlist The media playlist handle
405  * @param[in] media_id The ID to the media info which is added
406  *
407  * @return @c 0 on success,
408  *         otherwise a negative error value
409  *
410  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
411  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
412  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
413  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
414  *
415  * @pre  This function requires opened connection to content service by media_content_connect().
416  * @post media_playlist_update_to_db()
417  *
418  * @see media_content_connect()
419  * @see media_playlist_remove_media()
420  */
421 int media_playlist_add_media(media_playlist_h playlist, const char *media_id);
422
423 /**
424  * @brief Removes the playlist members related with the media from the given playlist.
425  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
426  *
427  * @param[in] playlist           The media playlist handle
428  * @param[in] playlist_member_id The playlist member ID
429  *
430  * @return @c 0 on success,
431  *         otherwise a negative error value
432  *
433  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
434  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
435  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
436  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
437  *
438  * @pre  This function requires opened connection to content service by media_content_connect().
439  * @post media_playlist_update_to_db()
440  *
441  * @see media_content_connect()
442  * @see media_playlist_add_media()
443  */
444 int media_playlist_remove_media(media_playlist_h playlist, int playlist_member_id);
445
446 /**
447  * @brief Gets the played order of the playlist.
448  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
449  *
450  * @param[in] playlist           The media playlist handle
451  * @param[in] playlist_member_id The playlist member ID
452  * @param[out] play_order        The played order
453  *
454  * @return @c 0 on success,
455  *         otherwise a negative error value
456  *
457  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
458  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
459  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
460  */
461 int media_playlist_get_play_order(media_playlist_h playlist, int playlist_member_id, int *play_order);
462
463 /**
464  * @brief Updates the media playlist to the media database.
465  *
466  * @details The function updates the given media playlist in the media database.
467  *          The function should be called after any change in the playlist, to be updated to the media database.
468  *          For example, after using media_playlist_set_name() for setting the name of the playlist, the
469  *          media_playlist_update_to_db() function should be called so as to update
470  *          the given playlist attributes in the media database.
471  *
472  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
473  *
474  * @privlevel public
475  * @privilege %http://tizen.org/privilege/content.write
476  *
477  * @param[in] playlist The media playlist handle
478  *
479  * @return @c 0 on success,
480  *         otherwise a negative error value
481  *
482  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
483  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
484  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
485  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
486  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
487  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
488  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
489  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
490  *
491  * @pre This function requires opened connection to content service by media_content_connect().
492  *
493  * @see media_content_connect()
494  * @see media_playlist_destroy()
495  * @see media_playlist_add_media()
496  * @see media_playlist_remove_media()
497  * @see media_playlist_set_name()
498  * @see media_playlist_set_play_order()
499  */
500 int media_playlist_update_to_db(media_playlist_h playlist);
501
502 /**
503  * @brief Imports the playlist from m3u playlist file.
504  * @details This api reads a playlist from the m3u playlist file and insert into the db.
505  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
506  *
507  * @privlevel public
508  * @privilege %http://tizen.org/privilege/content.write
509  *
510  * @remarks   http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
511  *                     http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
512  *                     This api does not support the file of extended m3u playlist.
513  *
514  * @param[in] playlist_name The name of the playlist to save
515  * @param[in] path The path to import the playlist file
516  * @param[out] playlist The media playlist handle
517  *
518  * @return @c 0 on success,
519  *         otherwise a negative error value
520  *
521  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
522  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
523  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
524  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
525  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
526  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
527  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
528  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
529  */
530 int media_playlist_import_from_file(const char *playlist_name, const char *path, media_playlist_h *playlist);
531
532 /**
533  * @brief Exports the playlist to m3u playlist file.
534  * @since_tizen @if MOBILE 2.4 @elseif WEARABLE 3.0 @endif
535  *
536  * @remarks   http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. \n
537  *                     http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. \n
538  *
539  * @param[in] playlist The media playlist handle
540  * @param[in] path path The path to export the playlist
541  *
542  * @return @c 0 on success,
543  *         otherwise a negative error value
544  *
545  * @retval #MEDIA_CONTENT_ERROR_NONE              Successful
546  * @retval #MEDIA_CONTENT_ERROR_INVALID_PARAMETER Invalid parameter
547  * @retval #MEDIA_CONTENT_ERROR_OUT_OF_MEMORY     Out of memory
548  * @retval #MEDIA_CONTENT_ERROR_INVALID_OPERATION Invalid operation
549  * @retval #MEDIA_CONTENT_ERROR_DB_FAILED         DB Operation failed
550  * @retval #MEDIA_CONTENT_ERROR_DB_BUSY           DB Operation busy
551  * @retval #MEDIA_CONTENT_ERROR_NETWORK           Network fail
552  * @retval #MEDIA_CONTENT_ERROR_PERMISSION_DENIED Permission denied
553  */
554 int media_playlist_export_to_file(media_playlist_h playlist, const char* path);
555
556 /**
557  * @}
558  */
559
560 #ifdef __cplusplus
561 }
562 #endif /* __cplusplus */
563 #endif /*__TIZEN_MEDIA_PLAYLIST_H__*/