[vlc-devel] [PATCH 2/4] video_format_Setup: set visible dimensions
Rafaël Carré
funman at videolan.org
Mon Jan 27 14:23:45 CET 2014
---
include/vlc_es.h | 4 +++-
modules/access/bluray.c | 4 ++--
modules/codec/rawvideo.c | 2 ++
modules/codec/xwd.c | 1 +
modules/demux/rawvid.c | 4 ++--
modules/stream_out/transcode/osd.c | 2 +-
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c | 4 ++--
modules/video_output/decklink.cpp | 3 ++-
modules/visualization/glspectrum.c | 2 +-
modules/visualization/projectm.cpp | 6 ++----
modules/visualization/vsxu.cpp | 2 +-
src/misc/es_format.c | 9 +++++----
src/misc/picture.c | 4 +++-
13 files changed, 27 insertions(+), 20 deletions(-)
diff --git a/include/vlc_es.h b/include/vlc_es.h
index 3040c38..38d63da 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -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.
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index 71278ee..4dc9d83 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -890,7 +890,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;
@@ -978,7 +978,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);
}
diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c
index bbe2c78..b8b25e6 100644
--- a/modules/codec/rawvideo.c
+++ b/modules/codec/rawvideo.c
@@ -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,
diff --git a/modules/codec/xwd.c b/modules/codec/xwd.c
index 42e7d4b..1a045a3 100644
--- a/modules/codec/xwd.c
+++ b/modules/codec/xwd.c
@@ -121,6 +121,7 @@ static picture_t *Decode (decoder_t *dec, block_t **pp)
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);
diff --git a/modules/demux/rawvid.c b/modules/demux/rawvid.c
index 7577b5a..f98bafc 100644
--- a/modules/demux/rawvid.c
+++ b/modules/demux/rawvid.c
@@ -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,
diff --git a/modules/stream_out/transcode/osd.c b/modules/stream_out/transcode/osd.c
index 2163f32..d0e89a6 100644
--- a/modules/stream_out/transcode/osd.c
+++ b/modules/stream_out/transcode/osd.c
@@ -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
diff --git a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
index 855b9d6..dbb48d6 100644
--- a/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
+++ b/modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
@@ -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 )
diff --git a/modules/video_output/decklink.cpp b/modules/video_output/decklink.cpp
index aaa9e60..da5e9bf 100644
--- a/modules/video_output/decklink.cpp
+++ b/modules/video_output/decklink.cpp
@@ -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);
diff --git a/modules/visualization/glspectrum.c b/modules/visualization/glspectrum.c
index a361ef0..162596a 100644
--- a/modules/visualization/glspectrum.c
+++ b/modules/visualization/glspectrum.c
@@ -362,7 +362,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;
diff --git a/modules/visualization/projectm.cpp b/modules/visualization/projectm.cpp
index 07566fe..68ee6a0 100644
--- a/modules/visualization/projectm.cpp
+++ b/modules/visualization/projectm.cpp
@@ -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) );
diff --git a/modules/visualization/vsxu.cpp b/modules/visualization/vsxu.cpp
index 47a23db..9341b54 100644
--- a/modules/visualization/vsxu.cpp
+++ b/modules/visualization/vsxu.cpp
@@ -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;
diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 87b6ada..63996c6 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -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,
diff --git a/src/misc/picture.c b/src/misc/picture.c
index 3e1fb68..ae49145 100644
--- a/src/misc/picture.c
+++ b/src/misc/picture.c
@@ -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 );
}
--
1.8.5.3
More information about the vlc-devel
mailing list