1
1
/*****************************************************************************
2
2
* vlc_input.h: Core input structures
3
3
*****************************************************************************
4
* Copyright (C) 1999-2006 the VideoLAN team
5
* $Id: 4b161b8ca903d938106c531abb8a0ecfaab6c89e $
4
* Copyright (C) 1999-2006 VLC authors and VideoLAN
5
* $Id: 7d8320a75ce9b2263aa3ec1fe34090cc4f7cf732 $
7
7
* Authors: Christophe Massiot <massiot@via.ecp.fr>
8
8
* Laurent Aimar <fenrir@via.ecp.fr>
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
10
* This program is free software; you can redistribute it and/or modify it
11
* under the terms of the GNU Lesser General Public License as published by
12
* the Free Software Foundation; either version 2.1 of the License, or
13
13
* (at your option) any later version.
15
15
* This program is distributed in the hope that it will be useful,
16
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Lesser General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
20
* You should have received a copy of the GNU Lesser General Public License
21
* along with this program; if not, write to the Free Software Foundation,
22
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23
23
*****************************************************************************/
25
25
/* __ is need because conflict with <vlc/input.h> */
311
309
* The read-write variables are:
312
310
* - state (\see input_state_e)
313
* - rate, rate-slower, rate-faster
314
312
* - position, position-offset
315
313
* - time, time-offset
316
314
* - title, next-title, prev-title
479
477
INPUT_DEL_INFO, /* arg1= char* arg2= char* res=can fail */
480
478
INPUT_SET_NAME, /* arg1= char* res=can fail */
482
/* Input config options */
483
INPUT_ADD_OPTION, /* arg1= char * arg2= char * res=can fail*/
485
480
/* Input properties */
486
481
INPUT_GET_VIDEO_FPS, /* arg1= double * res=can fail */
494
489
INPUT_DEL_BOOKMARK, /* arg1= seekpoint_t * res=can fail */
495
490
INPUT_SET_BOOKMARK, /* arg1= int res=can fail */
493
INPUT_GET_TITLE_INFO, /* arg1=input_title_t** arg2= int * res=can fail */
497
495
/* Attachments */
498
496
INPUT_GET_ATTACHMENTS, /* arg1=input_attachment_t***, arg2=int* res=can fail */
499
497
INPUT_GET_ATTACHMENT, /* arg1=input_attachment_t**, arg2=char* res=can fail */
512
510
/* Input ressources
513
511
* XXX You must call vlc_object_release as soon as possible */
514
INPUT_GET_AOUT, /* arg1=aout_instance_t ** res=can fail */
512
INPUT_GET_AOUT, /* arg1=audio_output_t ** res=can fail */
515
513
INPUT_GET_VOUTS, /* arg1=vout_thread_t ***, size_t * res=can fail */
516
INPUT_GET_ES_OBJECTS, /* arg1=int id, vlc_object_t **dec, vout_thread_t **, aout_instance_t ** */
514
INPUT_GET_ES_OBJECTS, /* arg1=int id, vlc_object_t **dec, vout_thread_t **, audio_output_t ** */
518
516
/* External clock managments */
519
517
INPUT_GET_PCR_SYSTEM, /* arg1=mtime_t *, arg2=mtime_t * res=can fail */
527
525
*****************************************************************************/
529
VLC_EXPORT( input_thread_t *, input_Create, ( vlc_object_t *p_parent, input_item_t *, const char *psz_log, input_resource_t * ) );
527
VLC_API input_thread_t * input_Create( vlc_object_t *p_parent, input_item_t *, const char *psz_log, input_resource_t * ) VLC_USED;
530
528
#define input_Create(a,b,c,d) input_Create(VLC_OBJECT(a),b,c,d)
532
VLC_EXPORT( input_thread_t *, input_CreateAndStart, ( vlc_object_t *p_parent, input_item_t *, const char *psz_log ) );
530
VLC_API input_thread_t * input_CreateAndStart( vlc_object_t *p_parent, input_item_t *, const char *psz_log ) VLC_USED;
533
531
#define input_CreateAndStart(a,b,c) input_CreateAndStart(VLC_OBJECT(a),b,c)
535
VLC_EXPORT( int, input_Start, ( input_thread_t * ) );
537
VLC_EXPORT( void, input_Stop, ( input_thread_t *, bool b_abort ) );
539
VLC_EXPORT( int, input_Read, ( vlc_object_t *, input_item_t * ) );
533
VLC_API int input_Start( input_thread_t * );
535
VLC_API void input_Stop( input_thread_t *, bool b_abort );
537
VLC_API int input_Read( vlc_object_t *, input_item_t * );
540
538
#define input_Read(a,b) input_Read(VLC_OBJECT(a),b)
542
VLC_EXPORT( int, input_vaControl,( input_thread_t *, int i_query, va_list ) );
544
VLC_EXPORT( int, input_Control, ( input_thread_t *, int i_query, ... ) );
540
VLC_API int input_vaControl( input_thread_t *, int i_query, va_list );
542
VLC_API int input_Control( input_thread_t *, int i_query, ... );
544
VLC_API void input_Close( input_thread_t * );
545
void input_Join( input_thread_t * );
546
void input_Release( input_thread_t * );
547
549
* Get the input item for an input thread
599
601
* @return NULL on error, or the audio output (which needs to be
600
602
* released with vlc_object_release()).
602
static inline aout_instance_t *input_GetAout( input_thread_t *p_input )
604
static inline audio_output_t *input_GetAout( input_thread_t *p_input )
604
aout_instance_t *p_aout;
606
audio_output_t *p_aout;
605
607
return input_Control( p_input, INPUT_GET_AOUT, &p_aout ) ? NULL : p_aout;
614
616
static inline int input_GetEsObjects( input_thread_t *p_input, int i_id,
615
617
vlc_object_t **pp_decoder,
616
vout_thread_t **pp_vout, aout_instance_t **pp_aout )
618
vout_thread_t **pp_vout, audio_output_t **pp_aout )
618
620
return input_Control( p_input, INPUT_GET_ES_OBJECTS, i_id,
619
621
pp_decoder, pp_vout, pp_aout );
638
typedef struct input_clock_t input_clock_t;
639
VLC_EXPORT( decoder_t *, input_DecoderNew, ( input_thread_t *, es_format_t *, input_clock_t *, sout_instance_t * ) );
640
VLC_EXPORT( void, input_DecoderDelete, ( decoder_t * ) );
641
VLC_EXPORT( void, input_DecoderDecode,( decoder_t *, block_t *, bool b_do_pace ) );
644
* This function allows to split a MRL into access, demux and path part.
646
* You should not write into access and demux string as they may not point into
647
* the provided buffer.
648
* The buffer provided by psz_dup will be modified.
650
VLC_EXPORT( void, input_SplitMRL, ( const char **ppsz_access, const char **ppsz_demux, char **ppsz_path, char *psz_dup ) );
640
VLC_API decoder_t * input_DecoderCreate( vlc_object_t *, es_format_t *, input_resource_t * ) VLC_USED;
641
VLC_API void input_DecoderDelete( decoder_t * );
642
VLC_API void input_DecoderDecode( decoder_t *, block_t *, bool b_do_pace );
653
645
* This function creates a sane filename path.
655
VLC_EXPORT( char *, input_CreateFilename, ( vlc_object_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) );
647
VLC_API char * input_CreateFilename( vlc_object_t *, const char *psz_path, const char *psz_prefix, const char *psz_extension ) VLC_USED;
658
* This function detaches resources from a dead input.
650
* It creates an empty input resource handler.
660
* It MUST be called on a dead input (p_input->b_dead true) otherwise
662
* It does not support concurrent calls.
652
* The given object MUST stay alive as long as the input_resource_t is
664
VLC_EXPORT(input_resource_t *, input_DetachResource, ( input_thread_t * ) );
655
VLC_API input_resource_t * input_resource_New( vlc_object_t * ) VLC_USED;
667
* This function releases the input resource.
658
* It releases an input resource.
669
VLC_EXPORT(void, input_resource_Delete, ( input_resource_t * ) );
660
VLC_API void input_resource_Release( input_resource_t * );
672
663
* Forcefully destroys the video output (e.g. when the playlist is stopped).
674
VLC_EXPORT(void, input_resource_TerminateVout, ( input_resource_t * ) );
665
VLC_API void input_resource_TerminateVout( input_resource_t * );
668
* This function releases all resources (object).
670
VLC_API void input_resource_Terminate( input_resource_t * );