VLC 4.0.0-dev
vlc_meta.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_meta.h: Stream meta-data
3 *****************************************************************************
4 * Copyright (C) 2004 VLC authors and VideoLAN
5 *
6 * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
22
23#ifndef VLC_META_H
24#define VLC_META_H 1
25
26/**
27 * \file
28 * This file defines functions and structures for stream meta-data in vlc
29 *
30 */
31
32typedef enum vlc_meta_type_t
63#define VLC_META_TYPE_COUNT 27
65#define ITEM_PREPARSED 1
66#define ITEM_ART_FETCHED 2
67#define ITEM_ART_NOTFOUND 4
69/**
70 * Basic function to deal with meta
71 */
72struct vlc_meta_t;
73
76VLC_API void vlc_meta_Set( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val );
77VLC_API const char * vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t meta_type );
78
79VLC_API void vlc_meta_AddExtra( vlc_meta_t *m, const char *psz_name, const char *psz_value );
80VLC_API const char * vlc_meta_GetExtra( const vlc_meta_t *m, const char *psz_name );
81VLC_API unsigned vlc_meta_GetExtraCount( const vlc_meta_t *m );
82
83/**
84 * Allocate a copy of all extra meta names and a table with it.
85 * Be sure to free both the returned pointers and its name.
86 */
88
89VLC_API void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src );
90
92VLC_API void vlc_meta_SetStatus( vlc_meta_t *m, int status );
93
94VLC_API const char *vlc_meta_TypeToString(vlc_meta_type_t meta_type);
95
96/**
97 * Returns a localizes string describing the meta
98 */
100
101typedef struct meta_export_t
103 struct vlc_object_t obj;
105 const char *psz_file;
109
110/* Setters for meta.
111 * Warning: Make sure to use the input_item meta setters (defined in vlc_input_item.h)
112 * instead of those one. */
113#define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, vlc_meta_Title, b )
114#define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_Artist, b )
115#define vlc_meta_SetGenre( meta, b ) vlc_meta_Set( meta, vlc_meta_Genre, b )
116#define vlc_meta_SetCopyright( meta, b ) vlc_meta_Set( meta, vlc_meta_Copyright, b )
117#define vlc_meta_SetAlbum( meta, b ) vlc_meta_Set( meta, vlc_meta_Album, b )
118#define vlc_meta_SetTrackNum( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackNumber, b )
119#define vlc_meta_SetDescription( meta, b ) vlc_meta_Set( meta, vlc_meta_Description, b )
120#define vlc_meta_SetRating( meta, b ) vlc_meta_Set( meta, vlc_meta_Rating, b )
121#define vlc_meta_SetDate( meta, b ) vlc_meta_Set( meta, vlc_meta_Date, b )
122#define vlc_meta_SetSetting( meta, b ) vlc_meta_Set( meta, vlc_meta_Setting, b )
123#define vlc_meta_SetURL( meta, b ) vlc_meta_Set( meta, vlc_meta_URL, b )
124#define vlc_meta_SetLanguage( meta, b ) vlc_meta_Set( meta, vlc_meta_Language, b )
125#define vlc_meta_SetNowPlaying( meta, b ) vlc_meta_Set( meta, vlc_meta_NowPlaying, b )
126#define vlc_meta_SetPublisher( meta, b ) vlc_meta_Set( meta, vlc_meta_Publisher, b )
127#define vlc_meta_SetEncodedBy( meta, b ) vlc_meta_Set( meta, vlc_meta_EncodedBy, b )
128#define vlc_meta_SetArtURL( meta, b ) vlc_meta_Set( meta, vlc_meta_ArtworkURL, b )
129#define vlc_meta_SetTrackID( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackID, b )
130#define vlc_meta_SetTrackTotal( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackTotal, b )
131#define vlc_meta_SetDirector( meta, b ) vlc_meta_Set( meta, vlc_meta_Director, b )
132#define vlc_meta_SetSeason( meta, b ) vlc_meta_Set( meta, vlc_meta_Season, b )
133#define vlc_meta_SetEpisode( meta, b ) vlc_meta_Set( meta, vlc_meta_Episode, b )
134#define vlc_meta_SetShowName( meta, b ) vlc_meta_Set( meta, vlc_meta_ShowName, b )
135#define vlc_meta_SetActors( meta, b ) vlc_meta_Set( meta, vlc_meta_Actors, b )
136#define vlc_meta_SetAlbumArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_AlbumArtist, b )
137#define vlc_meta_SetDiscNumber( meta, b ) vlc_meta_Set( meta, vlc_meta_DiscNumber, b )
139#define VLC_META_TITLE vlc_meta_TypeToLocalizedString( vlc_meta_Title )
140#define VLC_META_ARTIST vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
141#define VLC_META_GENRE vlc_meta_TypeToLocalizedString( vlc_meta_Genre )
142#define VLC_META_COPYRIGHT vlc_meta_TypeToLocalizedString( vlc_meta_Copyright )
143#define VLC_META_ALBUM vlc_meta_TypeToLocalizedString( vlc_meta_Album )
144#define VLC_META_TRACK_NUMBER vlc_meta_TypeToLocalizedString( vlc_meta_TrackNumber )
145#define VLC_META_DESCRIPTION vlc_meta_TypeToLocalizedString( vlc_meta_Description )
146#define VLC_META_RATING vlc_meta_TypeToLocalizedString( vlc_meta_Rating )
147#define VLC_META_DATE vlc_meta_TypeToLocalizedString( vlc_meta_Date )
148#define VLC_META_SETTING vlc_meta_TypeToLocalizedString( vlc_meta_Setting )
149#define VLC_META_URL vlc_meta_TypeToLocalizedString( vlc_meta_URL )
150#define VLC_META_LANGUAGE vlc_meta_TypeToLocalizedString( vlc_meta_Language )
151#define VLC_META_NOW_PLAYING vlc_meta_TypeToLocalizedString( vlc_meta_NowPlaying )
152#define VLC_META_PUBLISHER vlc_meta_TypeToLocalizedString( vlc_meta_Publisher )
153#define VLC_META_ENCODED_BY vlc_meta_TypeToLocalizedString( vlc_meta_EncodedBy )
154#define VLC_META_ART_URL vlc_meta_TypeToLocalizedString( vlc_meta_ArtworkURL )
155#define VLC_META_TRACKID vlc_meta_TypeToLocalizedString( vlc_meta_TrackID )
156#define VLC_META_DIRECTOR vlc_meta_TypeToLocalizedString( vlc_meta_Director )
157#define VLC_META_SEASON vlc_meta_TypeToLocalizedString( vlc_meta_Season )
158#define VLC_META_EPISODE vlc_meta_TypeToLocalizedString( vlc_meta_Episode )
159#define VLC_META_SHOW_NAME vlc_meta_TypeToLocalizedString( vlc_meta_ShowName )
160#define VLC_META_ACTORS vlc_meta_TypeToLocalizedString( vlc_meta_Actors )
161#define VLC_META_ALBUMARTIST vlc_meta_TypeToLocalizedString( vlc_meta_AlbumArtist )
162#define VLC_META_DISCNUMBER vlc_meta_TypeToLocalizedString( vlc_meta_DiscNumber )
164#define VLC_META_EXTRA_MB_ALBUMID "MB_ALBUMID"
166#endif
#define VLC_USED
Definition: fourcc_gen.c:32
#define VLC_API
Definition: fourcc_gen.c:31
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:89
Definition: vlc_meta.h:103
struct vlc_object_t obj
Definition: vlc_meta.h:104
const char * psz_file
Definition: vlc_meta.h:106
input_item_t * p_item
Definition: vlc_meta.h:105
Definition: meta.c:40
VLC object common members.
Definition: vlc_objects.h:45
const char * psz_name
Definition: text_style.c:33
This file is a collection of common definitions and types.
const char * vlc_meta_GetExtra(const vlc_meta_t *m, const char *psz_name)
Definition: meta.c:150
const char * vlc_meta_TypeToString(vlc_meta_type_t meta_type)
Definition: meta.c:48
void vlc_meta_SetStatus(vlc_meta_t *m, int status)
Definition: meta.c:173
void vlc_meta_Set(vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val)
vlc_meta has two kinds of meta, the one in a table, and the one in a dictionary.
Definition: meta.c:129
int input_item_WriteMeta(vlc_object_t *, input_item_t *)
Definition: meta.c:247
unsigned vlc_meta_GetExtraCount(const vlc_meta_t *m)
Definition: meta.c:155
char ** vlc_meta_CopyExtraNames(const vlc_meta_t *m)
Allocate a copy of all extra meta names and a table with it.
Definition: meta.c:160
int vlc_meta_GetStatus(vlc_meta_t *m)
vlc_meta status (see vlc_meta_status_e)
Definition: meta.c:168
const char * vlc_meta_TypeToLocalizedString(vlc_meta_type_t meta_type)
Returns a localizes string describing the meta.
Definition: meta.c:87
const char * vlc_meta_Get(const vlc_meta_t *p_meta, vlc_meta_type_t meta_type)
Definition: meta.c:136
void vlc_meta_Delete(vlc_meta_t *m)
Definition: meta.c:115
vlc_meta_type_t
Definition: vlc_meta.h:34
@ vlc_meta_Copyright
Definition: vlc_meta.h:38
@ vlc_meta_TrackTotal
Definition: vlc_meta.h:53
@ vlc_meta_Description
Definition: vlc_meta.h:41
@ vlc_meta_Album
Definition: vlc_meta.h:39
@ vlc_meta_ArtworkURL
Definition: vlc_meta.h:51
@ vlc_meta_Language
Definition: vlc_meta.h:46
@ vlc_meta_Publisher
Definition: vlc_meta.h:49
@ vlc_meta_ESNowPlaying
Definition: vlc_meta.h:48
@ vlc_meta_Date
Definition: vlc_meta.h:43
@ vlc_meta_Season
Definition: vlc_meta.h:55
@ vlc_meta_Artist
Definition: vlc_meta.h:36
@ vlc_meta_DiscTotal
Definition: vlc_meta.h:61
@ vlc_meta_NowPlaying
Definition: vlc_meta.h:47
@ vlc_meta_Director
Definition: vlc_meta.h:54
@ vlc_meta_Title
Definition: vlc_meta.h:35
@ vlc_meta_Actors
Definition: vlc_meta.h:58
@ vlc_meta_EncodedBy
Definition: vlc_meta.h:50
@ vlc_meta_TrackID
Definition: vlc_meta.h:52
@ vlc_meta_Setting
Definition: vlc_meta.h:44
@ vlc_meta_Rating
Definition: vlc_meta.h:42
@ vlc_meta_URL
Definition: vlc_meta.h:45
@ vlc_meta_AlbumArtist
Definition: vlc_meta.h:59
@ vlc_meta_DiscNumber
Definition: vlc_meta.h:60
@ vlc_meta_TrackNumber
Definition: vlc_meta.h:40
@ vlc_meta_Episode
Definition: vlc_meta.h:56
@ vlc_meta_Genre
Definition: vlc_meta.h:37
@ vlc_meta_ShowName
Definition: vlc_meta.h:57
vlc_meta_t * vlc_meta_New(void)
vlc_meta constructor.
Definition: meta.c:97
void vlc_meta_AddExtra(vlc_meta_t *m, const char *psz_name, const char *psz_value)
Definition: meta.c:141
struct meta_export_t meta_export_t
void vlc_meta_Merge(vlc_meta_t *dst, const vlc_meta_t *src)
Merging meta.
Definition: meta.c:182
char psz_value[8]
Definition: vout_intf.c:99