Commit cd70bf31 authored by Laurent Aimar's avatar Laurent Aimar

Privatized remaining vout fields.

parent fd28b417
......@@ -63,10 +63,6 @@ struct vout_thread_t
{
VLC_COMMON_MEMBERS
video_format_t fmt_render; /* render format (from the decoder) */
video_format_t fmt_in; /* input (modified render) format */
video_format_t fmt_out; /* output format (for the video output) */
/* Private vout_thread data */
vout_thread_sys_t *p;
};
......
......@@ -1411,7 +1411,7 @@ void vout_SendDisplayEventMouse(vout_thread_t *vout, const vlc_mouse_t *m)
{
vlc_mouse_t tmp;
if (spu_ProcessMouse( vout->p->p_spu, m, &vout->fmt_out))
if (spu_ProcessMouse( vout->p->p_spu, m, &vout->p->fmt_out))
return;
vlc_mutex_lock( &vout->p->vfilter_lock );
......
......@@ -23,6 +23,7 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <vlc_common.h>
#include <vlc_vout.h>
......@@ -33,6 +34,8 @@
#include <vlc_input_item.h>
#include <vlc_epg.h>
/* TODO remove access to private vout data */
#include "vout_internal.h"
/* Layout percentage defines */
#define EPG_TOP 0.7
......@@ -275,8 +278,8 @@ int vout_OSDEpg( vout_thread_t *p_vout, input_item_t *p_input )
/* Build the EPG event subpictures. */
p_spu->p_region = vout_BuildOSDEpg( p_vout, p_epg,
p_vout->fmt_in.i_width,
p_vout->fmt_in.i_height );
p_vout->p->fmt_in.i_width,
p_vout->p->fmt_in.i_height );
vlc_epg_Delete( p_epg );
spu_DisplaySubpicture( vout_GetSpu( p_vout ), p_spu );
......
......@@ -164,9 +164,9 @@ vout_thread_t *vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
#warning "FIXME: Check RGB masks in vout_Request"
/* FIXME: check RGB masks */
if( p_vout->fmt_render.i_chroma != vlc_fourcc_GetCodec( VIDEO_ES, p_fmt->i_chroma ) ||
p_vout->fmt_render.i_width != p_fmt->i_width ||
p_vout->fmt_render.i_height != p_fmt->i_height ||
if( p_vout->p->fmt_render.i_chroma != vlc_fourcc_GetCodec( VIDEO_ES, p_fmt->i_chroma ) ||
p_vout->p->fmt_render.i_width != p_fmt->i_width ||
p_vout->p->fmt_render.i_height != p_fmt->i_height ||
p_vout->p->b_filter_change )
{
vlc_mutex_unlock( &p_vout->p->change_lock );
......@@ -195,14 +195,14 @@ vout_thread_t *vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
#endif
if( i_sar_num > 0 && i_sar_den > 0 &&
( i_sar_num != p_vout->fmt_render.i_sar_num ||
i_sar_den != p_vout->fmt_render.i_sar_den ) )
( i_sar_num != p_vout->p->fmt_render.i_sar_num ||
i_sar_den != p_vout->p->fmt_render.i_sar_den ) )
{
p_vout->fmt_in.i_sar_num = i_sar_num;
p_vout->fmt_in.i_sar_den = i_sar_den;
p_vout->p->fmt_in.i_sar_num = i_sar_num;
p_vout->p->fmt_in.i_sar_den = i_sar_den;
p_vout->fmt_render.i_sar_num = i_sar_num;
p_vout->fmt_render.i_sar_den = i_sar_den;
p_vout->p->fmt_render.i_sar_num = i_sar_num;
p_vout->p->fmt_render.i_sar_den = i_sar_den;
p_vout->p->i_changes |= VOUT_ASPECT_CHANGE;
}
vlc_mutex_unlock( &p_vout->p->change_lock );
......@@ -273,13 +273,13 @@ vout_thread_t * (vout_Create)( vlc_object_t *p_parent, video_format_t *p_fmt )
}
/* */
p_vout->fmt_render = *p_fmt; /* FIXME palette */
p_vout->fmt_in = *p_fmt; /* FIXME palette */
p_vout->p->fmt_render = *p_fmt; /* FIXME palette */
p_vout->p->fmt_in = *p_fmt; /* FIXME palette */
p_vout->fmt_render.i_chroma =
p_vout->fmt_in.i_chroma = i_chroma;
video_format_FixRgb( &p_vout->fmt_render );
video_format_FixRgb( &p_vout->fmt_in );
p_vout->p->fmt_render.i_chroma =
p_vout->p->fmt_in.i_chroma = i_chroma;
video_format_FixRgb( &p_vout->p->fmt_render );
video_format_FixRgb( &p_vout->p->fmt_in );
/* Initialize misc stuff */
vout_control_Init( &p_vout->p->control );
......@@ -614,13 +614,13 @@ static int ThreadInit(vout_thread_t *vout)
/* print some usefull debug info about different vout formats
*/
PrintVideoFormat(vout, "pic render", &vout->fmt_render);
PrintVideoFormat(vout, "pic in", &vout->fmt_in);
PrintVideoFormat(vout, "pic out", &vout->fmt_out);
PrintVideoFormat(vout, "pic render", &vout->p->fmt_render);
PrintVideoFormat(vout, "pic in", &vout->p->fmt_in);
PrintVideoFormat(vout, "pic out", &vout->p->fmt_out);
assert(vout->fmt_out.i_width == vout->fmt_render.i_width &&
vout->fmt_out.i_height == vout->fmt_render.i_height &&
vout->fmt_out.i_chroma == vout->fmt_render.i_chroma);
assert(vout->p->fmt_out.i_width == vout->p->fmt_render.i_width &&
vout->p->fmt_out.i_height == vout->p->fmt_render.i_height &&
vout->p->fmt_out.i_chroma == vout->p->fmt_render.i_chroma);
return VLC_SUCCESS;
}
......@@ -760,7 +760,7 @@ static int ThreadDisplayPicture(vout_thread_t *vout,
(vout->p->decoder_pool != vout->p->display_pool || subpic)) {
picture_t *render;
if (vout->p->is_decoder_pool_slow)
render = picture_NewFromFormat(&vout->fmt_out);
render = picture_NewFromFormat(&vout->p->fmt_out);
else if (vout->p->decoder_pool != vout->p->display_pool)
render = picture_pool_Get(vout->p->display_pool);
else
......@@ -770,8 +770,8 @@ static int ThreadDisplayPicture(vout_thread_t *vout,
picture_Copy(render, filtered);
spu_RenderSubpictures(vout->p->p_spu,
render, &vout->fmt_out,
subpic, &vout->fmt_in, spu_render_time);
render, &vout->p->fmt_out,
subpic, &vout->p->fmt_in, spu_render_time);
}
if (vout->p->is_decoder_pool_slow) {
direct = picture_pool_Get(vout->p->display_pool);
......@@ -792,7 +792,7 @@ static int ThreadDisplayPicture(vout_thread_t *vout,
* Take a snapshot if requested
*/
if (direct && do_snapshot)
vout_snapshot_Set(&vout->p->snapshot, &vout->fmt_out, direct);
vout_snapshot_Set(&vout->p->snapshot, &vout->p->fmt_out, direct);
/* Render the direct buffer returned by vout_RenderPicture */
if (direct) {
......@@ -876,18 +876,18 @@ static void ThreadDisplayOsdTitle(vout_thread_t *vout, const char *string)
vout_ShowTextAbsolute(vout, DEFAULT_CHAN,
string, NULL,
vout->p->title.position,
30 + vout->fmt_in.i_width
- vout->fmt_in.i_visible_width
- vout->fmt_in.i_x_offset,
20 + vout->fmt_in.i_y_offset,
30 + vout->p->fmt_in.i_width
- vout->p->fmt_in.i_visible_width
- vout->p->fmt_in.i_x_offset,
20 + vout->p->fmt_in.i_y_offset,
start, stop);
}
static void ThreadChangeFilters(vout_thread_t *vout, const char *filters)
{
es_format_t fmt;
es_format_Init(&fmt, VIDEO_ES, vout->fmt_render.i_chroma);
fmt.video = vout->fmt_render;
es_format_Init(&fmt, VIDEO_ES, vout->p->fmt_render.i_chroma);
fmt.video = vout->p->fmt_render;
vlc_mutex_lock(&vout->p->vfilter_lock);
......@@ -1057,7 +1057,7 @@ static void *Thread(void *object)
*/
while (!vout_control_Pop(&vout->p->control, &cmd, deadline, 100000)) {
/* TODO remove the lock when possible (ie when
* vout->fmt_* are not protected by it anymore) */
* vout->p->fmt_* are not protected by it anymore) */
vlc_mutex_lock(&vout->p->change_lock);
switch(cmd.type) {
case VOUT_CONTROL_OSD_TITLE:
......
......@@ -31,6 +31,9 @@
#include <vlc_filter.h>
#include <vlc_osd.h>
/* TODO remove access to private vout data */
#include "vout_internal.h"
/**
* \brief Show text on the video for some time
* \param p_vout pointer to the vout the text is to be showed on
......@@ -140,10 +143,10 @@ void vout_OSDMessage( vlc_object_t *p_caller, int i_channel,
{
vout_ShowTextRelative( p_vout, i_channel, psz_string, NULL,
OSD_ALIGN_TOP|OSD_ALIGN_RIGHT,
30 + p_vout->fmt_in.i_width
- p_vout->fmt_in.i_visible_width
- p_vout->fmt_in.i_x_offset,
20 + p_vout->fmt_in.i_y_offset, 1000000 );
30 + p_vout->p->fmt_in.i_width
- p_vout->p->fmt_in.i_visible_width
- p_vout->p->fmt_in.i_x_offset,
20 + p_vout->p->fmt_in.i_y_offset, 1000000 );
free( psz_string );
}
vlc_object_release( p_vout );
......
......@@ -27,6 +27,7 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <vlc_common.h>
#include <vlc_vout.h>
......@@ -34,6 +35,9 @@
#include <vlc_filter.h>
/* TODO remove access to private vout data */
#include "vout_internal.h"
/*****************************************************************************
* Displays an OSD slider.
* Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER.
......@@ -47,11 +51,11 @@ void vout_OSDSlider( vlc_object_t *p_caller, int i_channel, int i_position,
if( p_vout && ( var_InheritBool( p_caller, "osd" ) && ( i_position >= 0 ) ) )
{
osd_Slider( p_caller, vout_GetSpu( p_vout ),
p_vout->fmt_render.i_width,
p_vout->fmt_render.i_height,
p_vout->fmt_in.i_x_offset,
p_vout->fmt_in.i_height - p_vout->fmt_in.i_visible_height
- p_vout->fmt_in.i_y_offset,
p_vout->p->fmt_render.i_width,
p_vout->p->fmt_render.i_height,
p_vout->p->fmt_in.i_x_offset,
p_vout->p->fmt_in.i_height - p_vout->p->fmt_in.i_visible_height
- p_vout->p->fmt_in.i_y_offset,
i_channel, i_position, i_type );
}
vlc_object_release( p_vout );
......@@ -72,11 +76,11 @@ void vout_OSDIcon( vlc_object_t *p_caller, int i_channel, short i_type )
{
osd_Icon( p_caller,
vout_GetSpu( p_vout ),
p_vout->fmt_render.i_width,
p_vout->fmt_render.i_height,
p_vout->fmt_in.i_width - p_vout->fmt_in.i_visible_width
- p_vout->fmt_in.i_x_offset,
p_vout->fmt_in.i_y_offset,
p_vout->p->fmt_render.i_width,
p_vout->p->fmt_render.i_height,
p_vout->p->fmt_in.i_width - p_vout->p->fmt_in.i_visible_width
- p_vout->p->fmt_in.i_x_offset,
p_vout->p->fmt_in.i_y_offset,
i_channel, i_type );
}
vlc_object_release( p_vout );
......
......@@ -51,6 +51,11 @@ struct vout_thread_sys_t
/* Video output configuration */
config_chain_t *p_cfg;
/* */
video_format_t fmt_render; /* render format (from the decoder) */
video_format_t fmt_in; /* input (modified render) format */
video_format_t fmt_out; /* output format (for the video output) */
/* Thread & synchronization */
vlc_thread_t thread;
vlc_cond_t change_wait;
......
......@@ -637,10 +637,10 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
(void)oldval; (void)p_data;
/* Restore defaults */
p_vout->fmt_in.i_x_offset = p_vout->fmt_render.i_x_offset;
p_vout->fmt_in.i_visible_width = p_vout->fmt_render.i_visible_width;
p_vout->fmt_in.i_y_offset = p_vout->fmt_render.i_y_offset;
p_vout->fmt_in.i_visible_height = p_vout->fmt_render.i_visible_height;
p_vout->p->fmt_in.i_x_offset = p_vout->p->fmt_render.i_x_offset;
p_vout->p->fmt_in.i_visible_width = p_vout->p->fmt_render.i_visible_width;
p_vout->p->fmt_in.i_y_offset = p_vout->p->fmt_render.i_y_offset;
p_vout->p->fmt_in.i_visible_height = p_vout->p->fmt_render.i_visible_height;
if( !strcmp( psz_cmd, "crop" ) )
{
......@@ -654,22 +654,22 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
i_aspect_den = strtol( ++psz_parser, &psz_end, 10 );
if( psz_end == psz_parser || !i_aspect_den ) goto crop_end;
i_width = p_vout->fmt_in.i_sar_den*p_vout->fmt_render.i_visible_height *
i_aspect_num / i_aspect_den / p_vout->fmt_in.i_sar_num;
i_height = p_vout->fmt_render.i_visible_width*p_vout->fmt_in.i_sar_num *
i_aspect_den / i_aspect_num / p_vout->fmt_in.i_sar_den;
i_width = p_vout->p->fmt_in.i_sar_den*p_vout->p->fmt_render.i_visible_height *
i_aspect_num / i_aspect_den / p_vout->p->fmt_in.i_sar_num;
i_height = p_vout->p->fmt_render.i_visible_width*p_vout->p->fmt_in.i_sar_num *
i_aspect_den / i_aspect_num / p_vout->p->fmt_in.i_sar_den;
if( i_width < p_vout->fmt_render.i_visible_width )
if( i_width < p_vout->p->fmt_render.i_visible_width )
{
p_vout->fmt_in.i_x_offset = p_vout->fmt_render.i_x_offset +
(p_vout->fmt_render.i_visible_width - i_width) / 2;
p_vout->fmt_in.i_visible_width = i_width;
p_vout->p->fmt_in.i_x_offset = p_vout->p->fmt_render.i_x_offset +
(p_vout->p->fmt_render.i_visible_width - i_width) / 2;
p_vout->p->fmt_in.i_visible_width = i_width;
}
else
{
p_vout->fmt_in.i_y_offset = p_vout->fmt_render.i_y_offset +
(p_vout->fmt_render.i_visible_height - i_height) / 2;
p_vout->fmt_in.i_visible_height = i_height;
p_vout->p->fmt_in.i_y_offset = p_vout->p->fmt_render.i_y_offset +
(p_vout->p->fmt_render.i_visible_height - i_height) / 2;
p_vout->p->fmt_in.i_visible_height = i_height;
}
}
else
......@@ -695,21 +695,21 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
i_crop_top = strtol( psz_end, &psz_end, 10 );
if( *psz_end != '\0' ) goto crop_end;
if( i_crop_top + i_crop_height >= p_vout->fmt_render.i_visible_height ||
i_crop_left + i_crop_width >= p_vout->fmt_render.i_visible_width )
if( i_crop_top + i_crop_height >= p_vout->p->fmt_render.i_visible_height ||
i_crop_left + i_crop_width >= p_vout->p->fmt_render.i_visible_width )
{
msg_Err( p_vout, "Unable to crop over picture boundaries");
return VLC_EGENERIC;
}
i_width = i_crop_width;
p_vout->fmt_in.i_visible_width = i_width;
p_vout->p->fmt_in.i_visible_width = i_width;
i_height = i_crop_height;
p_vout->fmt_in.i_visible_height = i_height;
p_vout->p->fmt_in.i_visible_height = i_height;
p_vout->fmt_in.i_x_offset = i_crop_left;
p_vout->fmt_in.i_y_offset = i_crop_top;
p_vout->p->fmt_in.i_x_offset = i_crop_left;
p_vout->p->fmt_in.i_y_offset = i_crop_top;
}
else
{
......@@ -732,23 +732,23 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
i_crop_bottom = strtol( psz_end, &psz_end, 10 );
if( *psz_end != '\0' ) goto crop_end;
if( i_crop_top + i_crop_bottom >= p_vout->fmt_render.i_visible_height ||
i_crop_right + i_crop_left >= p_vout->fmt_render.i_visible_width )
if( i_crop_top + i_crop_bottom >= p_vout->p->fmt_render.i_visible_height ||
i_crop_right + i_crop_left >= p_vout->p->fmt_render.i_visible_width )
{
msg_Err( p_vout, "Unable to crop over picture boundaries" );
return VLC_EGENERIC;
}
i_width = p_vout->fmt_render.i_visible_width
i_width = p_vout->p->fmt_render.i_visible_width
- i_crop_left - i_crop_right;
p_vout->fmt_in.i_visible_width = i_width;
p_vout->p->fmt_in.i_visible_width = i_width;
i_height = p_vout->fmt_render.i_visible_height
i_height = p_vout->p->fmt_render.i_visible_height
- i_crop_top - i_crop_bottom;
p_vout->fmt_in.i_visible_height = i_height;
p_vout->p->fmt_in.i_visible_height = i_height;
p_vout->fmt_in.i_x_offset = i_crop_left;
p_vout->fmt_in.i_y_offset = i_crop_top;
p_vout->p->fmt_in.i_x_offset = i_crop_left;
p_vout->p->fmt_in.i_y_offset = i_crop_top;
}
}
}
......@@ -764,33 +764,33 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
i_crop_right = var_GetInteger( p_vout, "crop-right" );
i_crop_bottom = var_GetInteger( p_vout, "crop-bottom" );
if( i_crop_top + i_crop_bottom >= p_vout->fmt_render.i_visible_height ||
i_crop_right + i_crop_left >= p_vout->fmt_render.i_visible_width )
if( i_crop_top + i_crop_bottom >= p_vout->p->fmt_render.i_visible_height ||
i_crop_right + i_crop_left >= p_vout->p->fmt_render.i_visible_width )
{
msg_Err( p_vout, "Unable to crop over picture boundaries" );
return VLC_EGENERIC;
}
i_width = p_vout->fmt_render.i_visible_width
i_width = p_vout->p->fmt_render.i_visible_width
- i_crop_left - i_crop_right;
p_vout->fmt_in.i_visible_width = i_width;
p_vout->p->fmt_in.i_visible_width = i_width;
i_height = p_vout->fmt_render.i_visible_height
i_height = p_vout->p->fmt_render.i_visible_height
- i_crop_top - i_crop_bottom;
p_vout->fmt_in.i_visible_height = i_height;
p_vout->p->fmt_in.i_visible_height = i_height;
p_vout->fmt_in.i_x_offset = i_crop_left;
p_vout->fmt_in.i_y_offset = i_crop_top;
p_vout->p->fmt_in.i_x_offset = i_crop_left;
p_vout->p->fmt_in.i_y_offset = i_crop_top;
}
crop_end:
p_vout->p->i_changes |= VOUT_CROP_CHANGE;
msg_Dbg( p_vout, "cropping picture %ix%i to %i,%i,%ix%i",
p_vout->fmt_in.i_width, p_vout->fmt_in.i_height,
p_vout->fmt_in.i_x_offset, p_vout->fmt_in.i_y_offset,
p_vout->fmt_in.i_visible_width,
p_vout->fmt_in.i_visible_height );
p_vout->p->fmt_in.i_width, p_vout->p->fmt_in.i_height,
p_vout->p->fmt_in.i_x_offset, p_vout->p->fmt_in.i_y_offset,
p_vout->p->fmt_in.i_visible_width,
p_vout->p->fmt_in.i_visible_height );
var_TriggerCallback( p_vout, "crop-update" );
......@@ -808,8 +808,8 @@ static int AspectCallback( vlc_object_t *p_this, char const *psz_cmd,
(void)psz_cmd; (void)oldval; (void)p_data;
/* Restore defaults */
p_vout->fmt_in.i_sar_num = p_vout->fmt_render.i_sar_num;
p_vout->fmt_in.i_sar_den = p_vout->fmt_render.i_sar_den;
p_vout->p->fmt_in.i_sar_num = p_vout->p->fmt_render.i_sar_num;
p_vout->p->fmt_in.i_sar_den = p_vout->p->fmt_render.i_sar_den;
if( !psz_parser ) goto aspect_end;
......@@ -819,25 +819,25 @@ static int AspectCallback( vlc_object_t *p_this, char const *psz_cmd,
i_aspect_den = strtol( ++psz_parser, &psz_end, 10 );
if( psz_end == psz_parser || !i_aspect_den ) goto aspect_end;
i_sar_num = i_aspect_num * p_vout->fmt_render.i_visible_height;
i_sar_den = i_aspect_den * p_vout->fmt_render.i_visible_width;
i_sar_num = i_aspect_num * p_vout->p->fmt_render.i_visible_height;
i_sar_den = i_aspect_den * p_vout->p->fmt_render.i_visible_width;
vlc_ureduce( &i_sar_num, &i_sar_den, i_sar_num, i_sar_den, 0 );
p_vout->fmt_in.i_sar_num = i_sar_num;
p_vout->fmt_in.i_sar_den = i_sar_den;
p_vout->p->fmt_in.i_sar_num = i_sar_num;
p_vout->p->fmt_in.i_sar_den = i_sar_den;
aspect_end:
if( p_vout->p->i_par_num && p_vout->p->i_par_den )
{
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->p->fmt_in.i_sar_num *= p_vout->p->i_par_den;
p_vout->p->fmt_in.i_sar_den *= p_vout->p->i_par_num;
}
p_vout->p->i_changes |= VOUT_ASPECT_CHANGE;
msg_Dbg( p_vout, "new aspect-ratio %i:%i, sample aspect-ratio %i:%i",
p_vout->fmt_in.i_sar_num * p_vout->fmt_in.i_width,
p_vout->fmt_in.i_sar_den * p_vout->fmt_in.i_height,
p_vout->fmt_in.i_sar_num, p_vout->fmt_in.i_sar_den );
p_vout->p->fmt_in.i_sar_num * p_vout->p->fmt_in.i_width,
p_vout->p->fmt_in.i_sar_den * p_vout->p->fmt_in.i_height,
p_vout->p->fmt_in.i_sar_num, p_vout->p->fmt_in.i_sar_den );
if( var_Get( p_vout, "crop", &val ) )
return VLC_EGENERIC;
......
......@@ -66,7 +66,7 @@ int vout_OpenWrapper(vout_thread_t *vout, const char *name)
sys->display.title = var_CreateGetNonEmptyString(vout, "video-title");
/* */
video_format_t source = vout->fmt_render;
video_format_t source = vout->p->fmt_render;
source.i_visible_width = source.i_width;
source.i_visible_height = source.i_height;
source.i_x_offset = 0;
......@@ -135,31 +135,31 @@ int vout_InitWrapper(vout_thread_t *vout)
/* */
video_format_t source = vd->source;
vout->fmt_out.i_chroma = source.i_chroma;
vout->fmt_out.i_width =
vout->fmt_out.i_visible_width = source.i_width;
vout->fmt_out.i_height =
vout->fmt_out.i_visible_height = source.i_height;
vout->p->fmt_out.i_chroma = source.i_chroma;
vout->p->fmt_out.i_width =
vout->p->fmt_out.i_visible_width = source.i_width;
vout->p->fmt_out.i_height =
vout->p->fmt_out.i_visible_height = source.i_height;
if (source.i_sar_num > 0 && source.i_sar_den > 0) {
vlc_ureduce(&vout->fmt_out.i_sar_num, &vout->fmt_out.i_sar_den,
vlc_ureduce(&vout->p->fmt_out.i_sar_num, &vout->p->fmt_out.i_sar_den,
source.i_sar_num, source.i_sar_den, 0);
} else {
vout->fmt_out.i_sar_num = 1;
vout->fmt_out.i_sar_den = 1;
vout->p->fmt_out.i_sar_num = 1;
vout->p->fmt_out.i_sar_den = 1;
}
vout->fmt_out.i_sar_num = source.i_sar_num;
vout->fmt_out.i_sar_den = source.i_sar_den;
vout->fmt_out.i_x_offset = 0;
vout->fmt_out.i_y_offset = 0;
vout->fmt_out.i_rmask = source.i_rmask;
vout->fmt_out.i_gmask = source.i_gmask;
vout->fmt_out.i_bmask = source.i_bmask;
video_format_FixRgb(&vout->fmt_out);
if (vout->fmt_in.i_visible_width != source.i_visible_width ||
vout->fmt_in.i_visible_height != source.i_visible_height ||
vout->fmt_in.i_x_offset != source.i_x_offset ||
vout->fmt_in.i_y_offset != source.i_y_offset )
vout->p->fmt_out.i_sar_num = source.i_sar_num;
vout->p->fmt_out.i_sar_den = source.i_sar_den;
vout->p->fmt_out.i_x_offset = 0;
vout->p->fmt_out.i_y_offset = 0;
vout->p->fmt_out.i_rmask = source.i_rmask;
vout->p->fmt_out.i_gmask = source.i_gmask;
vout->p->fmt_out.i_bmask = source.i_bmask;
video_format_FixRgb(&vout->p->fmt_out);
if (vout->p->fmt_in.i_visible_width != source.i_visible_width ||
vout->p->fmt_in.i_visible_height != source.i_visible_height ||
vout->p->fmt_in.i_x_offset != source.i_x_offset ||
vout->p->fmt_in.i_y_offset != source.i_y_offset )
sys->i_changes |= VOUT_CROP_CHANGE;
/* XXX For non dr case, the current vout implementation force us to
......@@ -217,16 +217,16 @@ int vout_ManageWrapper(vout_thread_t *vout)
VOUT_CROP_CHANGE)) {
/* */
if (sys->i_changes & VOUT_ASPECT_CHANGE) {
vout->fmt_out.i_sar_num = vout->fmt_in.i_sar_num;
vout->fmt_out.i_sar_den = vout->fmt_in.i_sar_den;
vout->p->fmt_out.i_sar_num = vout->p->fmt_in.i_sar_num;
vout->p->fmt_out.i_sar_den = vout->p->fmt_in.i_sar_den;
vout_SetDisplayAspect(vd, vout->fmt_in.i_sar_num, vout->fmt_in.i_sar_den);
vout_SetDisplayAspect(vd, vout->p->fmt_in.i_sar_num, vout->p->fmt_in.i_sar_den);
sys->i_changes &= ~VOUT_ASPECT_CHANGE;
}
if (sys->i_changes & VOUT_CROP_CHANGE) {
const video_format_t crop = vout->fmt_in;
const video_format_t org = vout->fmt_render;
const video_format_t crop = vout->p->fmt_in;
const video_format_t org = vout->p->fmt_render;
/* FIXME because of rounding errors, the reconstructed ratio is wrong */
unsigned num = 0;
unsigned den = 0;
......
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