Commit b0123347 authored by Laurent Aimar's avatar Laurent Aimar

Privatized part of vout fields.

parent c6021166
......@@ -469,6 +469,11 @@ VLC_EXPORT( int, __vout_AllocatePicture,( vlc_object_t *p_this, picture_t *p_pic
* @{
*/
/**
* Video ouput thread private structure
*/
typedef struct vout_thread_sys_t vout_thread_sys_t;
/**
* Video output thread descriptor
*
......@@ -484,7 +489,6 @@ struct vout_thread_t
/**@{*/
vlc_mutex_t picture_lock; /**< picture heap lock */
vlc_mutex_t change_lock; /**< thread change lock */
vlc_mutex_t vfilter_lock; /**< video filter2 change lock */
vout_sys_t * p_sys; /**< system output method */
/**@}*/
......@@ -492,18 +496,11 @@ struct vout_thread_t
/**@{*/
uint16_t i_changes; /**< changes made to the thread.
\see \ref vout_changes */
float f_gamma; /**< gamma */
bool b_grayscale; /**< color or grayscale display */
bool b_info; /**< print additional information */
bool b_interface; /**< render interface */
bool b_scale; /**< allow picture scaling */
bool b_fullscreen; /**< toogle fullscreen display */
uint32_t render_time; /**< last picture render time */
unsigned int i_window_width; /**< video window width */
unsigned int i_window_height; /**< video window height */
unsigned int i_alignment; /**< video alignment in window */
unsigned int i_par_num; /**< monitor pixel aspect-ratio */
unsigned int i_par_den; /**< monitor pixel aspect-ratio */
struct vout_window_t *p_window; /**< window for embedded vout (if any) */
/**@}*/
......@@ -522,21 +519,11 @@ struct vout_thread_t
int ( *pf_control ) ( vout_thread_t *, int, va_list );
/**@}*/
/** \name Statistics
* These numbers are not supposed to be accurate, but are a
* good indication of the thread status */
/**@{*/
count_t c_fps_samples; /**< picture counts */
mtime_t p_fps_sample[VOUT_FPS_SAMPLES]; /**< FPS samples dates */
/**@}*/
/** \name Video heap and translation tables */
/**@{*/
int i_heap_size; /**< heap size */
picture_heap_t render; /**< rendered pictures */
picture_heap_t output; /**< direct buffers */
bool b_direct; /**< rendered are like direct ? */
filter_t *p_chroma; /**< translation tables */
video_format_t fmt_render; /* render format (from the decoder) */
video_format_t fmt_in; /* input (modified render) format */
......@@ -549,34 +536,11 @@ struct vout_thread_t
/* Subpicture unit */
spu_t *p_spu;
/* Statistics */
count_t c_loops;
count_t c_pictures, c_late_pictures;
mtime_t display_jitter; /**< average deviation from the PTS */
count_t c_jitter_samples; /**< number of samples used
for the calculation of the
jitter */
/** delay created by internal caching */
int i_pts_delay;
/* Filter chain */
char *psz_filter_chain;
bool b_filter_change;
/* Video filter2 chain */
filter_chain_t *p_vf2_chain;
char *psz_vf2;
/* Misc */
bool b_snapshot; /**< take one snapshot on the next loop */
/* Video output configuration */
config_chain_t *p_cfg;
/* Show media title on videoutput */
bool b_title_show;
mtime_t i_title_timeout;
int i_title_position;
/* Private vout_thread data */
vout_thread_sys_t *p;
};
#define I_OUTPUTPICTURES p_vout->output.i_pictures
......@@ -591,14 +555,10 @@ struct vout_thread_t
*/
/** b_info changed */
#define VOUT_INFO_CHANGE 0x0001
/** b_grayscale changed */
#define VOUT_GRAYSCALE_CHANGE 0x0002
/** b_interface changed */
#define VOUT_INTF_CHANGE 0x0004
/** b_scale changed */
#define VOUT_SCALE_CHANGE 0x0008
/** gamma changed */
#define VOUT_GAMMA_CHANGE 0x0010
/** b_cursor changed */
#define VOUT_CURSOR_CHANGE 0x0020
/** b_fullscreen changed */
......
......@@ -1271,8 +1271,6 @@ int Init( vout_thread_t *p_vout )
p_vout->output.i_chroma = colspace[p_vout->p_sys->p_window->colspace_index].chroma;
p_vout->p_sys->i_index = 0;
p_vout->b_direct = 1;
p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x000000ff;
......
......@@ -378,12 +378,6 @@ static int QNXManage( vout_thread_t *p_vout )
p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
break;
case Pk_c:
case Pk_C:
p_vout->b_grayscale = ! p_vout->b_grayscale;
p_vout->i_changes |= VOUT_GRAYSCALE_CHANGE;
break;
default:
break;
}
......
This diff is collapsed.
......@@ -30,6 +30,55 @@
#ifndef _VOUT_INTERNAL_H
#define _VOUT_INTERNAL_H 1
struct vout_thread_sys_t
{
/* */
vlc_mutex_t vfilter_lock; /**< video filter2 change lock */
/* */
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 */
/* */
bool b_direct; /**< rendered are like direct ? */
filter_t *p_chroma;
/**
* These numbers are not supposed to be accurate, but are a
* good indication of the thread status */
count_t c_fps_samples; /**< picture counts */
mtime_t p_fps_sample[VOUT_FPS_SAMPLES]; /**< FPS samples dates */
#if 0
/* Statistics */
count_t c_loops;
count_t c_pictures, c_late_pictures;
mtime_t display_jitter; /**< average deviation from the PTS */
count_t c_jitter_samples; /**< number of samples used
for the calculation of the jitter */
#endif
/** delay created by internal caching */
int i_pts_delay;
/* Filter chain */
char *psz_filter_chain;
bool b_filter_change;
/* Video filter2 chain */
filter_chain_t *p_vf2_chain;
char *psz_vf2;
/* Misc */
bool b_snapshot; /**< take one snapshot on the next loop */
/* Show media title on videoutput */
bool b_title_show;
mtime_t i_title_timeout;
int i_title_position;
};
/* DO NOT use vout_RenderPicture unless you are in src/video_ouput */
picture_t *vout_RenderPicture( vout_thread_t *, picture_t *,
subpicture_t *, bool b_paused );
......
......@@ -50,6 +50,7 @@
#include <vlc_strings.h>
#include <vlc_charset.h>
#include "../libvlc.h"
#include "vout_internal.h"
/*****************************************************************************
* Local prototypes
......@@ -257,10 +258,10 @@ void vout_IntfInit( vout_thread_t *p_vout )
var_Create( p_vout, "mouse-hide-timeout",
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
p_vout->b_title_show = var_CreateGetBool( p_vout, "video-title-show" );
p_vout->i_title_timeout =
p_vout->p->b_title_show = var_CreateGetBool( p_vout, "video-title-show" );
p_vout->p->i_title_timeout =
(mtime_t)var_CreateGetInteger( p_vout, "video-title-timeout" );
p_vout->i_title_position =
p_vout->p->i_title_position =
var_CreateGetInteger( p_vout, "video-title-position" );
var_AddCallback( p_vout, "video-title-show", TitleShowCallback, NULL );
......@@ -352,14 +353,14 @@ void vout_IntfInit( vout_thread_t *p_vout )
}
if( !i_aspect_num || !i_aspect_den ) i_aspect_num = i_aspect_den = 1;
p_vout->i_par_num = i_aspect_num;
p_vout->i_par_den = i_aspect_den;
p_vout->p->i_par_num = i_aspect_num;
p_vout->p->i_par_den = i_aspect_den;
vlc_ureduce( &p_vout->i_par_num, &p_vout->i_par_den,
p_vout->i_par_num, p_vout->i_par_den, 0 );
vlc_ureduce( &p_vout->p->i_par_num, &p_vout->p->i_par_den,
p_vout->p->i_par_num, p_vout->p->i_par_den, 0 );
msg_Dbg( p_vout, "overriding monitor pixel aspect-ratio: %i:%i",
p_vout->i_par_num, p_vout->i_par_den );
p_vout->p->i_par_num, p_vout->p->i_par_den );
b_force_par = true;
}
free( val.psz_string );
......@@ -877,7 +878,7 @@ int vout_vaControlDefault( vout_thread_t *p_vout, int i_query, va_list args )
return VLC_SUCCESS;
case VOUT_SNAPSHOT:
p_vout->b_snapshot = true;
p_vout->p->b_snapshot = true;
return VLC_SUCCESS;
default:
......@@ -1158,12 +1159,12 @@ static int AspectCallback( vlc_object_t *p_this, char const *psz_cmd,
p_vout->render.i_aspect = p_vout->fmt_in.i_aspect;
aspect_end:
if( p_vout->i_par_num && p_vout->i_par_den )
if( p_vout->p->i_par_num && p_vout->p->i_par_den )
{
p_vout->fmt_in.i_sar_num *= p_vout->i_par_den;
p_vout->fmt_in.i_sar_den *= p_vout->i_par_num;
p_vout->fmt_in.i_sar_num *= p_vout->p->i_par_den;
p_vout->fmt_in.i_sar_den *= p_vout->p->i_par_num;
p_vout->fmt_in.i_aspect = p_vout->fmt_in.i_aspect *
p_vout->i_par_den / p_vout->i_par_num;
p_vout->p->i_par_den / p_vout->p->i_par_num;
p_vout->render.i_aspect = p_vout->fmt_in.i_aspect;
}
......@@ -1231,7 +1232,7 @@ static int TitleShowCallback( vlc_object_t *p_this, char const *psz_cmd,
VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
VLC_UNUSED(p_data);
vout_thread_t *p_vout = (vout_thread_t *)p_this;
p_vout->b_title_show = newval.b_bool;
p_vout->p->b_title_show = newval.b_bool;
return VLC_SUCCESS;
}
......@@ -1240,7 +1241,7 @@ static int TitleTimeoutCallback( vlc_object_t *p_this, char const *psz_cmd,
{
VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval); VLC_UNUSED(p_data);
vout_thread_t *p_vout = (vout_thread_t *)p_this;
p_vout->i_title_timeout = (mtime_t) newval.i_int;
p_vout->p->i_title_timeout = (mtime_t) newval.i_int;
return VLC_SUCCESS;
}
......@@ -1250,6 +1251,6 @@ static int TitlePositionCallback( vlc_object_t *p_this, char const *psz_cmd,
VLC_UNUSED(psz_cmd); VLC_UNUSED(oldval);
VLC_UNUSED(p_data);
vout_thread_t *p_vout = (vout_thread_t *)p_this;
p_vout->i_title_position = newval.i_int;
p_vout->p->i_title_position = newval.i_int;
return VLC_SUCCESS;
}
......@@ -35,6 +35,7 @@
#include <vlc_osd.h>
#include <vlc_filter.h>
#include "vout_pictures.h"
#include "vout_internal.h"
#include <assert.h>
......@@ -357,7 +358,7 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
/* Not a direct buffer. We either need to copy it to a direct buffer,
* or render it if the chroma isn't the same. */
if( p_vout->b_direct )
if( p_vout->p->b_direct )
{
/* Picture is not in a direct buffer, but is exactly the
* same size as the direct buffers. A memcpy() is enough,
......@@ -401,8 +402,8 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
}
/* Convert image to the first direct buffer */
p_vout->p_chroma->p_owner = (filter_owner_sys_t *)p_tmp_pic;
p_vout->p_chroma->pf_video_filter( p_vout->p_chroma, p_pic );
p_vout->p->p_chroma->p_owner = (filter_owner_sys_t *)p_tmp_pic;
p_vout->p->p_chroma->pf_video_filter( p_vout->p->p_chroma, p_pic );
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu,
......@@ -420,8 +421,8 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
return NULL;
/* Convert image to the first direct buffer */
p_vout->p_chroma->p_owner = (filter_owner_sys_t *)&p_vout->p_picture[0];
p_vout->p_chroma->pf_video_filter( p_vout->p_chroma, p_pic );
p_vout->p->p_chroma->p_owner = (filter_owner_sys_t *)&p_vout->p_picture[0];
p_vout->p->p_chroma->pf_video_filter( p_vout->p->p_chroma, p_pic );
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment