2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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.
22 #include <glib/gstdio.h>
24 #define INTERNAL_FILE_PATH "/opt/usr/media/Camera"
25 #define EXTERNAL_FILE_PATH "/opt/storage/sdcard/Camera"
34 gboolean cam_file_init(GError **error);
35 void cam_file_finalize();
36 gboolean cam_file_get_size(const char *filename, guint64 *size);
37 gboolean cam_file_check_exists(gchar *filename);
38 gboolean cam_file_get_size(const char *filename, guint64 *size);
40 gboolean cam_file_register(const char *filename, GError **error);
41 gboolean cam_file_register_to_DCF(const char *filename, GError **error);
42 gboolean cam_file_delete(const gchar *filename, GError **error);
43 gboolean cam_file_rename(const gchar *filename, const gchar *new_name,
45 const gchar *cam_file_get_dcim_path(void);
46 const gchar *cam_file_get_internal_image_path(void);
47 const gchar *cam_file_get_internal_video_path(void);
48 const gchar *cam_file_get_external_image_path(void);
49 const gchar *cam_file_get_external_video_path(void);
51 gchar *cam_file_get_next_filename_for_multishot(const gchar *storage_root, const gchar *first_file_name, const gint shot_num, const gchar *suffix);
53 gchar *cam_file_get_next_filename(const gchar *storage_root,
54 const gchar *prefix_string,
56 gchar *cam_file_get_next_dcim_filename(const gchar *storage_root, media_type_t media_type);
58 * @brief get latest file path in @storage_root folder
59 * @param[in] data camera appdata structure
60 * @param[in] storage_root folder path (full path)
61 * @return Operation result
62 * @retval NOT NULL lateset file path in @storage_root
63 * @retval NULL Error or no file
65 gchar *cam_file_get_last_file_path (void *data, const gchar *storage_root);
67 * @brief get latest file path folder id in @storage_root folder,folder id is for media-content api
68 * @param[in] storage_root folder path (full path)
69 * @return Operation result
70 * @retval NOT NULL folder id for @storage_root
73 char *cam_file_get_cam_storage_folder_id(const gchar *storage_root);
75 * @brief get thumbnail full path of @file_path,folder id is for media-content api
76 * @param[in] file_path file path (full path)
77 * @param[out] file_path thumbnail_path of @file_path (full path)
78 * @return Operation result
79 * @retval TRUE succeed
82 gboolean cam_file_get_cam_file_thumbnail_path(const gchar *file_path, gchar **thumbnail_path);
84 gboolean cam_check_dir();