1/* Metadata extraction
2 *
3 * Project : minidlna
4 * Website : http://sourceforge.net/projects/minidlna/
5 * Author  : Justin Maggard
6 *
7 * MiniDLNA media server
8 * Copyright (C) 2008-2009  Justin Maggard
9 *
10 * This file is part of MiniDLNA.
11 *
12 * MiniDLNA is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 *
16 * MiniDLNA is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with MiniDLNA. If not, see <http://www.gnu.org/licenses/>.
23 */
24#ifndef __METADATA_H__
25#define __METADATA_H__
26
27typedef struct metadata_s {
28	char *       title;
29	char *       artist;
30	char *       creator;
31	char *       album;
32	char *       genre;
33	char *       comment;
34	unsigned int disc;
35	unsigned int track;
36	unsigned int channels;
37	unsigned int bitrate;
38	unsigned int frequency;
39	unsigned int rotation;
40	char *       resolution;
41	char *       duration;
42	char *       date;
43	char *       mime;
44	char *       dlna_pn;
45	int          thumb_size;
46	uint8_t *    thumb_data;
47} metadata_t;
48
49typedef enum {
50  AAC_INVALID   =  0,
51  AAC_MAIN      =  1, /* AAC Main */
52  AAC_LC        =  2, /* AAC Low complexity */
53  AAC_SSR       =  3, /* AAC SSR */
54  AAC_LTP       =  4, /* AAC Long term prediction */
55  AAC_HE        =  5, /* AAC High efficiency (SBR) */
56  AAC_SCALE     =  6, /* Scalable */
57  AAC_TWINVQ    =  7, /* TwinVQ */
58  AAC_CELP      =  8, /* CELP */
59  AAC_HVXC      =  9, /* HVXC */
60  AAC_TTSI      = 12, /* TTSI */
61  AAC_MS        = 13, /* Main synthetic */
62  AAC_WAVE      = 14, /* Wavetable synthesis */
63  AAC_MIDI      = 15, /* General MIDI */
64  AAC_FX        = 16, /* Algorithmic Synthesis and Audio FX */
65  AAC_LC_ER     = 17, /* AAC Low complexity with error recovery */
66  AAC_LTP_ER    = 19, /* AAC Long term prediction with error recovery */
67  AAC_SCALE_ER  = 20, /* AAC scalable with error recovery */
68  AAC_TWINVQ_ER = 21, /* TwinVQ with error recovery */
69  AAC_BSAC_ER   = 22, /* BSAC with error recovery */
70  AAC_LD_ER     = 23, /* AAC LD with error recovery */
71  AAC_CELP_ER   = 24, /* CELP with error recovery */
72  AAC_HXVC_ER   = 25, /* HXVC with error recovery */
73  AAC_HILN_ER   = 26, /* HILN with error recovery */
74  AAC_PARAM_ER  = 27, /* Parametric with error recovery */
75  AAC_SSC       = 28, /* AAC SSC */
76  AAC_HE_L3     = 31, /* Reserved : seems to be HeAAC L3 */
77} aac_object_type_t;
78
79typedef enum {
80	NONE,
81	EMPTY,
82	VALID
83} ts_timestamp_t;
84
85int
86ends_with(const char *haystack, const char *needle);
87
88void
89check_for_captions(const char *path, int64_t detailID);
90
91int64_t
92GetFolderMetadata(const char *name, const char *path, const char *artist, const char *genre, int64_t album_art);
93
94int64_t
95GetAudioMetadata(const char *path, char *name);
96
97int64_t
98GetImageMetadata(const char *path, char *name);
99
100int64_t
101GetVideoMetadata(const char *path, char *name);
102
103#endif
104