4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Yong Yeon Kim <yy9875.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 * This file defines api utilities of contents manager engines.
25 * @file media-util-register.h
26 * @author Yong Yeon Kim(yy9875.kim@samsung.com)
30 #ifndef _MEDIA_UTIL_REGISTER_H_
31 #define _MEDIA_UTIL_REGISTER_H_
41 * @fn int ms_media_file_register(const char *file_full_path);
42 * @brief This function registers multimedia file to media DB
43 * When you did some file operations such as Create, Copy, Move, Rename, and Delete in phone or mmc storage, media-server registers the result to database automatically by inotify mechanism.
44 * However, automatic registration will have a little delay because the method is asynchronous.
45 * If you want to register some files to database immediately, you should use this API.
47 * @param file_full_path [in] full path of file for register
48 * @return This function returns zero(MEDIA_INFO_ERROR_NONE) on success, or negative value with error code.
49 * Please refer 'media-info-error.h' to know the exact meaning of the error.
53 * @remark The database name is "/opt/usr/dbspace/.media.db".
54 * You have to use this API only for registering multimedia files. If you try to register no multimedia file, this API returns error.
58 #include <media-info.h>
64 result = ms_media_file_register("/opt/usr/media/test.mp3");
67 printf("FAIL to mediainfo_register_file\n");
72 printf("SUCCESS to register file\n");
80 int media_file_register(const char *file_full_path);
84 MEDIA_DIRECTORY_SCAN = 0,
86 } media_request_type_e;
93 char *complete_path; /* if the request type is MEDIA_FILES_REGISTER, this value will be NULL. */
94 }media_request_result_s;
96 typedef void (*scan_complete_cb)(media_request_result_s *, void *);
97 typedef void (*insert_complete_cb)(media_request_result_s *, void *);
99 int media_directory_scanning_async(const char *directory_path, bool recusive_on, scan_complete_cb user_callback, void *user_data);
101 int media_files_register(const char *list_path, insert_complete_cb user_callback, void *user_data);
111 #endif /*_MEDIA_UTIL_REGISTER_H_*/