1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
/*
* libmedia-thumbnail
*
* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
*
* Contact: Hyunjun Ko <zzoon.ko@samsung.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <stdbool.h>
#include "media-thumbnail.h"
#include "media-thumb-error.h"
#include "media-thumb-types.h"
#include "media-thumb-debug.h"
#ifndef _MEDIA_THUMB_INTERNAL_H_
#define _MEDIA_THUMB_INTERNAL_H_
#define THUMB_WIDTH_MAX
/* The maximum of resolution to be able to get thumbnail is 3000 x 3000, except for only jpeg */
#define THUMB_MAX_ALLOWED_MEM_FOR_THUMB 9000000
#define THUMB_LARGE_WIDTH 320
#define THUMB_LARGE_HEIGHT 240
#define THUMB_SMALL_WIDTH 160
#define THUMB_SMALL_HEIGHT 120
typedef struct {
int size;
int width;
int height;
int origin_width;
int origin_height;
int alpha;
unsigned char *data;
bool is_saved;
} media_thumb_info;
enum Exif_Orientation {
NOT_AVAILABLE=0,
NORMAL =1,
HFLIP =2,
ROT_180 =3,
VFLIP =4,
TRANSPOSE =5,
ROT_90 =6,
TRANSVERSE =7,
ROT_270 =8
};
typedef struct {
ThumbFunc func;
void *user_data;
} thumbUserData;
int
_media_thumb_image(const char *origin_path,
int thumb_width,
int thumb_height,
media_thumb_format format,
media_thumb_info *thumb_info);
int
_media_thumb_drm_image(const char *origin_path,
int thumb_width,
int thumb_height,
media_thumb_format format,
media_thumb_info *thumb_info);
int
_media_thumb_video(const char *origin_path,
int thumb_width,
int thumb_height,
media_thumb_format format,
media_thumb_info *thumb_info);
int
_media_thumb_get_hash_name(const char *file_full_path,
char *thumb_hash_path, size_t max_thumb_path);
int _media_thumb_save_to_file_with_evas(unsigned char *data,
int w,
int h,
int alpha,
char *thumb_path);
#endif /*_MEDIA_THUMB_INTERNAL_H_*/
|