vout_internal.h 4.34 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
#include "vout_control.h"
34
#include "snapshot.h"
35
#include "statistic.h"
36

37 38 39 40
/* Number of pictures required to computes the FPS rate */
#define VOUT_FPS_SAMPLES                20

/* */
41 42
struct vout_thread_sys_t
{
43 44 45
    /* module */
    char       *psz_module_name;

46 47 48 49 50 51
    /* Thread & synchronization */
    vlc_thread_t    thread;
    vlc_cond_t      change_wait;
    bool            b_ready;
    bool            b_done;

52
    /* */
53 54 55
    bool            b_picture_displayed;
    bool            b_picture_empty;
    mtime_t         i_picture_displayed_date;
56
    picture_t       *p_picture_displayed;
57
    int             i_picture_qtype;
58
    bool            b_picture_interlaced;
59
    vlc_cond_t      picture_wait;
60 61

    /* */
62
    vlc_mutex_t     vfilter_lock;         /**< video filter2 lock */
63 64

    /* */
65 66 67 68
    uint32_t        render_time;           /**< last picture render time */
    unsigned int    i_par_num;           /**< monitor pixel aspect-ratio */
    unsigned int    i_par_den;           /**< monitor pixel aspect-ratio */

69 70 71
    /**
     * These numbers are not supposed to be accurate, but are a
     * good indication of the thread status */
72 73
    count_t         c_fps_samples;                         /**< picture counts */
    mtime_t         p_fps_sample[VOUT_FPS_SAMPLES];     /**< FPS samples dates */
74 75

    /* Statistics */
76
    vout_statistic_t statistic;
77

Laurent Aimar's avatar
Laurent Aimar committed
78 79 80 81
    /* Pause */
    bool            b_paused;
    mtime_t         i_pause_date;

82
    /* Filter chain */
83
    bool           b_first_vout;  /* True if it is the first vout of the filter chain */
84 85 86 87 88 89 90
    char           *psz_filter_chain;
    bool            b_filter_change;

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

91
    /* Snapshot interface */
92
    vout_snapshot_t snapshot;
93 94 95 96 97

    /* Show media title on videoutput */
    bool            b_title_show;
    mtime_t         i_title_timeout;
    int             i_title_position;
98 99

    char            *psz_title;
100 101 102

    /* */
    vlc_mouse_t     mouse;
103 104
};

105 106 107 108 109
/* */
int vout_AllocatePicture( vlc_object_t *, picture_t *, uint32_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den );
#define vout_AllocatePicture(a,b,c,d,e,f,g) \
        vout_AllocatePicture(VLC_OBJECT(a),b,c,d,e,f,g)

110
/* DO NOT use vout_RenderPicture/vout_IntfInit unless you are in src/video_ouput */
Laurent Aimar's avatar
Laurent Aimar committed
111
picture_t *vout_RenderPicture( vout_thread_t *, picture_t *,
112 113
                               subpicture_t *,
                               mtime_t render_date );
114
void vout_IntfInit( vout_thread_t * );
Laurent Aimar's avatar
Laurent Aimar committed
115

116 117 118 119 120 121
/* 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  );

122 123 124
/* */
int  vout_OpenWrapper (vout_thread_t *, const char *);
void vout_CloseWrapper(vout_thread_t *);
125 126 127 128 129
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 *);
130

Laurent Aimar's avatar
Laurent Aimar committed
131 132
#endif