input_interface.h 3.47 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
/*****************************************************************************
 * input_interface.h: Input functions usable ouside input code.
 *****************************************************************************
 * Copyright (C) 1998-2008 the VideoLAN team
 * $Id$
 *
 * Authors: Laurent Aimar < fenrir _AT_ videolan _DOT_ org >
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
# error This header file can only be included from LibVLC.
#endif

#ifndef _INPUT_INTERFACE_H
#define _INPUT_INTERFACE_H 1

#include <vlc_input.h>
#include <libvlc.h>

/**********************************************************************
 * Item metadata
 **********************************************************************/
void input_item_SetPreparsed( input_item_t *p_i, bool b_preparsed );
void input_item_SetArtNotFound( input_item_t *p_i, bool b_not_found );
void input_item_SetArtFetched( input_item_t *p_i, bool b_art_fetched );

/* misc/stats.c
 * FIXME it should NOT be defined here or not coded in misc/stats.c */
input_stats_t *stats_NewInputStats( input_thread_t *p_input );

45 46 47 48 49 50 51 52 53 54 55
/**
 * This defines an opaque input ressource handler.
 */
typedef struct input_ressource_t input_ressource_t;

/**
 * This function releases an input_ressource_t and all associated ressources.
 */
void input_ressource_Delete( input_ressource_t * );

/**
56
 * This function deletes the current sout in the ressources.
57
 *
58
 * It can only be called on detached ressources.
59
 */
60 61 62 63 64 65 66 67 68
void input_ressource_TerminateSout( input_ressource_t *p_ressource );

/**
 * This function deletes the current vout in the ressources.
 *
 * It can only be called on detached ressources.
 */
void input_ressource_TerminateVout( input_ressource_t *p_ressource );

69

70 71
/* input.c */
#define input_CreateThreadExtended(a,b,c,d) __input_CreateThreadExtended(VLC_OBJECT(a),b,c,d)
72
input_thread_t *__input_CreateThreadExtended ( vlc_object_t *, input_item_t *, const char *, input_ressource_t * );
73

74 75 76 77 78 79 80 81
/**
 * This function detaches ressources from a dead input.
 *
 * It MUST be called on a dead input (p_input->b_dead true) otherwise
 * it will assert.
 * It does not support concurrent calls.
 */
input_ressource_t *input_DetachRessource( input_thread_t * );
82

83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
/* */
typedef enum
{
    INPUT_STATISTIC_DECODED_VIDEO,
    INPUT_STATISTIC_DECODED_AUDIO,
    INPUT_STATISTIC_DECODED_SUBTITLE,

    /* Use them only if you do not goes through a access_out module */
    INPUT_STATISTIC_SENT_PACKET,
    INPUT_STATISTIC_SENT_BYTE,

} input_statistic_t;
/**
 * It will update internal input statistics from external sources.
 * XXX For now, the only one allowed to do it is stream_out and input core.
 */
void input_UpdateStatistic( input_thread_t *, input_statistic_t, int i_delta );

101
#endif