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_tag Tag
60 * LibVLC Tag support in media descriptor
64 typedef struct libvlc_tag_query_t libvlc_tag_query_t;
65 typedef char * libvlc_tag_t;
69 /*****************************************************************************
71 *****************************************************************************/
72 /** defgroup libvlc_time Time
74 * LibVLC Time support in libvlc
78 typedef vlc_int64_t libvlc_time_t;
82 /*****************************************************************************
84 *****************************************************************************/
85 /** defgroup libvlc_media_descriptor MediaDescriptor
87 * LibVLC Media Descriptor handling
92 /** defgroup libvlc_meta Meta
93 * \ingroup libvlc_media_descriptor
98 typedef enum libvlc_meta_t {
102 libvlc_meta_Copyright,
104 libvlc_meta_TrackNumber,
105 libvlc_meta_Description,
110 libvlc_meta_Language,
111 libvlc_meta_NowPlaying,
112 libvlc_meta_Publisher,
113 libvlc_meta_EncodedBy,
114 libvlc_meta_ArtworkURL,
120 typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
125 /*****************************************************************************
127 *****************************************************************************/
128 /** defgroup libvlc_media_instance MediaInstance
130 * LibVLC Media Instance handling
134 typedef struct libvlc_media_instance_t libvlc_media_instance_t;
136 typedef enum libvlc_state_t
138 libvlc_NothingSpecial,
150 /*****************************************************************************
152 *****************************************************************************/
153 /** defgroup libvlc_media_list MediaList
155 * LibVLC Media List handling
159 typedef struct libvlc_media_list_t libvlc_media_list_t;
160 typedef struct libvlc_media_list_view_t libvlc_media_list_view_t;
164 /*****************************************************************************
166 *****************************************************************************/
167 /** defgroup libvlc_media_list MediaList
169 * LibVLC Dynamic Media list: Media list with content synchronized with
174 typedef struct libvlc_dynamic_media_list_t libvlc_dynamic_media_list_t;
178 /*****************************************************************************
180 *****************************************************************************/
181 /** defgroup libvlc_media_list_player MediaListPlayer
183 * LibVLC Media List Player handling
187 typedef struct libvlc_media_list_player_t libvlc_media_list_player_t;
191 /*****************************************************************************
193 *****************************************************************************/
194 /** defgroup libvlc_media_library Media Library
196 * LibVLC Media Library
200 typedef struct libvlc_media_library_t libvlc_media_library_t;
204 /*****************************************************************************
206 *****************************************************************************/
207 /** defgroup libvlc_playlist Playlist
209 * LibVLC Playlist handling
213 typedef struct libvlc_playlist_item_t
219 } libvlc_playlist_item_t;
224 /*****************************************************************************
226 *****************************************************************************/
227 /** defgroup libvlc_video Video
229 * LibVLC Video handling
234 * Downcast to this general type as placeholder for a platform specific one, such as:
236 * CGrafPort on MacOSX,
239 typedef int libvlc_drawable_t;
242 * Rectangle type for video geometry
244 typedef struct libvlc_rectangle_t
254 /*****************************************************************************
255 * Services/Media Discovery
256 *****************************************************************************/
257 /** defgroup libvlc_media_discoverer Media Discoverer
259 * LibVLC Media Discoverer
263 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
267 /*****************************************************************************
268 * Message log handling
269 *****************************************************************************/
271 /** defgroup libvlc_log Log
273 * LibVLC Message Logging
277 /** This structure is opaque. It represents a libvlc log instance */
278 typedef struct libvlc_log_t libvlc_log_t;
280 /** This structure is opaque. It represents a libvlc log iterator */
281 typedef struct libvlc_log_iterator_t libvlc_log_iterator_t;
283 typedef struct libvlc_log_message_t
285 unsigned sizeof_msg; /* sizeof() of message structure, must be filled in by user */
286 int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
287 const char *psz_type; /* module type */
288 const char *psz_name; /* module name */
289 const char *psz_header; /* optional header */
290 const char *psz_message; /* message */
291 } libvlc_log_message_t;
295 /*****************************************************************************
297 *****************************************************************************/
299 /** defgroup libvlc_callbacks Callbacks
301 * LibVLC Event Callbacks
306 * Available events: (XXX: being reworked)
307 * - libvlc_MediaInstanceReachedEnd
310 typedef enum libvlc_event_type_t {
311 libvlc_MediaDescriptorMetaChanged,
312 libvlc_MediaDescriptorSubItemAdded,
313 libvlc_MediaDescriptorDurationChanged,
314 libvlc_MediaDescriptorPreparsedChanged,
315 libvlc_MediaDescriptorFreed,
316 libvlc_MediaDescriptorStateChanged,
318 libvlc_MediaInstancePlayed,
319 libvlc_MediaInstancePaused,
320 libvlc_MediaInstanceReachedEnd,
321 libvlc_MediaInstanceTimeChanged,
322 libvlc_MediaInstancePositionChanged,
324 libvlc_MediaListItemAdded,
325 libvlc_MediaListWillAddItem,
326 libvlc_MediaListItemDeleted,
327 libvlc_MediaListWillDeleteItem,
329 libvlc_MediaListViewItemAdded,
330 libvlc_MediaListViewWillAddItem,
331 libvlc_MediaListViewItemDeleted,
332 libvlc_MediaListViewWillDeleteItem,
334 libvlc_MediaListPlayerPlayed,
335 libvlc_MediaListPlayerNextItemSet,
336 libvlc_MediaListPlayerStopped,
338 libvlc_MediaDiscovererStarted,
339 libvlc_MediaDiscovererEnded
341 } libvlc_event_type_t;
345 * \param type the even type
346 * \param p_obj the sender object
347 * \param u Event dependent content
350 typedef struct libvlc_event_t
352 libvlc_event_type_t type;
354 union event_type_specific
356 /* media descriptor */
359 libvlc_meta_t meta_type;
360 } media_descriptor_meta_changed;
363 libvlc_media_descriptor_t * new_child;
364 } media_descriptor_subitem_added;
367 vlc_int64_t new_duration;
368 } media_descriptor_duration_changed;
372 } media_descriptor_preparsed_changed;
375 libvlc_media_descriptor_t * md;
376 } media_descriptor_freed;
379 libvlc_state_t new_state;
380 } media_descriptor_state_changed;
386 } media_instance_position_changed;
389 libvlc_time_t new_time;
390 } media_instance_time_changed;
395 libvlc_media_descriptor_t * item;
397 } media_list_item_added;
400 libvlc_media_descriptor_t * item;
402 } media_list_will_add_item;
405 libvlc_media_descriptor_t * item;
407 } media_list_item_deleted;
410 libvlc_media_descriptor_t * item;
412 } media_list_will_delete_item;
414 /* media list view */
417 libvlc_media_descriptor_t * item;
419 } media_list_view_item_added;
422 libvlc_media_descriptor_t * item;
424 } media_list_view_will_add_item;
427 libvlc_media_descriptor_t * item;
429 } media_list_view_item_deleted;
432 libvlc_media_descriptor_t * item;
434 } media_list_view_will_delete_item;
436 /* media discoverer */
440 } media_media_discoverer_started;
444 } media_media_discoverer_ended;
450 * Event manager that belongs to a libvlc object, and from whom events can
454 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
457 * Callback function notification
458 * \param p_event the event triggering the callback
461 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );