VLC 4.0.0-dev
Loading...
Searching...
No Matches
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
65typedef enum
72#define ITEM_PREPARSED 1
73#define ITEM_ART_FETCHED 2
74#define ITEM_ART_NOTFOUND 4
76/**
77 * Basic function to deal with meta
78 */
79struct vlc_meta_t;
80
83VLC_API void vlc_meta_SetWithPriority( vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val, vlc_meta_priority_t priority );
84VLC_API const char * vlc_meta_Get( const vlc_meta_t *p_meta, vlc_meta_type_t meta_type );
85
86/**
87 * set the meta extra
88 *
89 * \param m vlc_meta_t
90 * \param psz_name meta extra name (nonnullable)
91 * \param psz_value meta extra value (nullable)
92 * Removed from meta extra if set to NULL
93 * \param priority metadata priority (in terms of vlc_meta_priority_t)
94 */
95VLC_API void vlc_meta_SetExtraWithPriority( vlc_meta_t *m, const char *psz_name, const char *psz_value, vlc_meta_priority_t priority );
96VLC_API const char * vlc_meta_GetExtra( const vlc_meta_t *m, const char *psz_name );
97VLC_API unsigned vlc_meta_GetExtraCount( const vlc_meta_t *m );
98
99/**
100 * Allocate a copy of all extra meta names and a table with it.
101 * Be sure to free both the returned pointers and its name.
102 */
104
105VLC_API void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src );
106
108VLC_API void vlc_meta_SetStatus( vlc_meta_t *m, int status );
109
110VLC_API const char *vlc_meta_TypeToString(vlc_meta_type_t meta_type);
111
112/**
113 * Returns a localizes string describing the meta
114 */
116
117typedef struct meta_export_t
125
126#define vlc_meta_Set( meta, meta_type, b ) vlc_meta_SetWithPriority( meta, meta_type, b, VLC_META_PRIORITY_BASIC )
127#define vlc_meta_SetWithPlaylistPriority( meta, meta_type, b ) vlc_meta_SetWithPriority( meta, meta_type, b, VLC_META_PRIORITY_PLAYLIST )
128#define vlc_meta_SetExtra( meta, psz_name, psz_value ) vlc_meta_SetExtraWithPriority( meta, psz_name, psz_value, VLC_META_PRIORITY_BASIC )
130/* Setters for meta.
131 * Warning: Make sure to use the input_item meta setters (defined in vlc_input_item.h)
132 * instead of those one. */
133#define vlc_meta_SetTitle( meta, b ) vlc_meta_Set( meta, vlc_meta_Title, b )
134#define vlc_meta_SetArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_Artist, b )
135#define vlc_meta_SetGenre( meta, b ) vlc_meta_Set( meta, vlc_meta_Genre, b )
136#define vlc_meta_SetCopyright( meta, b ) vlc_meta_Set( meta, vlc_meta_Copyright, b )
137#define vlc_meta_SetAlbum( meta, b ) vlc_meta_Set( meta, vlc_meta_Album, b )
138#define vlc_meta_SetTrackNum( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackNumber, b )
139#define vlc_meta_SetDescription( meta, b ) vlc_meta_Set( meta, vlc_meta_Description, b )
140#define vlc_meta_SetRating( meta, b ) vlc_meta_Set( meta, vlc_meta_Rating, b )
141#define vlc_meta_SetDate( meta, b ) vlc_meta_Set( meta, vlc_meta_Date, b )
142#define vlc_meta_SetSetting( meta, b ) vlc_meta_Set( meta, vlc_meta_Setting, b )
143#define vlc_meta_SetURL( meta, b ) vlc_meta_Set( meta, vlc_meta_URL, b )
144#define vlc_meta_SetLanguage( meta, b ) vlc_meta_Set( meta, vlc_meta_Language, b )
145#define vlc_meta_SetNowPlaying( meta, b ) vlc_meta_Set( meta, vlc_meta_NowPlaying, b )
146#define vlc_meta_SetPublisher( meta, b ) vlc_meta_Set( meta, vlc_meta_Publisher, b )
147#define vlc_meta_SetEncodedBy( meta, b ) vlc_meta_Set( meta, vlc_meta_EncodedBy, b )
148#define vlc_meta_SetArtURL( meta, b ) vlc_meta_Set( meta, vlc_meta_ArtworkURL, b )
149#define vlc_meta_SetTrackID( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackID, b )
150#define vlc_meta_SetTrackTotal( meta, b ) vlc_meta_Set( meta, vlc_meta_TrackTotal, b )
151#define vlc_meta_SetDirector( meta, b ) vlc_meta_Set( meta, vlc_meta_Director, b )
152#define vlc_meta_SetSeason( meta, b ) vlc_meta_Set( meta, vlc_meta_Season, b )
153#define vlc_meta_SetEpisode( meta, b ) vlc_meta_Set( meta, vlc_meta_Episode, b )
154#define vlc_meta_SetShowName( meta, b ) vlc_meta_Set( meta, vlc_meta_ShowName, b )
155#define vlc_meta_SetActors( meta, b ) vlc_meta_Set( meta, vlc_meta_Actors, b )
156#define vlc_meta_SetAlbumArtist( meta, b ) vlc_meta_Set( meta, vlc_meta_AlbumArtist, b )
157#define vlc_meta_SetDiscNumber( meta, b ) vlc_meta_Set( meta, vlc_meta_DiscNumber, b )
159#define VLC_META_TITLE vlc_meta_TypeToLocalizedString( vlc_meta_Title )
160#define VLC_META_ARTIST vlc_meta_TypeToLocalizedString( vlc_meta_Artist )
161#define VLC_META_GENRE vlc_meta_TypeToLocalizedString( vlc_meta_Genre )
162#define VLC_META_COPYRIGHT vlc_meta_TypeToLocalizedString( vlc_meta_Copyright )
163#define VLC_META_ALBUM vlc_meta_TypeToLocalizedString( vlc_meta_Album )
164#define VLC_META_TRACK_NUMBER vlc_meta_TypeToLocalizedString( vlc_meta_TrackNumber )
165#define VLC_META_DESCRIPTION vlc_meta_TypeToLocalizedString( vlc_meta_Description )
166#define VLC_META_RATING vlc_meta_TypeToLocalizedString( vlc_meta_Rating )
167#define VLC_META_DATE vlc_meta_TypeToLocalizedString( vlc_meta_Date )
168#define VLC_META_SETTING vlc_meta_TypeToLocalizedString( vlc_meta_Setting )
169#define VLC_META_URL vlc_meta_TypeToLocalizedString( vlc_meta_URL )
170#define VLC_META_LANGUAGE vlc_meta_TypeToLocalizedString( vlc_meta_Language )
171#define VLC_META_NOW_PLAYING vlc_meta_TypeToLocalizedString( vlc_meta_NowPlaying )
172#define VLC_META_PUBLISHER vlc_meta_TypeToLocalizedString( vlc_meta_Publisher )
173#define VLC_META_ENCODED_BY vlc_meta_TypeToLocalizedString( vlc_meta_EncodedBy )
174#define VLC_META_ART_URL vlc_meta_TypeToLocalizedString( vlc_meta_ArtworkURL )
175#define VLC_META_TRACKID vlc_meta_TypeToLocalizedString( vlc_meta_TrackID )
176#define VLC_META_DIRECTOR vlc_meta_TypeToLocalizedString( vlc_meta_Director )
177#define VLC_META_SEASON vlc_meta_TypeToLocalizedString( vlc_meta_Season )
178#define VLC_META_EPISODE vlc_meta_TypeToLocalizedString( vlc_meta_Episode )
179#define VLC_META_SHOW_NAME vlc_meta_TypeToLocalizedString( vlc_meta_ShowName )
180#define VLC_META_ACTORS vlc_meta_TypeToLocalizedString( vlc_meta_Actors )
181#define VLC_META_ALBUMARTIST vlc_meta_TypeToLocalizedString( vlc_meta_AlbumArtist )
182#define VLC_META_DISCNUMBER vlc_meta_TypeToLocalizedString( vlc_meta_DiscNumber )
184#define VLC_META_EXTRA_MB_ALBUMID "MB_ALBUMID"
186#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:98
Definition vlc_meta.h:119
struct vlc_object_t obj
Definition vlc_meta.h:120
const char * psz_file
Definition vlc_meta.h:122
input_item_t * p_item
Definition vlc_meta.h:121
Definition meta.c:46
VLC object common members.
Definition vlc_objects.h:53
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:177
const char * vlc_meta_TypeToString(vlc_meta_type_t meta_type)
Definition meta.c:54
void vlc_meta_SetStatus(vlc_meta_t *m, int status)
Definition meta.c:203
vlc_meta_priority_t
Definition vlc_meta.h:67
@ VLC_META_PRIORITY_PLAYLIST
Definition vlc_meta.h:69
@ VLC_META_PRIORITY_INBAND
Definition vlc_meta.h:70
@ VLC_META_PRIORITY_BASIC
Definition vlc_meta.h:68
int input_item_WriteMeta(vlc_object_t *, input_item_t *)
Definition meta.c:290
unsigned vlc_meta_GetExtraCount(const vlc_meta_t *m)
Definition meta.c:185
void vlc_meta_SetWithPriority(vlc_meta_t *p_meta, vlc_meta_type_t meta_type, const char *psz_val, vlc_meta_priority_t priority)
vlc_meta has two kinds of meta, the one in a table, and the one in a dictionary.
Definition meta.c:153
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:190
int vlc_meta_GetStatus(vlc_meta_t *m)
vlc_meta status (see vlc_meta_status_e)
Definition meta.c:198
void vlc_meta_SetExtraWithPriority(vlc_meta_t *m, const char *psz_name, const char *psz_value, vlc_meta_priority_t priority)
set the meta extra
Definition meta.c:166
const char * vlc_meta_TypeToLocalizedString(vlc_meta_type_t meta_type)
Returns a localizes string describing the meta.
Definition meta.c:93
const char * vlc_meta_Get(const vlc_meta_t *p_meta, vlc_meta_type_t meta_type)
Definition meta.c:161
void vlc_meta_Delete(vlc_meta_t *m)
Definition meta.c:139
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:103
void vlc_meta_Merge(vlc_meta_t *dst, const vlc_meta_t *src)
Merging meta.
Definition meta.c:212
char psz_value[8]
Definition vout_intf.c:102