vout_internal.h 5.29 KB
Newer Older
Laurent Aimar's avatar
Laurent Aimar committed
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
/*****************************************************************************
 * vout_internal.h : Internal vout definitions
 *****************************************************************************
 * Copyright (C) 2008 the VideoLAN team
 * Copyright (C) 2008 Laurent Aimar
 * $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 _VOUT_INTERNAL_H
#define _VOUT_INTERNAL_H 1

33 34
#include <vlc_picture_fifo.h>
#include <vlc_picture_pool.h>
35
#include "vout_control.h"
36
#include "snapshot.h"
37
#include "statistic.h"
38
#include "chrono.h"
39

40 41 42
/* Number of pictures required to computes the FPS rate */
#define VOUT_FPS_SAMPLES                20

43 44 45
/* */
typedef struct vout_sys_t vout_sys_t;

46
/* */
47 48
struct vout_thread_sys_t
{
49 50 51
    /* module */
    char       *psz_module_name;

52 53 54 55 56 57
    /* Video output configuration */
    config_chain_t *p_cfg;

    /* Place holder for the vout_wrapper code */
    vout_sys_t      *p_sys;

58 59 60 61 62
    /* Thread & synchronization */
    vlc_thread_t    thread;
    vlc_cond_t      change_wait;
    bool            b_ready;
    bool            b_done;
63
    bool            b_error;
64

65
    /* */
66
    bool            b_picture_empty;
67
    vlc_cond_t      picture_wait;
68 69 70 71 72 73 74 75 76 77 78 79
    struct {
        mtime_t     clock;
        mtime_t     timestampX;
        int         qtype;
        bool        is_interlaced;
        picture_t   *decoded;
    } displayed;
    struct {
        bool        is_requested;
        mtime_t     last;
        mtime_t     timestamp;
    } step;
80 81

    /* */
82
    vlc_mutex_t     vfilter_lock;         /**< video filter2 lock */
83 84

    /* */
85 86
    unsigned int    i_par_num;           /**< monitor pixel aspect-ratio */
    unsigned int    i_par_den;           /**< monitor pixel aspect-ratio */
87
    bool            is_late_dropped;
88 89

    /* Statistics */
90
    vout_statistic_t statistic;
91

Laurent Aimar's avatar
Laurent Aimar committed
92 93 94 95
    /* Pause */
    bool            b_paused;
    mtime_t         i_pause_date;

96
    /* Filter chain */
97
    bool           b_first_vout;  /* True if it is the first vout of the filter chain */
98 99 100 101 102 103 104
    char           *psz_filter_chain;
    bool            b_filter_change;

    /* Video filter2 chain */
    filter_chain_t *p_vf2_chain;
    char           *psz_vf2;

105
    /* Snapshot interface */
106
    vout_snapshot_t snapshot;
107 108 109 110 111

    /* Show media title on videoutput */
    bool            b_title_show;
    mtime_t         i_title_timeout;
    int             i_title_position;
112 113

    char            *psz_title;
114

115 116 117
    /* Subpicture unit */
    spu_t          *p_spu;

118 119
    /* */
    vlc_mouse_t     mouse;
120 121 122

    /* */
    vlc_mutex_t         picture_lock;                 /**< picture heap lock */
123 124 125 126 127 128 129
    picture_pool_t      *private_pool;
    picture_pool_t      *display_pool;
    picture_pool_t      *decoder_pool;
    picture_fifo_t      *decoder_fifo;
    bool                is_decoder_pool_slow;
    vout_chrono_t       render;           /**< picture render time estimator */

130 131 132 133 134 135
    vlc_mutex_t         change_lock;                 /**< thread change lock */

    uint16_t            i_changes;          /**< changes made to the thread.
                                                      \see \ref vout_changes */
    unsigned            b_fullscreen:1;       /**< toogle fullscreen display */
    unsigned            b_on_top:1; /**< stay always on top of other windows */
136 137
};

138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
/** \defgroup vout_changes Flags for changes
 * These flags are set in the vout_thread_t::i_changes field when another
 * thread changed a variable
 * @{
 */
/** b_autoscale changed */
#define VOUT_SCALE_CHANGE       0x0008
/** b_on_top changed */
#define VOUT_ON_TOP_CHANGE      0x0010
/** b_fullscreen changed */
#define VOUT_FULLSCREEN_CHANGE  0x0040
/** i_zoom changed */
#define VOUT_ZOOM_CHANGE        0x0080
/** cropping parameters changed */
#define VOUT_CROP_CHANGE        0x1000
/** aspect ratio changed */
#define VOUT_ASPECT_CHANGE      0x2000
/**@}*/


158
/* */
159
void vout_IntfInit( vout_thread_t * );
Laurent Aimar's avatar
Laurent Aimar committed
160

161 162 163 164 165 166
/* DO NOT use vout_UsePictureLocked unless you are in src/video_ouput
 *
 * This function supposes that you call it with picture_lock taken.
 */
void vout_UsePictureLocked( vout_thread_t *p_vout, picture_t *p_pic  );

167 168 169
/* */
int  vout_OpenWrapper (vout_thread_t *, const char *);
void vout_CloseWrapper(vout_thread_t *);
170 171 172 173 174
int  vout_InitWrapper(vout_thread_t *);
void vout_EndWrapper(vout_thread_t *);
int  vout_ManageWrapper(vout_thread_t *);
void vout_RenderWrapper(vout_thread_t *, picture_t *);
void vout_DisplayWrapper(vout_thread_t *, picture_t *);
175

Laurent Aimar's avatar
Laurent Aimar committed
176 177
#endif