1 /*****************************************************************************
2 * libvlc.h: libvlc_* new external API structures
3 *****************************************************************************
4 * Copyright (C) 1998-2007 the VideoLAN team
7 * Authors: Filippo Carone <littlejohn@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _LIBVLC_STRUCTURES_H
25 #define _LIBVLC_STRUCTURES_H 1
33 /** This structure is opaque. It represents a libvlc instance */
34 typedef struct libvlc_instance_t libvlc_instance_t;
36 /*****************************************************************************
38 *****************************************************************************/
40 /** defgroup libvlc_exception Exceptions
42 * LibVLC Exceptions handling
46 typedef struct libvlc_exception_t
55 /*****************************************************************************
57 *****************************************************************************/
58 /** defgroup libvlc_tree Tree
64 typedef void (*libvlc_retain_function)(void *);
65 typedef void (*libvlc_release_function)(void *);
67 typedef struct libvlc_tree_t libvlc_tree_t;
71 /*****************************************************************************
73 *****************************************************************************/
74 /** defgroup libvlc_tag Tag
76 * LibVLC Tag support in media descriptor
80 typedef struct libvlc_tag_query_t libvlc_tag_query_t;
81 typedef char * libvlc_tag_t;
85 /*****************************************************************************
87 *****************************************************************************/
88 /** defgroup libvlc_media_descriptor MediaDescriptor
90 * LibVLC Media Descriptor handling
95 /** defgroup libvlc_meta Meta
96 * \ingroup libvlc_media_descriptor
101 typedef enum libvlc_meta_t {
105 libvlc_meta_Copyright,
107 libvlc_meta_TrackNumber,
108 libvlc_meta_Description,
113 libvlc_meta_Language,
114 libvlc_meta_NowPlaying,
115 libvlc_meta_Publisher,
116 libvlc_meta_EncodedBy,
117 libvlc_meta_ArtworkURL,
123 typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
128 /*****************************************************************************
130 *****************************************************************************/
131 /** defgroup libvlc_media_instance MediaInstance
133 * LibVLC Media Instance handling
137 typedef struct libvlc_media_instance_t libvlc_media_instance_t;
141 /*****************************************************************************
143 *****************************************************************************/
144 /** defgroup libvlc_media_list MediaList
146 * LibVLC Media List handling
150 typedef struct libvlc_media_list_t libvlc_media_list_t;
154 /*****************************************************************************
156 *****************************************************************************/
157 /** defgroup libvlc_media_list MediaList
159 * LibVLC Dynamic Media list: Media list with content synchronized with
164 typedef struct libvlc_dynamic_media_list_t libvlc_dynamic_media_list_t;
168 /*****************************************************************************
170 *****************************************************************************/
171 /** defgroup libvlc_media_list_player MediaListPlayer
173 * LibVLC Media List Player handling
177 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
181 /*****************************************************************************
183 *****************************************************************************/
184 /** defgroup libvlc_media_library Media Library
186 * LibVLC Media Library
190 typedef struct libvlc_media_library_t libvlc_media_library_t;
194 /*****************************************************************************
196 *****************************************************************************/
197 /** defgroup libvlc_playlist Playlist
199 * LibVLC Playlist handling
203 typedef struct libvlc_playlist_item_t
209 } libvlc_playlist_item_t;
214 /*****************************************************************************
216 *****************************************************************************/
217 /** defgroup libvlc_video Video
219 * LibVLC Video handling
224 * Downcast to this general type as placeholder for a platform specific one, such as:
226 * CGrafPort on MacOSX,
229 typedef int libvlc_drawable_t;
232 * Rectangle type for video geometry
234 typedef struct libvlc_rectangle_t
244 /*****************************************************************************
245 * Services/Media Discovery
246 *****************************************************************************/
247 /** defgroup libvlc_media_discoverer Media Discoverer
249 * LibVLC Media Discoverer
253 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
257 /*****************************************************************************
258 * Message log handling
259 *****************************************************************************/
261 /** defgroup libvlc_log Log
263 * LibVLC Message Logging
267 /** This structure is opaque. It represents a libvlc log instance */
268 typedef struct libvlc_log_t libvlc_log_t;
270 /** This structure is opaque. It represents a libvlc log iterator */
271 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
273 typedef struct libvlc_log_message_t
275 unsigned sizeof_msg; /* sizeof() of message structure, must be filled in by user */
276 int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
277 const char *psz_type; /* module type */
278 const char *psz_name; /* module name */
279 const char *psz_header; /* optional header */
280 const char *psz_message; /* message */
281 } libvlc_log_message_t;
285 /*****************************************************************************
287 *****************************************************************************/
289 /** defgroup libvlc_callbacks Callbacks
291 * LibVLC Event Callbacks
296 * Available events: (XXX: being reworked)
297 * - libvlc_MediaInstanceReachedEnd
300 typedef enum libvlc_event_type_t {
301 libvlc_MediaDescriptorMetaChanged,
302 libvlc_MediaDescriptorSubItemAdded,
304 libvlc_MediaInstancePlayed,
305 libvlc_MediaInstancePaused,
306 libvlc_MediaInstanceReachedEnd,
307 libvlc_MediaInstancePositionChanged,
309 libvlc_MediaListItemAdded,
310 libvlc_MediaListItemDeleted,
312 libvlc_MediaListPlayerPlayed,
313 libvlc_MediaListPlayerNextItemSet,
314 libvlc_MediaListPlayerStopped,
316 libvlc_TreeSubtreeAdded,
317 libvlc_TreeSubtreeDeleted,
318 libvlc_TreeItemValueChanged,
320 } libvlc_event_type_t;
324 * \param type the even type
325 * \param p_obj the sender object
326 * \param u Event dependent content
329 typedef struct libvlc_event_t
331 libvlc_event_type_t type;
333 union event_type_specific
335 /* media descriptor */
338 libvlc_meta_t meta_type;
339 } media_descriptor_meta_changed;
342 libvlc_media_descriptor_t * new_child;
343 } media_descriptor_subitem_added;
348 long int new_position;
349 } media_instance_position_changed;
354 libvlc_media_descriptor_t * item;
356 } media_list_item_added;
359 libvlc_media_descriptor_t * item;
361 } media_list_item_deleted;
366 libvlc_tree_t * subtree;
368 } tree_subtree_added;
371 libvlc_tree_t * subtree;
373 } tree_subtree_deleted;
377 } tree_item_value_changed;
383 * Event manager that belongs to a libvlc object, and from whom events can
387 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
390 * Callback function notification
391 * \param p_event the event triggering the callback
394 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );