VLC 4.0.0-dev
Loading...
Searching...
No Matches
libvlc_events.h
Go to the documentation of this file.
1/*****************************************************************************
2 * libvlc_events.h: libvlc_events external API structure
3 *****************************************************************************
4 * Copyright (C) 1998-2010 VLC authors and VideoLAN
5 *
6 * Authors: Filippo Carone <littlejohn@videolan.org>
7 * Pierre d'Herbemont <pdherbemont@videolan.org>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU Lesser General Public License as published by
11 * the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
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 Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
23
24#ifndef LIBVLC_EVENTS_H
25#define LIBVLC_EVENTS_H 1
26
27# include <vlc/libvlc.h>
28# include <vlc/libvlc_picture.h>
30# include <vlc/libvlc_media.h>
31
32/**
33 * \file
34 * This file defines libvlc_event external API
35 */
36
37# ifdef __cplusplus
38extern "C" {
39# else
40# include <stdbool.h>
41# endif
42
49
50/**
51 * \ingroup libvlc_event
52 * @{
53 */
54
55/**
56 * Event types
57 */
59 /* Append new event types at the end of a category.
60 * Do not remove, insert or re-order any entry.
61 */
62
63 /**
64 * 1 or several Metadata of a \link #libvlc_media_t media item\endlink changed
65 */
67 /**
68 * Subitem was added to a \link #libvlc_media_t media item\endlink
69 * \see libvlc_media_subitems()
70 */
72 /**
73 * Deprecated, use libvlc_MediaParsedChanged or libvlc_MediaPlayerLengthChanged.
74 */
76 /**
77 * Parsing state of a \link #libvlc_media_t media item\endlink changed
78 * \see libvlc_media_parse_request(),
79 * libvlc_media_get_parsed_status(),
80 * libvlc_media_parse_stop()
81 */
83
84 /* Removed: libvlc_MediaFreed, */
85 /* Removed: libvlc_MediaStateChanged */
86
87 /**
88 * Subitem tree was added to a \link #libvlc_media_t media item\endlink
89 */
91 /**
92 * A thumbnail generation for this \link #libvlc_media_t media \endlink completed.
93 * \see libvlc_media_thumbnail_request_by_time()
94 * \see libvlc_media_thumbnail_request_by_pos()
95 */
97 /**
98 * One or more embedded thumbnails were found during the media preparsing
99 * The user can hold these picture(s) using libvlc_picture_retain if they
100 * wish to use them
101 */
103
119 /* libvlc_MediaPlayerTitleChanged, */
123
124 /* libvlc_MediaPlayerScrambledChanged, use libvlc_MediaPlayerProgramUpdated */
125
126 /** A track was added, cf. media_player_es_changed in \ref libvlc_event_t.u
127 * to get the id of the new track. */
129 /** A track was removed, cf. media_player_es_changed in \ref
130 * libvlc_event_t.u to get the id of the removed track. */
132 /** Tracks were selected or unselected, cf.
133 * media_player_es_selection_changed in \ref libvlc_event_t.u to get the
134 * unselected and/or the selected track ids. */
142 /** A track was updated, cf. media_player_es_changed in \ref
143 * libvlc_event_t.u to get the id of the updated track. */
149 /**
150 * The title list changed, call
151 * libvlc_media_player_get_full_title_descriptions() to get the new list.
152 */
154 /**
155 * The title selection changed, cf media_player_title_selection_changed in
156 * \ref libvlc_event_t.u
157 */
161
162 /**
163 * A \link #libvlc_media_t media item\endlink was added to a
164 * \link #libvlc_media_list_t media list\endlink.
165 */
167 /**
168 * A \link #libvlc_media_t media item\endlink is about to get
169 * added to a \link #libvlc_media_list_t media list\endlink.
170 */
172 /**
173 * A \link #libvlc_media_t media item\endlink was deleted from
174 * a \link #libvlc_media_list_t media list\endlink.
175 */
177 /**
178 * A \link #libvlc_media_t media item\endlink is about to get
179 * deleted from a \link #libvlc_media_list_t media list\endlink.
180 */
182 /**
183 * A \link #libvlc_media_list_t media list\endlink has reached the
184 * end.
185 * All \link #libvlc_media_t items\endlink were either added (in
186 * case of a \ref libvlc_media_discoverer_t) or parsed (preparser).
187 */
189
190 /**
191 * \deprecated No longer used.
192 * This belonged to the removed libvlc_media_list_view_t
193 */
195 /**
196 * \deprecated No longer used.
197 * This belonged to the removed libvlc_media_list_view_t
198 */
200 /**
201 * \deprecated No longer used.
202 * This belonged to the removed libvlc_media_list_view_t
203 */
205 /**
206 * \deprecated No longer used.
207 * This belonged to the removed libvlc_media_list_view_t
208 */
210
211 /**
212 * Playback of a \link #libvlc_media_list_player_t media list
213 * player\endlink has started.
214 */
216
217 /**
218 * The current \link #libvlc_media_t item\endlink of a
219 * \link #libvlc_media_list_player_t media list player\endlink
220 * has changed to a different item.
221 */
223
224 /**
225 * Playback of a \link #libvlc_media_list_player_t media list
226 * player\endlink has stopped.
227 */
229
230 /**
231 * A new \link #libvlc_renderer_item_t renderer item\endlink was found by a
232 * \link #libvlc_renderer_discoverer_t renderer discoverer\endlink.
233 * The renderer item is valid until deleted.
234 */
236
237 /**
238 * A previously discovered \link #libvlc_renderer_item_t renderer item\endlink
239 * was deleted by a \link #libvlc_renderer_discoverer_t renderer discoverer\endlink.
240 * The renderer item is no longer valid.
241 */
243
244 /**
245 * The current media set into the \ref libvlc_media_player_t is stopping.
246 *
247 * This event can be used to notify when the media callbacks, initialized
248 * from \ref libvlc_media_new_callbacks, should be interrupted, and in
249 * particular the \ref libvlc_media_read_cb. It can also be used to signal
250 * the application state that any input resource (webserver, file mounting,
251 * etc) can be discarded. Output resources still need to be active until
252 * the player switches to the \ref libvlc_Stopped state.
253 */
255};
256
257/**
258 * A LibVLC event
259 */
260typedef struct libvlc_event_t
261{
262 int type; /**< Event type (see @ref libvlc_event_e) */
263 void *p_obj; /**< Object emitting the event */
264 union
265 {
266 /* media descriptor */
267 struct
268 {
269 libvlc_meta_t meta_type; /**< Deprecated, any meta_type can change */
271 struct
272 {
275 struct
276 {
279 struct
280 {
281 int new_status; /**< see @ref libvlc_media_parsed_status_t */
283 struct
284 {
285 int new_state; /**< see @ref libvlc_state_t */
287 struct
288 {
291 struct
292 {
295 struct
296 {
299
300 /* media instance */
301 struct
302 {
305 struct
306 {
309 struct
310 {
313 struct
314 {
317 struct
318 {
320 int index;
322 struct
323 {
326 struct
327 {
330 struct
331 {
334 struct
335 {
338
339 /* media list */
340 struct
341 {
343 int index;
345 struct
346 {
348 int index;
350 struct
351 {
353 int index;
355 struct
356 {
358 int index;
360
361 /* media list player */
362 struct
363 {
366
367 /* snapshot taken */
368 struct
369 {
372
373 /* Length changed */
374 struct
375 {
378
379 /* Extra MediaPlayer */
380 struct
381 {
384
385 struct
386 {
389
390
391 /* ESAdded, ESDeleted, ESUpdated */
392 struct
393 {
395 int i_id; /**< Deprecated, use psz_id */
396 /** Call libvlc_media_player_get_track_from_id() to get the track
397 * description. */
398 const char *psz_id;
400
401 /* ESSelected */
402 struct
403 {
405 const char *psz_unselected_id;
406 const char *psz_selected_id;
408
409 /* ProgramAdded, ProgramDeleted, ProgramUpdated */
410 struct
411 {
412 int i_id;
414
415 /* ProgramSelected */
416 struct
417 {
421
422 struct
423 {
424 float volume;
426
427 struct
428 {
429 const char *device;
431
432 struct
433 {
435 /** Only valid when recording ends (recording == false) */
438
439 struct
440 {
443 struct
444 {
447 } u; /**< Type-dependent event description */
449
450
451/**@} */
452
453# ifdef __cplusplus
454}
455# endif
456
457#endif /* _LIBVLC_EVENTS_H */
int64_t libvlc_time_t
Definition libvlc.h:78
libvlc_event_e
Event types.
Definition libvlc_events.h:58
@ libvlc_MediaPlayerTitleSelectionChanged
The title selection changed, cf media_player_title_selection_changed in libvlc_event_t::u.
Definition libvlc_events.h:158
@ libvlc_MediaSubItemTreeAdded
Subitem tree was added to a media item.
Definition libvlc_events.h:90
@ libvlc_MediaPlayerOpening
Definition libvlc_events.h:106
@ libvlc_MediaPlayerTimeChanged
Definition libvlc_events.h:115
@ libvlc_MediaPlayerRecordChanged
Definition libvlc_events.h:160
@ libvlc_MediaSubItemAdded
Subitem was added to a media item.
Definition libvlc_events.h:71
@ libvlc_MediaPlayerMediaStopping
The current media set into the libvlc_media_player_t is stopping.
Definition libvlc_events.h:254
@ libvlc_MediaAttachedThumbnailsFound
One or more embedded thumbnails were found during the media preparsing The user can hold these pictur...
Definition libvlc_events.h:102
@ libvlc_MediaPlayerUncorked
Definition libvlc_events.h:137
@ libvlc_MediaMetaChanged
1 or several Metadata of a media item changed
Definition libvlc_events.h:66
@ libvlc_MediaPlayerSnapshotTaken
Definition libvlc_events.h:120
@ libvlc_MediaPlayerESAdded
A track was added, cf.
Definition libvlc_events.h:128
@ libvlc_MediaPlayerEncounteredError
Definition libvlc_events.h:114
@ libvlc_MediaPlayerPlaying
Definition libvlc_events.h:108
@ libvlc_MediaPlayerPositionChanged
Definition libvlc_events.h:116
@ libvlc_MediaPlayerESDeleted
A track was removed, cf.
Definition libvlc_events.h:131
@ libvlc_MediaPlayerProgramAdded
Definition libvlc_events.h:145
@ libvlc_MediaDurationChanged
Deprecated, use libvlc_MediaParsedChanged or libvlc_MediaPlayerLengthChanged.
Definition libvlc_events.h:75
@ libvlc_MediaPlayerProgramUpdated
Definition libvlc_events.h:148
@ libvlc_MediaPlayerESSelected
Tracks were selected or unselected, cf.
Definition libvlc_events.h:135
@ libvlc_MediaPlayerNothingSpecial
Definition libvlc_events.h:105
@ libvlc_MediaListViewItemAdded
Definition libvlc_events.h:194
@ libvlc_MediaPlayerChapterChanged
Definition libvlc_events.h:159
@ libvlc_MediaListViewItemDeleted
Definition libvlc_events.h:204
@ libvlc_MediaPlayerTitleListChanged
The title list changed, call libvlc_media_player_get_full_title_descriptions() to get the new list.
Definition libvlc_events.h:153
@ libvlc_MediaPlayerUnmuted
Definition libvlc_events.h:139
@ libvlc_MediaPlayerBuffering
Definition libvlc_events.h:107
@ libvlc_RendererDiscovererItemAdded
A new renderer item was found by a renderer discoverer.
Definition libvlc_events.h:235
@ libvlc_MediaPlayerAudioVolume
Definition libvlc_events.h:140
@ libvlc_MediaListPlayerNextItemSet
The current item of a media list player has changed to a different item.
Definition libvlc_events.h:222
@ libvlc_MediaPlayerCorked
Definition libvlc_events.h:136
@ libvlc_MediaListItemDeleted
A media item was deleted from a media list.
Definition libvlc_events.h:176
@ libvlc_MediaListViewWillDeleteItem
Definition libvlc_events.h:209
@ libvlc_MediaListPlayerStopped
Playback of a media list player has stopped.
Definition libvlc_events.h:228
@ libvlc_MediaPlayerStopping
Definition libvlc_events.h:113
@ libvlc_MediaThumbnailGenerated
A thumbnail generation for this media completed.
Definition libvlc_events.h:96
@ libvlc_MediaPlayerAudioDevice
Definition libvlc_events.h:141
@ libvlc_MediaListWillAddItem
A media item is about to get added to a media list.
Definition libvlc_events.h:171
@ libvlc_MediaParsedChanged
Parsing state of a media item changed.
Definition libvlc_events.h:82
@ libvlc_MediaPlayerMuted
Definition libvlc_events.h:138
@ libvlc_MediaListPlayerPlayed
Playback of a media list player has started.
Definition libvlc_events.h:215
@ libvlc_MediaPlayerVout
Definition libvlc_events.h:122
@ libvlc_MediaListViewWillAddItem
Definition libvlc_events.h:199
@ libvlc_MediaListItemAdded
A media item was added to a media list.
Definition libvlc_events.h:166
@ libvlc_MediaPlayerPausableChanged
Definition libvlc_events.h:118
@ libvlc_MediaPlayerProgramDeleted
Definition libvlc_events.h:146
@ libvlc_MediaPlayerPaused
Definition libvlc_events.h:109
@ libvlc_MediaPlayerProgramSelected
Definition libvlc_events.h:147
@ libvlc_MediaPlayerESUpdated
A track was updated, cf.
Definition libvlc_events.h:144
@ libvlc_MediaPlayerLengthChanged
Definition libvlc_events.h:121
@ libvlc_MediaPlayerSeekableChanged
Definition libvlc_events.h:117
@ libvlc_MediaListEndReached
A media list has reached the end.
Definition libvlc_events.h:188
@ libvlc_MediaListWillDeleteItem
A media item is about to get deleted from a media list.
Definition libvlc_events.h:181
@ libvlc_MediaPlayerForward
Definition libvlc_events.h:111
@ libvlc_MediaPlayerBackward
Definition libvlc_events.h:112
@ libvlc_RendererDiscovererItemDeleted
A previously discovered renderer item was deleted by a renderer discoverer.
Definition libvlc_events.h:242
@ libvlc_MediaPlayerStopped
Definition libvlc_events.h:110
@ libvlc_MediaPlayerMediaChanged
Definition libvlc_events.h:104
libvlc_track_type_t
Definition libvlc_media_track.h:45
libvlc_meta_t
Meta data types.
Definition libvlc_media.h:50
#define LIBVLC_DEPRECATED
Definition libvlc.h:52
LibVLC core external API.
struct libvlc_renderer_item_t libvlc_renderer_item_t
Definition libvlc_events.h:43
struct libvlc_picture_t libvlc_picture_t
Definition libvlc_events.h:45
struct libvlc_picture_list_t libvlc_picture_list_t
Definition libvlc_events.h:46
struct libvlc_media_list_t libvlc_media_list_t
Definition libvlc_events.h:48
struct libvlc_media_t libvlc_media_t
Definition libvlc_events.h:47
LibVLC media item/descriptor external API.
LibVLC media track.
A LibVLC event.
Definition libvlc_events.h:261
int type
Event type (see libvlc_event_e)
Definition libvlc_events.h:262
const libvlc_title_description_t * title
Definition libvlc_events.h:319
libvlc_media_t * new_media
Definition libvlc_events.h:382
float volume
Definition libvlc_events.h:424
int new_seekable
Definition libvlc_events.h:324
int new_pausable
Definition libvlc_events.h:328
struct libvlc_event_t::@141::@143 media_subitem_added
libvlc_picture_list_t * thumbnails
Definition libvlc_events.h:297
libvlc_time_t new_length
Definition libvlc_events.h:376
struct libvlc_event_t::@141::@173 media_player_audio_device
double new_position
Definition libvlc_events.h:311
struct libvlc_event_t::@141::@161 media_list_item_deleted
struct libvlc_event_t::@141::@169 media_player_es_selection_changed
struct libvlc_event_t::@141::@153 media_player_time_changed
struct libvlc_event_t::@141::@166 media_player_media_changed
libvlc_time_t new_time
Definition libvlc_events.h:315
struct libvlc_event_t::@141::@155 media_player_seekable_changed
void * p_obj
Object emitting the event.
Definition libvlc_events.h:263
struct libvlc_event_t::@141::@144 media_duration_changed
struct libvlc_event_t::@141::@149 media_attached_thumbnails_found
libvlc_media_t * new_child
Definition libvlc_events.h:273
libvlc_track_type_t i_type
Definition libvlc_events.h:394
struct libvlc_event_t::@141::@157 media_player_scrambled_changed
struct libvlc_event_t::@141::@154 media_player_title_selection_changed
int new_state
see libvlc_state_t
Definition libvlc_events.h:285
const char * recorded_file_path
Only valid when recording ends (recording == false)
Definition libvlc_events.h:436
libvlc_media_t * media
Definition libvlc_events.h:387
struct libvlc_event_t::@141::@152 media_player_position_changed
libvlc_picture_t * p_thumbnail
Definition libvlc_events.h:289
int i_unselected_id
Definition libvlc_events.h:418
struct libvlc_event_t::@141::@142 media_meta_changed
struct libvlc_event_t::@141::@159 media_list_item_added
struct libvlc_event_t::@141::@163 media_list_player_next_item_set
const char * psz_selected_id
Definition libvlc_events.h:406
float new_cache
Definition libvlc_events.h:303
struct libvlc_event_t::@141::@176 renderer_discoverer_item_deleted
struct libvlc_event_t::@141::@147 media_thumbnail_generated
struct libvlc_event_t::@141::@168 media_player_es_changed
struct libvlc_event_t::@141::@160 media_list_will_add_item
struct libvlc_event_t::@141::@146 media_state_changed
union libvlc_event_t::@141 u
Type-dependent event description.
const char * psz_unselected_id
Definition libvlc_events.h:405
struct libvlc_event_t::@141::@156 media_player_pausable_changed
struct libvlc_event_t::@141::@172 media_player_audio_volume
int i_selected_id
Definition libvlc_events.h:419
int new_count
Definition libvlc_events.h:336
const char * psz_id
Call libvlc_media_player_get_track_from_id() to get the track description.
Definition libvlc_events.h:398
struct libvlc_event_t::@141::@170 media_player_program_changed
struct libvlc_event_t::@141::@158 media_player_vout
int new_scrambled
Definition libvlc_events.h:332
bool recording
Definition libvlc_events.h:434
struct libvlc_event_t::@141::@165 media_player_length_changed
char * psz_filename
Definition libvlc_events.h:370
struct libvlc_event_t::@141::@148 media_subitemtree_added
const char * device
Definition libvlc_events.h:429
struct libvlc_event_t::@141::@145 media_parsed_changed
struct libvlc_event_t::@141::@164 media_player_snapshot_taken
libvlc_media_t * item
Definition libvlc_events.h:293
struct libvlc_event_t::@141::@175 renderer_discoverer_item_added
int64_t new_duration
Definition libvlc_events.h:277
struct libvlc_event_t::@141::@167 media_player_media_stopping
struct libvlc_event_t::@141::@171 media_player_program_selection_changed
int i_id
Deprecated, use psz_id.
Definition libvlc_events.h:395
struct libvlc_event_t::@141::@174 media_player_record_changed
struct libvlc_event_t::@141::@162 media_list_will_delete_item
libvlc_meta_t meta_type
Deprecated, any meta_type can change.
Definition libvlc_events.h:269
struct libvlc_event_t::@141::@150 media_player_buffering
int new_chapter
Definition libvlc_events.h:307
libvlc_renderer_item_t * item
Definition libvlc_events.h:441
struct libvlc_event_t::@141::@151 media_player_chapter_changed
int new_status
see libvlc_media_parsed_status_t
Definition libvlc_events.h:281
int index
Definition libvlc_events.h:320
Definition libvlc_media_player.h:66