summaryrefslogtreecommitdiff
path: root/main/src/data/ivug-mediadata.h
blob: 43b5e9efc50982e71fd6fe2ff502160ce4e549b2 (plain)
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
/*
 * Copyright 2012  Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.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.tizenopensource.org/license
 *
 * 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.
 */


#ifndef __IVUG_MEDIADATA_H__
#define __IVUG_MEDIADATA_H__

#include <media-svc.h>
#include <visual-svc.h>		// Mitem

//slide type
typedef enum {
	SLIDE_TYPE_NONE = 0x00,
	SLIDE_TYPE_IMAGE,
	SLIDE_TYPE_VIDEO,
	SLIDE_TYPE_UNKNOWN,		// File is exists but it's type is unknown.
} Media_Type;

/*
	This struct represents data for slide.
	thumbnail_path is slide's thumbnail image path.
	fileurl is saved item in media service.
	filepath is local file path. if fileurl is http://.../test.jpg, filepath is NULL, when complete download filepath change to saved local file path.
*/
typedef struct {
//Data
	Media_Type slide_type;			//image, video

	UUID mediaID;					// Media ID

	char* thumbnail_path;			// thumbnail image file path.
	char* fileurl;					// file url.
	char* filepath;					// file path in local file system.
} Media_Data;

#ifdef __cplusplus
extern "C" {
#endif

/**
  * Converting Media_Data from filepath
  * @param filepath[in]
  *
**/
Media_Data *ivug_alloc_mediadata_from_filepath(const char* filepath);

/**
  * Converting Mitem to Media_Data
  * @param item[in]
  *
**/
Media_Data *ivug_alloc_mediadata_from_mitem(Mitem* item);


/**
  * Free memory used by Media_Data
  * @param mdata[in]
  *
**/
void ivug_free_mediadata(Media_Data* mdata);

/**
 *
 * Delete file indicated by @p mdata
 *
**/
bool ivug_delete_mediadata(Media_Data* mdata);


#ifdef __cplusplus
}
#endif

#endif // __IVUG_MEDIADATA_H__