VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_demux.h
Go to the documentation of this file.
1/*****************************************************************************
2 * vlc_demux.h: Demuxer descriptor, queries and methods
3 *****************************************************************************
4 * Copyright (C) 1999-2005 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_DEMUX_H
24#define VLC_DEMUX_H 1
25
26#include <stdlib.h>
27#include <string.h>
28
29#include <vlc_es.h>
30#include <vlc_stream.h>
31#include <vlc_es_out.h>
32
33/**
34 * \defgroup demux Demultiplexer
35 * \ingroup input
36 * Demultiplexers (file format parsers)
37 * @{
38 * \file
39 * Demultiplexer modules interface
40 */
41
42/* pf_demux return values */
43#define VLC_DEMUXER_EOF 0
44#define VLC_DEMUXER_EGENERIC -1
45#define VLC_DEMUXER_SUCCESS 1
46/* Demuxer has temporary control of some buffering and
47 * recovering from an underrun. A paced input should
48 * pause the clock accordingly. Not an error */
49#define VLC_DEMUXER_BUFFERING 2
51/* DEMUX_TEST_AND_CLEAR flags */
52#define INPUT_UPDATE_TITLE 0x0010
53#define INPUT_UPDATE_SEEKPOINT 0x0020
54#define INPUT_UPDATE_META 0x0040
55#define INPUT_UPDATE_TITLE_LIST 0x0100
57/* Demux module descriptor helpers */
58#define add_file_extension(ext) add_shortcut("ext-" ext)
60/* demux_meta_t is returned by "meta reader" module to the demuxer */
61typedef struct demux_meta_t
63 struct vlc_object_t obj;
64 input_item_t *p_item; /***< the input item that is being read */
66 vlc_meta_t *p_meta; /**< meta data */
68 int i_attachments; /**< number of attachments */
69 input_attachment_t **attachments; /**< array of attachments */
72/**
73 * Control query identifiers for use with demux_t.pf_control
74 *
75 * In the individual identifier description, the input stream refers to
76 * demux_t.s if non-NULL, and the output refers to demux_t.out.
77 *
78 * A demuxer is synchronous if it only accesses its input stream and the
79 * output from within its demux_t callbacks, i.e. demux.pf_demux and
80 * demux_t.pf_control.
81 *
82 * A demuxer is threaded if it accesses either or both input and output
83 * asynchronously.
84 *
85 * An access-demuxer is a demuxer without input, i.e. demux_t.s == NULL).
86 */
89 /** Checks whether the stream supports seeking.
90 * Can fail if seeking is not supported (same as returning false).
91 * \bug Failing should not be allowed.
92 *
93 * arg1 = bool * */
96 /** Checks whether (long) pause then stream resumption is supported.
97 * Can fail only if synchronous and <b>not</b> an access-demuxer. The
98 * underlying input stream then determines if pause is supported.
99 * \bug Failing should not be allowed.
100 *
101 * arg1= bool * */
102 DEMUX_CAN_PAUSE = 0x002,
104 /** Whether the stream can be read at an arbitrary pace.
105 * Cannot fail.
106 *
107 * arg1= bool * */
110 /** Retrieves the PTS delay (roughly the default buffer duration).
111 * Can fail only if synchronous and <b>not</b> an access-demuxer. The
112 * underlying input stream then determines the PTS delay.
113 *
114 * arg1= vlc_tick_t * */
115 DEMUX_GET_PTS_DELAY = 0x101,
117 /** Retrieves stream meta-data.
118 * Should fail if no meta-data were retrieved.
119 *
120 * arg1= vlc_meta_t * */
121 DEMUX_GET_META = 0x105,
123 /** Retrieves an estimate of signal quality and strength.
124 * Can fail.
125 *
126 * arg1=double *quality, arg2=double *strength */
127 DEMUX_GET_SIGNAL = 0x107,
129 /** Retrieves the demuxed content type
130 * Can fail if the control is not implemented
131 *
132 * arg1= int* */
133 DEMUX_GET_TYPE = 0x109,
135 /** Sets the paused or playing/resumed state.
136 *
137 * Streams are initially in playing state. The control always specifies a
138 * change from paused to playing (false) or from playing to paused (true)
139 * and streams are initially playing; a no-op cannot be requested.
140 *
141 * The control is never used if DEMUX_CAN_PAUSE fails.
142 * Can fail.
143 *
144 * arg1= bool */
145 DEMUX_SET_PAUSE_STATE = 0x200,
147 /** Seeks to the beginning of a title.
148 *
149 * The control is never used if DEMUX_GET_TITLE_INFO fails.
150 * Can fail.
151 *
152 * arg1= int */
155 /** Seeks to the beginning of a chapter of the current title.
156 *
157 * The control is never used if DEMUX_GET_TITLE_INFO fails.
158 * Can fail.
159 *
160 * arg1= int */
161 DEMUX_SET_SEEKPOINT, /* arg1= int can fail */
163 /** Check which INPUT_UPDATE_XXX flag is set and reset the ones set.
164 *
165 * The unsigned* argument is set with the flags needed to be checked,
166 * on return it contains the values that were reset during the call
167 *
168 * arg1= unsigned * */
169 DEMUX_TEST_AND_CLEAR_FLAGS, /* arg1= unsigned* can fail */
171 /** Read the title number currently playing
172 *
173 * Can fail.
174 *
175 * arg1= int * */
176 DEMUX_GET_TITLE, /* arg1= int* can fail */
178 /* Read the seekpoint/chapter currently playing
179 *
180 * Can fail.
181 *
182 * arg1= int * */
183 DEMUX_GET_SEEKPOINT, /* arg1= int* can fail */
185 /* I. Common queries to access_demux and demux */
186 /* POSITION double between 0.0 and 1.0 */
187 DEMUX_GET_POSITION = 0x300, /* arg1= double * res= */
188 DEMUX_SET_POSITION, /* arg1= double arg2= bool b_precise res=can fail */
190 /* LENGTH/TIME in microsecond, 0 if unknown */
191 DEMUX_GET_LENGTH, /* arg1= vlc_tick_t * res= */
192 /**
193 * Get time and live state
194 *
195 * Set arg2 to true if the stream is live. In that case DEMUX_GET_LENGTH
196 * will represent a seek range, and DEMUX_GET_POSITION the position within
197 * that seek range.
198 * arg1= vlc_tick_t *, arg2 bool * res= */
200 DEMUX_SET_TIME, /* arg1= vlc_tick_t arg2= bool b_precise res=can fail */
201 /* Normal or original time, used mainly by the ts module */
202 DEMUX_GET_NORMAL_TIME, /* arg1= vlc_tick_t * res= can fail, in that case VLC_TICK_0 will be used as NORMAL_TIME */
204 /**
205 * \todo Document
206 *
207 * \warning The prototype is different from STREAM_GET_TITLE_INFO
208 *
209 * Can fail, meaning there is only one title and one chapter.
210 *
211 * arg1= input_title_t ***, arg2=int *, arg3=int *pi_title_offset(0),
212 * arg4= int *pi_seekpoint_offset(0) */
215 /* DEMUX_SET_GROUP_* / DEMUX_SET_ES is only a hint for demuxer (mainly DVB)
216 * to avoid parsing everything (you should not use this to call
217 * es_out_Control()).
218 * If you don't know what to do with it, just IGNORE it: it is safe(r). */
221 DEMUX_SET_GROUP_LIST, /* arg1= size_t, arg2= const int *, can fail */
222 DEMUX_SET_ES, /* arg1= int can fail */
223 DEMUX_SET_ES_LIST, /* arg1= size_t, arg2= const int * (can be NULL) can fail */
225 /* Ask the demux to demux until the given date at the next pf_demux call
226 * but not more (and not less, at the precision available of course).
227 * XXX: not mandatory (except for subtitle demux) but will help a lot
228 * for multi-input
229 */
230 DEMUX_SET_NEXT_DEMUX_TIME, /* arg1= vlc_tick_t can fail */
231 /* FPS for correct subtitles handling */
232 DEMUX_GET_FPS, /* arg1= double * res=can fail */
234 /* Meta data */
235 DEMUX_HAS_UNSUPPORTED_META, /* arg1= bool * res can fail */
237 /*
238 * Fetches attachment from the demux.
239 * The returned attachments are owned by the demuxer and must not be modified
240 * arg1=input_attachment_t***, int* res=can fail
241 */
244 /* RECORD you are ensured that it is never called twice with the same state
245 * you should accept it only if the stream can be recorded without
246 * any modification or header addition. */
247 DEMUX_CAN_RECORD, /* arg1=bool* res=can fail(assume false) */
248 /**
249 * \todo Document
250 *
251 * \warning The prototype is different from STREAM_SET_RECORD_STATE
252 *
253 * The control is never used if DEMUX_CAN_RECORD fails or returns false.
254 * Can fail.
255 *
256 * arg1= bool arg2= string */
259 /* II. Specific access_demux queries */
260
261 /* DEMUX_CAN_CONTROL_RATE is called only if DEMUX_CAN_CONTROL_PACE has
262 * returned false. *pb_rate should be true when the rate can be changed
263 * (using DEMUX_SET_RATE). */
264 DEMUX_CAN_CONTROL_RATE, /* arg1= bool*pb_rate */
265 /* DEMUX_SET_RATE is called only if DEMUX_CAN_CONTROL_RATE has returned true.
266 * It should return the value really used in *p_rate */
267 DEMUX_SET_RATE, /* arg1= float*p_rate res=can fail */
269 /* Menu (VCD/DVD/BD) Navigation */
270 /** Activate the navigation item selected. Can fail */
272 /** Use the up arrow to select a navigation item above. Can fail */
274 /** Use the down arrow to select a navigation item under. Can fail */
276 /** Use the left arrow to select a navigation item on the left. Can fail */
278 /** Use the right arrow to select a navigation item on the right. Can fail */
280 /** Activate the popup Menu (for BD). Can fail */
282 /** Activate disc Root Menu. Can fail */
283 DEMUX_NAV_MENU, /* res=can fail */
284 /** Enable/Disable a demux filter
285 * \warning This has limited support, and is likely to break if more than
286 * a single demux_filter is present in the chain. This is not guaranteed to
287 * work in future VLC versions, nor with all demux filters
288 */
292
293/*************************************************************************
294 * Main Demux
295 *************************************************************************/
296
297VLC_API demux_t *demux_New( vlc_object_t *p_obj, const char *module_name,
298 const char *url, stream_t *s, es_out_t *out );
299
300static inline void demux_Delete(demux_t *demux)
302 vlc_stream_Delete(demux);
303}
304
305VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end,
306 int64_t i_bitrate, int i_align, int i_query, va_list args );
307
308VLC_API int demux_Demux( demux_t *p_demux ) VLC_USED;
309VLC_API int demux_vaControl( demux_t *p_demux, int i_query, va_list args );
310
311static inline int demux_Control( demux_t *p_demux, int i_query, ... )
313 va_list args;
314 int i_result;
315
316 va_start( args, i_query );
317 i_result = demux_vaControl( p_demux, i_query, args );
318 va_end( args );
319 return i_result;
320}
321
322/*************************************************************************
323 * Miscellaneous helpers for demuxers
324 *************************************************************************/
325
326VLC_USED static inline bool vlc_demux_CanSeek(demux_t *demux)
328 bool can_seek = false;
329 demux_Control(demux, DEMUX_CAN_SEEK, &can_seek);
330 return can_seek;
331}
332
333VLC_USED static inline bool vlc_demux_CanPause(demux_t *demux)
335 bool can_pause = false;
336 demux_Control(demux, DEMUX_CAN_PAUSE, &can_pause);
337 return can_pause;
338}
339
340VLC_USED static inline bool vlc_demux_CanPace(demux_t *demux)
342 bool can_control_pace = false;
343 demux_Control(demux, DEMUX_CAN_CONTROL_PACE, &can_control_pace);
344 return can_control_pace;
345}
346
347VLC_USED static inline bool vlc_demux_CanRate(demux_t *demux)
349 bool can_control_rate = false;
350 demux_Control(demux, DEMUX_CAN_CONTROL_RATE, &can_control_rate);
351 return can_control_rate;
352}
353
354VLC_USED static inline bool vlc_demux_CanRecord(demux_t *demux)
356 bool can_record = false;
357 demux_Control(demux, DEMUX_CAN_RECORD, &can_record);
358 return can_record;
359}
360
361VLC_USED static inline bool vlc_demux_HasUnsupportedMeta(demux_t *demux)
363 bool has_unsupported_meta = false;
364 demux_Control(demux, DEMUX_HAS_UNSUPPORTED_META, &has_unsupported_meta);
365 return has_unsupported_meta;
366}
367
368VLC_USED static inline int vlc_demux_GetPtsDelay(demux_t *demux, vlc_tick_t *pts_delay)
370 return demux_Control(demux, DEMUX_GET_PTS_DELAY, pts_delay);
371}
372
373VLC_USED static inline int vlc_demux_GetSeekpoint(demux_t *demux, int *seekpoint)
375 return demux_Control(demux, DEMUX_GET_SEEKPOINT, seekpoint);
376}
377
378VLC_USED static inline int vlc_demux_GetSignal(demux_t *demux, double *quality, double *strength)
380 return demux_Control(demux, DEMUX_GET_SIGNAL, quality, strength);
381}
382
383VLC_USED static inline int vlc_demux_GetTitle(demux_t *demux, int *title)
385 return demux_Control(demux, DEMUX_GET_TITLE, title);
386}
387
388VLC_USED static inline int vlc_demux_GetMeta(demux_t *demux, vlc_meta_t *meta)
390 return demux_Control(demux, DEMUX_GET_META, meta);
391}
392
393VLC_USED static inline int vlc_demux_GetType(demux_t *demux, int *type)
395 return demux_Control(demux, DEMUX_GET_TYPE, type);
396}
397
398VLC_USED static inline int vlc_demux_GetTitleInfo(demux_t *demux, input_title_t ***title_info, int *size, int *pi_title_offset, int *pi_seekpoint_offset)
400 return demux_Control(demux, DEMUX_GET_TITLE_INFO, title_info, size, pi_title_offset, pi_seekpoint_offset);
401}
402
403VLC_USED static inline int vlc_demux_GetPosition(demux_t *demux, double *position)
405 return demux_Control(demux, DEMUX_GET_POSITION, position);
406}
407
408VLC_USED static inline int vlc_demux_GetLength(demux_t *demux, vlc_tick_t *length)
410 return demux_Control(demux, DEMUX_GET_LENGTH, length);
411}
412
413VLC_USED static inline int vlc_demux_GetTime(demux_t *demux, vlc_tick_t *time)
415 return demux_Control(demux, DEMUX_GET_TIME, time);
416}
417
418VLC_USED static inline int vlc_demux_GetNormalTime(demux_t *demux, vlc_tick_t *normal_time)
420 return demux_Control(demux, DEMUX_GET_NORMAL_TIME, normal_time);
421}
422
423VLC_USED static inline int vlc_demux_GetFPS(demux_t *demux, double *fps)
425 return demux_Control(demux, DEMUX_GET_FPS, fps);
426}
427
428VLC_USED static inline int vlc_demux_GetAttachments(demux_t *demux, input_attachment_t ***attachments)
430 return demux_Control(demux, DEMUX_GET_ATTACHMENTS, attachments);
431}
432
433VLC_USED static inline int vlc_demux_SetPauseState(demux_t *demux, bool pause_state)
435 return demux_Control(demux, DEMUX_SET_PAUSE_STATE, pause_state);
436}
437
438VLC_USED static inline int vlc_demux_SetSeekPoint(demux_t *demux, int seekpoint)
440 return demux_Control(demux, DEMUX_SET_SEEKPOINT, seekpoint);
441}
442
443VLC_USED static inline int vlc_demux_SetTitle(demux_t *demux, int title)
445 return demux_Control(demux, DEMUX_SET_TITLE, title);
446}
447
448VLC_USED static inline int vlc_demux_SetRate(demux_t *demux, float rate)
450 return demux_Control(demux, DEMUX_SET_RATE, rate);
451}
452
453VLC_USED static inline int vlc_demux_SetRecordState(demux_t *demux, bool record_state, const char *dir_path, const char *ext)
455 return demux_Control(demux, DEMUX_SET_RECORD_STATE, record_state, dir_path, ext);
456}
457
458VLC_USED static inline int vlc_demux_NavActivate(demux_t *demux)
460 return demux_Control(demux, DEMUX_NAV_ACTIVATE);
461}
462
463VLC_USED static inline int vlc_demux_NavUp(demux_t *demux)
465 return demux_Control(demux, DEMUX_NAV_UP);
466}
467
468VLC_USED static inline int vlc_demux_NavDown(demux_t *demux)
470 return demux_Control(demux, DEMUX_NAV_DOWN);
471}
472
473VLC_USED static inline int vlc_demux_NavLeft(demux_t *demux)
475 return demux_Control(demux, DEMUX_NAV_LEFT);
476}
477
478VLC_USED static inline int vlc_demux_NavRight(demux_t *demux)
480 return demux_Control(demux, DEMUX_NAV_RIGHT);
481}
482
483VLC_USED static inline int vlc_demux_NavPopup(demux_t *demux)
485 return demux_Control(demux, DEMUX_NAV_POPUP);
486}
487
488VLC_USED static inline int vlc_demux_NavMenu(demux_t *demux)
490 return demux_Control(demux, DEMUX_NAV_MENU);
491}
492
493VLC_USED static inline int vlc_demux_FilterEnable(demux_t *demux)
495 return demux_Control(demux, DEMUX_FILTER_ENABLE);
496}
497
498VLC_USED static inline int vlc_demux_FilterDisable(demux_t *demux)
500 return demux_Control(demux, DEMUX_FILTER_DISABLE);
501}
502
503#ifndef __cplusplus
504static inline void demux_UpdateTitleFromStream( demux_t *demux,
505 int *restrict titlep, int *restrict seekpointp,
506 unsigned *restrict updatep )
507{
508 stream_t *s = demux->s;
509 unsigned title, seekpoint;
510
512 && title != (unsigned)*titlep )
513 {
514 *titlep = title;
515 *updatep |= INPUT_UPDATE_TITLE;
516 }
517
519 &seekpoint ) == VLC_SUCCESS
520 && seekpoint != (unsigned)*seekpointp )
521 {
522 *seekpointp = seekpoint;
523 *updatep |= INPUT_UPDATE_SEEKPOINT;
524 }
525}
526# define demux_UpdateTitleFromStream(demux) \
527 demux_UpdateTitleFromStream(demux, \
528 &((demux_sys_t *)((demux)->p_sys))->current_title, \
529 &((demux_sys_t *)((demux)->p_sys))->current_seekpoint, \
530 &((demux_sys_t *)((demux)->p_sys))->updates)
531#endif
532
534static inline bool demux_IsPathExtension( demux_t *p_demux, const char *psz_extension )
536 const char *name = (p_demux->psz_filepath != NULL) ? p_demux->psz_filepath
537 : p_demux->psz_location;
538 const char *psz_ext = strrchr ( name, '.' );
539 if( !psz_ext || strcasecmp( psz_ext, psz_extension ) )
540 return false;
541 return true;
542}
543
545static inline bool demux_IsContentType(demux_t *demux, const char *type)
547 return stream_IsMimeType(demux->s, type);
548}
549
551static inline bool demux_IsForced( demux_t *p_demux, const char *psz_name )
553 if( p_demux->psz_name == NULL || strcmp( p_demux->psz_name, psz_name ) )
554 return false;
555 return true;
556}
557
558static inline int demux_SetPosition( demux_t *p_demux, double pos, bool precise )
560 if( pos < 0.f )
561 pos = 0.f;
562 else if( pos > 1.f )
563 pos = 1.f;
564 return demux_Control( p_demux, DEMUX_SET_POSITION, pos, precise );
565}
566
567static inline int demux_SetTime( demux_t *p_demux, vlc_tick_t time, bool precise )
569 if( time < 0 )
570 time = 0;
571 return demux_Control( p_demux, DEMUX_SET_TIME, time, precise );
572}
573
574/**
575 * This function will create a packetizer suitable for a demuxer that parses
576 * elementary stream.
577 *
578 * The provided es_format_t will be cleaned on error or by
579 * demux_PacketizerDestroy.
580 */
581VLC_API decoder_t * demux_PacketizerNew( vlc_object_t *p_demux, es_format_t *p_fmt, const char *psz_msg ) VLC_USED;
582
583/**
584 * This function will destroy a packetizer create by demux_PacketizerNew.
585 */
586VLC_API void demux_PacketizerDestroy( decoder_t *p_packetizer );
587
588/* */
589#define DEMUX_INIT_COMMON() do { \
590 p_demux->pf_read = NULL; \
591 p_demux->pf_block = NULL; \
592 p_demux->pf_seek = NULL; \
593 p_demux->pf_control = Control; \
594 p_demux->pf_demux = Demux; \
595 p_demux->p_sys = calloc( 1, sizeof( demux_sys_t ) ); \
596 if( !p_demux->p_sys ) return VLC_ENOMEM;\
597 } while(0)
598
599/**
600 * \defgroup chained_demux Chained demultiplexer
601 * Demultiplexers wrapped by another demultiplexer
602 * @{
603 */
604
607/**
608 * Creates a chained demuxer.
609 *
610 * This creates a thread running a demuxer whose input stream is generated
611 * directly by the caller. This typically handles some sort of stream within a
612 * stream, e.g. MPEG-TS within something else.
613 *
614 * \note There are a number of limitations to this approach. The chained
615 * demuxer is run asynchronously in a separate thread. Most demuxer controls
616 * are synchronous and therefore unavailable in this case. Also the input
617 * stream is a simple FIFO, so the chained demuxer cannot perform seeks.
618 * Lastly, most errors cannot be detected.
619 *
620 * \param parent parent VLC object
621 * \param name chained demux module name (e.g. "ts")
622 * \param out elementary stream output for the chained demux
623 * \return a non-NULL pointer on success, NULL on failure.
624 */
626 const char *name,
627 es_out_t *out);
628
629/**
630 * Destroys a chained demuxer.
631 *
632 * Sends an end-of-stream to the chained demuxer, and releases all underlying
633 * allocated resources.
634 */
636
637/**
638 * Sends data to a chained demuxer.
639 *
640 * This queues data for a chained demuxer to consume.
641 *
642 * \param demux the chained demuxer instance to send the block to
643 * \param block data block to queue
644 */
646
647/**
648 * Controls a chained demuxer.
649 *
650 * This performs a <b>demux</b> (i.e. DEMUX_...) control request on a chained
651 * demux.
652 *
653 * \note In most cases, vlc_demux_chained_Control() should be used instead.
654 * \warning As per vlc_demux_chained_New(), most demux controls are not, and
655 * cannot be, supported; VLC_EGENERIC is returned.
656 *
657 * \param demux the chained demuxer instance to send the request to
658 * \param query demux control (see \ref demux_query_e)
659 * \param args variable arguments (depending on the query)
660 */
662 int query, va_list args);
663
664static inline int vlc_demux_chained_Control(vlc_demux_chained_t *dc, int query,
665 ...)
666{
667 va_list ap;
668 int ret;
669
670 va_start(ap, query);
671 ret = vlc_demux_chained_ControlVa(dc, query, ap);
672 va_end(ap);
673 return ret;
674}
675
676/**
677 * @}
678 */
679
680/**
681 * @}
682 */
683
684#endif
#define VLC_USED
Definition fourcc_gen.c:32
#define VLC_API
Definition fourcc_gen.c:31
static int vlc_demux_chained_Control(vlc_demux_chained_t *dc, int query,...)
Definition vlc_demux.h:665
void vlc_demux_chained_Delete(vlc_demux_chained_t *)
Destroys a chained demuxer.
Definition demux_chained.c:164
int vlc_demux_chained_ControlVa(vlc_demux_chained_t *demux, int query, va_list args)
Controls a chained demuxer.
Definition demux_chained.c:139
vlc_demux_chained_t * vlc_demux_chained_New(vlc_object_t *parent, const char *name, es_out_t *out)
Creates a chained demuxer.
Definition demux_chained.c:102
void vlc_demux_chained_Send(vlc_demux_chained_t *demux, block_t *block)
Sends data to a chained demuxer.
Definition demux_chained.c:134
static int vlc_demux_GetAttachments(demux_t *demux, input_attachment_t ***attachments)
Definition vlc_demux.h:429
demux_t * demux_New(vlc_object_t *p_obj, const char *module_name, const char *url, stream_t *s, es_out_t *out)
Definition demux.c:73
static int vlc_demux_SetTitle(demux_t *demux, int title)
Definition vlc_demux.h:444
static int vlc_demux_NavDown(demux_t *demux)
Definition vlc_demux.h:469
static int demux_SetTime(demux_t *p_demux, vlc_tick_t time, bool precise)
Definition vlc_demux.h:568
static int vlc_demux_NavUp(demux_t *demux)
Definition vlc_demux.h:464
static int vlc_demux_GetPtsDelay(demux_t *demux, vlc_tick_t *pts_delay)
Definition vlc_demux.h:369
static bool demux_IsForced(demux_t *p_demux, const char *psz_name)
Definition vlc_demux.h:552
int demux_vaControlHelper(stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args)
Definition demux.c:542
static int vlc_demux_GetTitleInfo(demux_t *demux, input_title_t ***title_info, int *size, int *pi_title_offset, int *pi_seekpoint_offset)
Definition vlc_demux.h:399
#define demux_UpdateTitleFromStream(demux)
Definition vlc_demux.h:527
static int vlc_demux_GetType(demux_t *demux, int *type)
Definition vlc_demux.h:394
static int vlc_demux_NavRight(demux_t *demux)
Definition vlc_demux.h:479
#define INPUT_UPDATE_SEEKPOINT
Definition vlc_demux.h:54
#define INPUT_UPDATE_TITLE
Definition vlc_demux.h:53
static int demux_SetPosition(demux_t *p_demux, double pos, bool precise)
Definition vlc_demux.h:559
static int vlc_demux_GetSeekpoint(demux_t *demux, int *seekpoint)
Definition vlc_demux.h:374
static int vlc_demux_GetPosition(demux_t *demux, double *position)
Definition vlc_demux.h:404
static int vlc_demux_SetPauseState(demux_t *demux, bool pause_state)
Definition vlc_demux.h:434
static bool vlc_demux_CanPace(demux_t *demux)
Definition vlc_demux.h:341
static int vlc_demux_GetNormalTime(demux_t *demux, vlc_tick_t *normal_time)
Definition vlc_demux.h:419
decoder_t * demux_PacketizerNew(vlc_object_t *p_demux, es_format_t *p_fmt, const char *psz_msg)
This function will create a packetizer suitable for a demuxer that parses elementary stream.
Definition demux.c:684
demux_query_e
Control query identifiers for use with demux_t.pf_control.
Definition vlc_demux.h:89
static int vlc_demux_GetTitle(demux_t *demux, int *title)
Definition vlc_demux.h:384
static bool vlc_demux_CanSeek(demux_t *demux)
Definition vlc_demux.h:327
static int vlc_demux_GetFPS(demux_t *demux, double *fps)
Definition vlc_demux.h:424
void demux_PacketizerDestroy(decoder_t *p_packetizer)
This function will destroy a packetizer create by demux_PacketizerNew.
Definition demux.c:715
static int vlc_demux_SetSeekPoint(demux_t *demux, int seekpoint)
Definition vlc_demux.h:439
static int vlc_demux_FilterDisable(demux_t *demux)
Definition vlc_demux.h:499
static int vlc_demux_NavActivate(demux_t *demux)
Definition vlc_demux.h:459
static bool vlc_demux_CanPause(demux_t *demux)
Definition vlc_demux.h:334
static int vlc_demux_SetRecordState(demux_t *demux, bool record_state, const char *dir_path, const char *ext)
Definition vlc_demux.h:454
static int demux_Control(demux_t *p_demux, int i_query,...)
Definition vlc_demux.h:312
static int vlc_demux_GetMeta(demux_t *demux, vlc_meta_t *meta)
Definition vlc_demux.h:389
static int vlc_demux_FilterEnable(demux_t *demux)
Definition vlc_demux.h:494
static int vlc_demux_NavMenu(demux_t *demux)
Definition vlc_demux.h:489
static bool demux_IsContentType(demux_t *demux, const char *type)
Definition vlc_demux.h:546
static void demux_Delete(demux_t *demux)
Definition vlc_demux.h:301
static int vlc_demux_GetLength(demux_t *demux, vlc_tick_t *length)
Definition vlc_demux.h:409
static bool vlc_demux_CanRecord(demux_t *demux)
Definition vlc_demux.h:355
static int vlc_demux_SetRate(demux_t *demux, float rate)
Definition vlc_demux.h:449
static int vlc_demux_GetTime(demux_t *demux, vlc_tick_t *time)
Definition vlc_demux.h:414
int demux_Demux(demux_t *p_demux)
Definition demux.c:220
static bool vlc_demux_HasUnsupportedMeta(demux_t *demux)
Definition vlc_demux.h:362
static bool vlc_demux_CanRate(demux_t *demux)
Definition vlc_demux.h:348
static int vlc_demux_NavPopup(demux_t *demux)
Definition vlc_demux.h:484
static bool demux_IsPathExtension(demux_t *p_demux, const char *psz_extension)
Definition vlc_demux.h:535
static int vlc_demux_NavLeft(demux_t *demux)
Definition vlc_demux.h:474
int demux_vaControl(demux_t *p_demux, int i_query, va_list args)
Definition demux.c:247
static int vlc_demux_GetSignal(demux_t *demux, double *quality, double *strength)
Definition vlc_demux.h:379
@ DEMUX_GET_SIGNAL
Retrieves an estimate of signal quality and strength.
Definition vlc_demux.h:128
@ DEMUX_TEST_AND_CLEAR_FLAGS
Check which INPUT_UPDATE_XXX flag is set and reset the ones set.
Definition vlc_demux.h:170
@ DEMUX_GET_TIME
Get time and live state.
Definition vlc_demux.h:200
@ DEMUX_GET_TYPE
Retrieves the demuxed content type Can fail if the control is not implemented.
Definition vlc_demux.h:134
@ DEMUX_GET_ATTACHMENTS
Definition vlc_demux.h:243
@ DEMUX_GET_PTS_DELAY
Retrieves the PTS delay (roughly the default buffer duration).
Definition vlc_demux.h:116
@ DEMUX_NAV_LEFT
Use the left arrow to select a navigation item on the left.
Definition vlc_demux.h:278
@ DEMUX_NAV_MENU
Activate disc Root Menu.
Definition vlc_demux.h:284
@ DEMUX_CAN_CONTROL_PACE
Whether the stream can be read at an arbitrary pace.
Definition vlc_demux.h:109
@ DEMUX_GET_POSITION
Definition vlc_demux.h:188
@ DEMUX_SET_TITLE
Seeks to the beginning of a title.
Definition vlc_demux.h:154
@ DEMUX_SET_RECORD_STATE
Definition vlc_demux.h:258
@ DEMUX_NAV_ACTIVATE
Activate the navigation item selected.
Definition vlc_demux.h:272
@ DEMUX_SET_ES
Definition vlc_demux.h:223
@ DEMUX_SET_TIME
Definition vlc_demux.h:201
@ DEMUX_NAV_DOWN
Use the down arrow to select a navigation item under.
Definition vlc_demux.h:276
@ DEMUX_SET_SEEKPOINT
Seeks to the beginning of a chapter of the current title.
Definition vlc_demux.h:162
@ DEMUX_SET_GROUP_LIST
Definition vlc_demux.h:222
@ DEMUX_SET_PAUSE_STATE
Sets the paused or playing/resumed state.
Definition vlc_demux.h:146
@ DEMUX_CAN_PAUSE
Checks whether (long) pause then stream resumption is supported.
Definition vlc_demux.h:103
@ DEMUX_CAN_RECORD
Definition vlc_demux.h:248
@ DEMUX_HAS_UNSUPPORTED_META
Definition vlc_demux.h:236
@ DEMUX_SET_GROUP_ALL
Definition vlc_demux.h:221
@ DEMUX_GET_NORMAL_TIME
Definition vlc_demux.h:203
@ DEMUX_SET_GROUP_DEFAULT
Definition vlc_demux.h:220
@ DEMUX_GET_TITLE
Read the title number currently playing.
Definition vlc_demux.h:177
@ DEMUX_NAV_UP
Use the up arrow to select a navigation item above.
Definition vlc_demux.h:274
@ DEMUX_GET_FPS
Definition vlc_demux.h:233
@ DEMUX_GET_LENGTH
Definition vlc_demux.h:192
@ DEMUX_SET_ES_LIST
Definition vlc_demux.h:224
@ DEMUX_NAV_POPUP
Activate the popup Menu (for BD).
Definition vlc_demux.h:282
@ DEMUX_SET_POSITION
Definition vlc_demux.h:189
@ DEMUX_SET_RATE
Definition vlc_demux.h:268
@ DEMUX_CAN_CONTROL_RATE
Definition vlc_demux.h:265
@ DEMUX_CAN_SEEK
Checks whether the stream supports seeking.
Definition vlc_demux.h:95
@ DEMUX_FILTER_DISABLE
Definition vlc_demux.h:291
@ DEMUX_SET_NEXT_DEMUX_TIME
Definition vlc_demux.h:231
@ DEMUX_GET_SEEKPOINT
Definition vlc_demux.h:184
@ DEMUX_GET_TITLE_INFO
Definition vlc_demux.h:214
@ DEMUX_GET_META
Retrieves stream meta-data.
Definition vlc_demux.h:122
@ DEMUX_FILTER_ENABLE
Enable/Disable a demux filter.
Definition vlc_demux.h:290
@ DEMUX_NAV_RIGHT
Use the right arrow to select a navigation item on the right.
Definition vlc_demux.h:280
#define VLC_SUCCESS
No error.
Definition vlc_common.h:480
static bool stream_IsMimeType(stream_t *s, const char *type)
Checks for a MIME type.
Definition vlc_stream.h:635
void vlc_stream_Delete(stream_t *s)
Destroy a stream.
Definition stream.c:143
static int vlc_stream_Control(stream_t *s, int query,...)
Definition vlc_stream.h:411
@ STREAM_GET_TITLE
arg1=(unsigned *) res=can fail
Definition vlc_stream.h:268
@ STREAM_GET_SEEKPOINT
arg1=(unsigned *) res=can fail
Definition vlc_stream.h:269
const char name[16]
Definition httpd.c:1299
const char psz_ext[7]
Definition image.c:577
Definition vlc_codec.h:102
Definition vlc_demux.h:63
int i_attachments
number of attachments
Definition vlc_demux.h:69
vlc_meta_t * p_meta
meta data
Definition vlc_demux.h:67
input_attachment_t ** attachments
array of attachments
Definition vlc_demux.h:70
input_item_t * p_item
Definition vlc_demux.h:65
struct vlc_object_t obj
Definition vlc_demux.h:64
Definition vlc_es.h:617
Definition vlc_es_out.h:142
Definition vlc_input.h:168
Describes an input and is used to spawn input_thread_t objects.
Definition vlc_input_item.h:98
Definition vlc_input.h:102
stream_t definition
Definition vlc_stream.h:135
char * psz_name
Definition vlc_stream.h:138
stream_t * s
Input stream.
Definition vlc_stream.h:153
const char * psz_location
Location (URL with the scheme stripped).
Definition vlc_stream.h:140
char * psz_filepath
Local file path (if applicable).
Definition vlc_stream.h:141
Definition demux_chained.c:36
es_out_t * out
Definition demux_chained.c:50
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.
struct vlc_frame_t block_t
Definition vlc_common.h:447
struct stream_t demux_t
Definition vlc_common.h:384
This file defines the elementary streams format types.
Elementary streams output interface.
int strcasecmp(const char *, const char *)
Byte streams and byte stream filter modules interface.
int64_t vlc_tick_t
High precision date or time interval.
Definition vlc_tick.h:48