Commit b07ed16e authored by Rafaël Carré's avatar Rafaël Carré

video_format_Setup: set visible dimensions

parent 0ba9b178
......@@ -250,7 +250,9 @@ static inline void video_format_Clean( video_format_t *p_src )
* It will fill up a video_format_t using the given arguments.
* Note that the video_format_t must already be initialized.
*/
VLC_API void video_format_Setup( video_format_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den );
VLC_API void video_format_Setup( video_format_t *, vlc_fourcc_t i_chroma,
int i_width, int i_height, int i_visible_width, int i_visible_height,
int i_sar_num, int i_sar_den );
/**
* It will copy the crop properties from a video_format_t to another.
......
......@@ -919,7 +919,7 @@ static void blurayDrawOverlay(demux_t *p_demux, const BD_OVERLAY* const ov)
if (!p_reg) {
video_format_t fmt;
video_format_Init(&fmt, 0);
video_format_Setup(&fmt, VLC_CODEC_YUVP, ov->w, ov->h, 1, 1);
video_format_Setup(&fmt, VLC_CODEC_YUVP, ov->w, ov->h, ov->w, ov->h, 1, 1);
p_reg = subpicture_region_New(&fmt);
p_reg->i_x = ov->x;
......@@ -1007,7 +1007,7 @@ static void blurayInitArgbOverlay(demux_t *p_demux, int plane, int width, int he
if (!p_sys->p_overlays[plane]->p_regions) {
video_format_t fmt;
video_format_Init(&fmt, 0);
video_format_Setup(&fmt, VLC_CODEC_RGBA, width, height, 1, 1);
video_format_Setup(&fmt, VLC_CODEC_RGBA, width, height, width, height, 1, 1);
p_sys->p_overlays[plane]->p_regions = subpicture_region_New(&fmt);
}
......
......@@ -175,6 +175,8 @@ static int OpenDecoder( vlc_object_t *p_this )
/* Find out p_vdec->i_raw_size */
video_format_Setup( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
p_dec->fmt_in.video.i_width,
p_dec->fmt_in.video.i_height,
p_dec->fmt_in.video.i_visible_width,
p_dec->fmt_in.video.i_visible_height,
p_dec->fmt_in.video.i_sar_num,
......
......@@ -120,6 +120,7 @@ static picture_t *Decode (decoder_t *dec, block_t **pp)
goto drop;
video_format_Setup(&dec->fmt_out.video, chroma,
ntohl(hdr->pixmap_width), ntohl(hdr->pixmap_height),
ntohl(hdr->pixmap_width), ntohl(hdr->pixmap_height),
dec->fmt_in.video.i_sar_num,
dec->fmt_in.video.i_sar_den);
......
......@@ -364,8 +364,8 @@ valid:
}
es_format_Init( &p_sys->fmt_video, VIDEO_ES, i_chroma );
video_format_Setup( &p_sys->fmt_video.video,
i_chroma, i_width, i_height,
video_format_Setup( &p_sys->fmt_video.video, i_chroma,
i_width, i_height, i_width, i_height,
i_sar_num, i_sar_den );
vlc_ureduce( &p_sys->fmt_video.video.i_frame_rate,
......
......@@ -121,7 +121,7 @@ int transcode_osd_process( sout_stream_t *p_stream, sout_stream_id_t *id,
{
video_format_t fmt;
video_format_Init( &fmt, 0 );
video_format_Setup( &fmt, 0, 720, 576, 1, 1 );
video_format_Setup( &fmt, 0, 720, 576, 720, 576, 1, 1 );
p_subpic = spu_Render( p_sys->p_spu, NULL, &fmt, &fmt, in->i_dts, in->i_dts, false );
}
else
......
......@@ -55,7 +55,7 @@ overlay_t *OverlayCreate( void )
p_ovl->i_alpha = 0xFF;
p_ovl->b_active = false;
video_format_Setup( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
1, 1 );
0, 0, 1, 1 );
p_ovl->p_fontstyle = text_style_New();
p_ovl->data.p_text = NULL;
......@@ -463,7 +463,7 @@ static int exec_DataSharedMem( filter_t *p_filter,
}
video_format_Setup( &p_ovl->format, VLC_CODEC_TEXT,
0, 0, 0, 1 );
0, 0, 0, 0, 0, 1 );
p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
if( p_data == NULL )
......
......@@ -766,7 +766,8 @@ static int OpenVideo(vlc_object_t *p_this)
video_format_t in, dummy;
video_format_Init(&in, 0);
video_format_Setup(&in, 0, vd->fmt.i_width, vd->fmt.i_height, 1, 1);
video_format_Setup(&in, 0, vd->fmt.i_width, vd->fmt.i_height,
vd->fmt.i_width, vd->fmt.i_height, 1, 1);
video_format_Init(&dummy, 0);
......
......@@ -369,7 +369,7 @@ static void *Thread( void *p_data )
/* Configure the video format for the opengl provider. */
video_format_Init(&fmt, 0);
video_format_Setup(&fmt, VLC_CODEC_RGB32,
video_format_Setup(&fmt, VLC_CODEC_RGB32, p_sys->i_width, p_sys->i_height,
p_sys->i_width, p_sys->i_height, 0, 1 );
fmt.i_sar_num = 1;
fmt.i_sar_den = 1;
......
......@@ -317,10 +317,8 @@ static void *Thread( void *p_data )
/* */
video_format_Init( &fmt, 0 );
video_format_Setup( &fmt, VLC_CODEC_RGB32,
p_sys->i_width, p_sys->i_height, 0, 1 );
fmt.i_sar_num = 1;
fmt.i_sar_den = 1;
video_format_Setup( &fmt, VLC_CODEC_RGB32, p_sys->i_width, p_sys->i_height,
p_sys->i_width, p_sys->i_height, 1, 1 );
vout_display_state_t state;
memset( &state, 0, sizeof(state) );
......
......@@ -280,7 +280,7 @@ static void *Thread( void *p_data )
goto error;
video_format_Init( &fmt, 0 );
video_format_Setup( &fmt, VLC_CODEC_RGB32,
video_format_Setup( &fmt, VLC_CODEC_RGB32, p_sys->i_width, p_sys->i_height,
p_sys->i_width, p_sys->i_height, 0, 1 );
fmt.i_sar_num = 1;
fmt.i_sar_den = 1;
......
......@@ -130,13 +130,14 @@ void video_format_FixRgb( video_format_t *p_fmt )
void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma,
int i_width, int i_height,
int i_visible_width, int i_visible_height,
int i_sar_num, int i_sar_den )
{
p_fmt->i_chroma = vlc_fourcc_GetCodec( VIDEO_ES, i_chroma );
p_fmt->i_width =
p_fmt->i_visible_width = i_width;
p_fmt->i_height =
p_fmt->i_visible_height = i_height;
p_fmt->i_width = i_width;
p_fmt->i_visible_width = i_visible_width;
p_fmt->i_height = i_height;
p_fmt->i_visible_height = i_visible_height;
p_fmt->i_x_offset =
p_fmt->i_y_offset = 0;
vlc_ureduce( &p_fmt->i_sar_num, &p_fmt->i_sar_den,
......
......@@ -147,6 +147,7 @@ int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma,
p_picture->i_nb_fields = 2;
video_format_Setup( &p_picture->format, i_chroma, i_width, i_height,
i_width, i_height,
i_sar_num, i_sar_den );
const vlc_chroma_description_t *p_dsc =
......@@ -202,6 +203,7 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
/* It is needed to be sure all information are filled */
video_format_Setup( &fmt, p_fmt->i_chroma,
p_fmt->i_width, p_fmt->i_height,
p_fmt->i_visible_width, p_fmt->i_visible_height,
p_fmt->i_sar_num, p_fmt->i_sar_den );
if( p_fmt->i_x_offset < p_fmt->i_width &&
p_fmt->i_y_offset < p_fmt->i_height &&
......@@ -265,7 +267,7 @@ picture_t *picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_
memset( &fmt, 0, sizeof(fmt) );
video_format_Setup( &fmt, i_chroma, i_width, i_height,
i_sar_num, i_sar_den );
i_width, i_height, i_sar_num, i_sar_den );
return picture_NewFromFormat( &fmt );
}
......
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