vout_internal.h 5.56 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>
Laurent Aimar's avatar
Laurent Aimar committed
35
#include <vlc_vout_display.h>
36
#include <vlc_vout_wrapper.h>
37
#include "vout_control.h"
38
#include "control.h"
39
#include "snapshot.h"
40
#include "statistic.h"
41
#include "chrono.h"
42

43 44 45 46 47 48 49 50
/* It should be high enough to absorbe jitter due to difficult picture(s)
 * to decode but not too high as memory is not that cheap.
 *
 * It can be made lower at compilation time if needed, but performance
 * may be degraded.
 */
#define VOUT_MAX_PICTURES (20)

51 52 53 54 55 56
/**
 * Number of frames used to estimate the maximum filter chain latency.
 * For performance, it is best to use a power of 2
 */
#define VOUT_FILTER_DELAYS (8)

57
/* */
58 59
struct vout_thread_sys_t
{
60 61
    /* Splitter module if used */
    char            *splitter_name;
62

63 64 65
    /* Input thread for dvd menu interactions */
    vlc_object_t    *input;

66
    /* */
67
    video_format_t  original;   /* Original format ie coming from the decoder */
68
    unsigned        dpb_size;
69

70 71 72 73 74 75 76
    /* Snapshot interface */
    vout_snapshot_t snapshot;

    /* Statistics */
    vout_statistic_t statistic;

    /* Subpicture unit */
77
    vlc_mutex_t     spu_lock;
78 79 80 81 82 83
    spu_t           *p_spu;

    /* Monitor Pixel Aspect Ratio */
    unsigned int    i_par_num;
    unsigned int    i_par_den;

84 85 86 87 88 89 90
    /* Video output window */
    struct {
        bool              is_unused;
        vout_window_cfg_t cfg;
        vout_window_t     *object;
    } window;

91 92
    /* Thread & synchronization */
    vlc_thread_t    thread;
93
    bool            dead;
94
    vout_control_t  control;
95

96
    /* */
Laurent Aimar's avatar
Laurent Aimar committed
97 98 99 100 101 102 103
    struct {
        char           *title;
        vout_display_t *vd;
        bool           use_dr;
        picture_t      *filtered;
    } display;

104
    struct {
105 106
        mtime_t     date;
        mtime_t     timestamp;
107 108 109 110
        int         qtype;
        bool        is_interlaced;
        picture_t   *decoded;
    } displayed;
111

112 113 114 115
    struct {
        mtime_t     last;
        mtime_t     timestamp;
    } step;
116

117 118 119 120 121
    struct {
        bool        is_on;
        mtime_t     date;
    } pause;

122
    /* OSD title configuration */
123 124 125 126 127 128
    struct {
        bool        show;
        mtime_t     timeout;
        int         position;
    } title;

129
    /* */
130
    bool            is_late_dropped;
131 132

    /* Video filter2 chain */
133 134
    struct {
        vlc_mutex_t     lock;
135 136
        filter_chain_t  *chain_static;
        filter_chain_t  *chain_interactive;
137 138 139
        unsigned        delay_index;
        mtime_t         delay[VOUT_FILTER_DELAYS];
    } filter;
140

141 142
    /* */
    vlc_mouse_t     mouse;
143 144

    /* */
145 146 147 148 149 150 151
    vlc_mutex_t     picture_lock;                 /**< picture heap lock */
    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 */
152 153
};

154 155 156 157 158
/* TODO to move them to vlc_vout.h */
void vout_ControlChangeFullscreen(vout_thread_t *, bool fullscreen);
void vout_ControlChangeOnTop(vout_thread_t *, bool is_on_top);
void vout_ControlChangeDisplayFilled(vout_thread_t *, bool is_filled);
void vout_ControlChangeZoom(vout_thread_t *, int num, int den);
159 160 161 162
void vout_ControlChangeSampleAspectRatio(vout_thread_t *, unsigned num, unsigned den);
void vout_ControlChangeCropRatio(vout_thread_t *, unsigned num, unsigned den);
void vout_ControlChangeCropWindow(vout_thread_t *, int x, int y, int width, int height);
void vout_ControlChangeCropBorder(vout_thread_t *, int left, int top, int right, int bottom);
163
void vout_ControlChangeFilters(vout_thread_t *, const char *);
164
void vout_ControlChangeSubFilters(vout_thread_t *, const char *);
Laurent Aimar's avatar
Laurent Aimar committed
165
void vout_ControlChangeSubMargin(vout_thread_t *, int);
166

167
/* */
168
void vout_IntfInit( vout_thread_t * );
Laurent Aimar's avatar
Laurent Aimar committed
169

170
/* */
171 172
int  vout_OpenWrapper (vout_thread_t *, const char *, const vout_display_state_t *);
void vout_CloseWrapper(vout_thread_t *, vout_display_state_t *);
173 174
int  vout_InitWrapper(vout_thread_t *);
void vout_EndWrapper(vout_thread_t *);
175
void vout_ManageWrapper(vout_thread_t *);
176 177
void vout_RenderWrapper(vout_thread_t *, picture_t *);
void vout_DisplayWrapper(vout_thread_t *, picture_t *);
178

179 180
/* */
int spu_ProcessMouse(spu_t *, const vlc_mouse_t *, const video_format_t *);
181
void spu_Attach( spu_t *, vlc_object_t *input, bool );
Laurent Aimar's avatar
Laurent Aimar committed
182
void spu_ChangeMargin(spu_t *, int);
183

Laurent Aimar's avatar
Laurent Aimar committed
184 185
#endif