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 #include <media_info_private.h>
20 int image_meta_destroy(image_meta_h image)
22 image_meta_s *_image = (image_meta_s*)image;
24 content_retip_if_fail(image);
26 g_free(_image->media_id);
27 g_free(_image->date_taken);
28 g_free(_image->exposure_time);
29 g_free(_image->model);
32 return MEDIA_CONTENT_ERROR_NONE;
35 int image_meta_clone(image_meta_h *dst, image_meta_h src)
37 image_meta_s *_src = (image_meta_s*)src;
39 content_retip_if_fail(dst);
40 content_retip_if_fail(src);
42 image_meta_s *_dst = g_new0(image_meta_s, 1);
44 _dst->media_id = g_strdup(_src->media_id);
45 _dst->date_taken = g_strdup(_src->date_taken);
46 _dst->exposure_time = g_strdup(_src->exposure_time);
47 _dst->model = g_strdup(_src->model);
48 _dst->fnumber = _src->fnumber;
49 _dst->iso = _src->iso;
50 _dst->width = _src->width;
51 _dst->height = _src->height;
52 _dst->orientation = _src->orientation;
54 *dst = (image_meta_h)_dst;
56 return MEDIA_CONTENT_ERROR_NONE;
59 int image_meta_get_media_id(image_meta_h image, char **media_id)
61 image_meta_s *_image = (image_meta_s*)image;
63 content_retip_if_fail(image);
64 content_retip_if_fail(media_id);
66 *media_id = g_strdup(_image->media_id);
68 return MEDIA_CONTENT_ERROR_NONE;
71 int image_meta_get_width(image_meta_h image, int *width)
73 image_meta_s *_image = (image_meta_s*)image;
75 content_retip_if_fail(image);
76 content_retip_if_fail(width);
78 *width = _image->width;
80 return MEDIA_CONTENT_ERROR_NONE;
82 int image_meta_get_height(image_meta_h image, int *height)
84 image_meta_s *_image = (image_meta_s*)image;
86 content_retip_if_fail(image);
87 content_retip_if_fail(height);
89 *height = _image->height;
91 return MEDIA_CONTENT_ERROR_NONE;
94 int image_meta_get_orientation(image_meta_h image, media_content_orientation_e* orientation)
96 image_meta_s *_image = (image_meta_s*)image;
98 content_retip_if_fail(image);
99 content_retip_if_fail(orientation);
101 *orientation = _image->orientation;
103 return MEDIA_CONTENT_ERROR_NONE;
106 int image_meta_get_date_taken(image_meta_h image, char **date_taken)
108 image_meta_s *_image = (image_meta_s*)image;
110 content_retip_if_fail(image);
111 content_retip_if_fail(date_taken);
113 *date_taken = g_strdup(_image->date_taken);
115 return MEDIA_CONTENT_ERROR_NONE;
118 int image_meta_get_exposure_time(image_meta_h image, char **exposure_time)
120 content_warn("DEPRECATION WARNING: image_meta_get_exposure_time() is deprecated and will be removed from next release.");
121 image_meta_s *_image = (image_meta_s*)image;
123 content_retip_if_fail(image);
124 content_retip_if_fail(exposure_time);
126 *exposure_time = g_strdup(_image->exposure_time);
128 return MEDIA_CONTENT_ERROR_NONE;
131 int image_meta_get_fnumber(image_meta_h image, double *fnumber)
133 content_warn("DEPRECATION WARNING: image_meta_get_fnumber() is deprecated and will be removed from next release.");
134 image_meta_s *_image = (image_meta_s*)image;
136 content_retip_if_fail(image);
137 content_retip_if_fail(fnumber);
139 *fnumber = _image->fnumber;
141 return MEDIA_CONTENT_ERROR_NONE;
144 int image_meta_get_iso(image_meta_h image, int *iso)
146 content_warn("DEPRECATION WARNING: image_meta_get_iso() is deprecated and will be removed from next release.");
147 image_meta_s *_image = (image_meta_s*)image;
149 content_retip_if_fail(image);
150 content_retip_if_fail(iso);
154 return MEDIA_CONTENT_ERROR_NONE;
157 int image_meta_get_model(image_meta_h image, char **model)
159 content_warn("DEPRECATION WARNING: image_meta_get_model() is deprecated and will be removed from next release.");
160 image_meta_s *_image = (image_meta_s*)image;
162 content_retip_if_fail(image);
163 content_retip_if_fail(model);
165 *model = g_strdup(_image->model);
167 return MEDIA_CONTENT_ERROR_NONE;