Commit d92fe9d2 authored by Gildas Bazin's avatar Gildas Bazin

* Merged trunk changes r9244:9250 to 0.8.1 branch.

parent 217b4a29
...@@ -99,6 +99,9 @@ struct video_format_t ...@@ -99,6 +99,9 @@ struct video_format_t
unsigned int i_bits_per_pixel; /**< number of bits per pixel */ unsigned int i_bits_per_pixel; /**< number of bits per pixel */
unsigned int i_sar_num; /**< sample/pixel aspect ratio */
unsigned int i_sar_den;
unsigned int i_frame_rate; /**< frame rate numerator */ unsigned int i_frame_rate; /**< frame rate numerator */
unsigned int i_frame_rate_base; /**< frame rate denominator */ unsigned int i_frame_rate_base; /**< frame rate denominator */
......
...@@ -1608,6 +1608,11 @@ static int transcode_video_process( sout_stream_t *p_stream, ...@@ -1608,6 +1608,11 @@ static int transcode_video_process( sout_stream_t *p_stream,
else else
p_fmt = &id->p_decoder->fmt_out.video; p_fmt = &id->p_decoder->fmt_out.video;
/* FIXME (shouldn't have to be done here) */
p_fmt->i_sar_num = p_fmt->i_aspect *
p_fmt->i_height / p_fmt->i_width;
p_fmt->i_sar_den = VOUT_ASPECT_FACTOR;
spu_RenderSubpictures( p_sys->p_spu, p_fmt, p_pic, p_pic, p_subpic, spu_RenderSubpictures( p_sys->p_spu, p_fmt, p_pic, p_pic, p_subpic,
i_scale_width, i_scale_height ); i_scale_width, i_scale_height );
} }
......
...@@ -631,6 +631,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date ) ...@@ -631,6 +631,7 @@ static subpicture_t *Filter( filter_t *p_filter, mtime_t date )
memset( &fmt, 0, sizeof(video_format_t) ); memset( &fmt, 0, sizeof(video_format_t) );
fmt.i_chroma = VLC_FOURCC('Y','U','V','A'); fmt.i_chroma = VLC_FOURCC('Y','U','V','A');
fmt.i_aspect = VOUT_ASPECT_FACTOR; fmt.i_aspect = VOUT_ASPECT_FACTOR;
fmt.i_sar_num = fmt.i_sar_den = 1;
fmt.i_width = fmt.i_visible_width = p_sys->i_width; fmt.i_width = fmt.i_visible_width = p_sys->i_width;
fmt.i_height = fmt.i_visible_height = p_sys->i_height; fmt.i_height = fmt.i_visible_height = p_sys->i_height;
fmt.i_x_offset = fmt.i_y_offset = 0; fmt.i_x_offset = fmt.i_y_offset = 0;
......
...@@ -73,7 +73,7 @@ vlc_module_begin(); ...@@ -73,7 +73,7 @@ vlc_module_begin();
add_integer ( "x11-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, VLC_TRUE ); add_integer ( "x11-xineramascreen", 0, NULL, SCREEN_TEXT, SCREEN_LONGTEXT, VLC_TRUE );
#endif #endif
set_description( _("X11 video output") ); set_description( _("X11 video output") );
set_capability( "video output", 50 ); set_capability( "video output", 70 );
set_callbacks( E_(Activate), E_(Deactivate) ); set_callbacks( E_(Activate), E_(Deactivate) );
vlc_module_end(); vlc_module_end();
...@@ -300,6 +300,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -300,6 +300,8 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
fmt.i_chroma = p_vout->output.i_chroma; fmt.i_chroma = p_vout->output.i_chroma;
fmt.i_width = p_vout->output.i_width; fmt.i_width = p_vout->output.i_width;
fmt.i_height = p_vout->output.i_height; fmt.i_height = p_vout->output.i_height;
fmt.i_sar_num = p_vout->output.i_aspect * fmt.i_height / fmt.i_width;
fmt.i_sar_den = VOUT_ASPECT_FACTOR;
i_scale_width = p_vout->output.i_width * 1000 / p_vout->render.i_width; i_scale_width = p_vout->output.i_width * 1000 / p_vout->render.i_width;
i_scale_height = p_vout->output.i_height * 1000 / p_vout->render.i_height; i_scale_height = p_vout->output.i_height * 1000 / p_vout->render.i_height;
......
...@@ -496,6 +496,15 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt, ...@@ -496,6 +496,15 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
p_subpic->i_original_picture_height; p_subpic->i_original_picture_height;
} }
/* Take care of the aspect ratio */
if( p_region && p_region->fmt.i_sar_num * p_fmt->i_sar_den !=
p_region->fmt.i_sar_den * p_fmt->i_sar_num )
{
i_scale_width = i_scale_width *
(int64_t)p_region->fmt.i_sar_num * p_fmt->i_sar_den /
p_region->fmt.i_sar_den / p_fmt->i_sar_num;
}
/* Load the scaling module */ /* Load the scaling module */
if( !p_spu->p_scale && (i_scale_width != 1000 || if( !p_spu->p_scale && (i_scale_width != 1000 ||
i_scale_height != 1000) ) i_scale_height != 1000) )
......
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