[vlc-devel] commit: Used picture_NewFromFormat when appropriate. (Laurent Aimar )
git version control
git at videolan.org
Wed Dec 16 22:01:25 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Dec 15 19:56:18 2009 +0100| [7d0e62b8727f27c865587131c5b7ae9445d5ea59] | committer: Laurent Aimar
Used picture_NewFromFormat when appropriate.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7d0e62b8727f27c865587131c5b7ae9445d5ea59
---
modules/gui/fbosd.c | 4 +---
modules/misc/freetype.c | 4 ++--
modules/misc/quartztext.c | 2 +-
modules/misc/svg.c | 2 +-
modules/misc/win32text.c | 2 +-
modules/stream_out/mosaic_bridge.c | 5 +----
modules/stream_out/transcode/video.c | 10 ++--------
modules/video_filter/motiondetect.c | 3 +--
modules/video_filter/scene.c | 4 +---
9 files changed, 11 insertions(+), 25 deletions(-)
diff --git a/modules/gui/fbosd.c b/modules/gui/fbosd.c
index fbfdf30..ea43afd 100644
--- a/modules/gui/fbosd.c
+++ b/modules/gui/fbosd.c
@@ -622,9 +622,7 @@ static void CloseTextRenderer( intf_thread_t *p_intf )
*****************************************************************************/
static picture_t *AllocatePicture( video_format_t *p_fmt )
{
- picture_t *p_picture = picture_New( p_fmt->i_chroma,
- p_fmt->i_width, p_fmt->i_height,
- p_fmt->i_aspect );
+ picture_t *p_picture = picture_NewFromFormat( p_fmt );
if( !p_picture )
return NULL;
diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
index 76fd10b..70e6ec9 100644
--- a/modules/misc/freetype.c
+++ b/modules/misc/freetype.c
@@ -632,7 +632,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_x_offset = fmt.i_y_offset = 0;
assert( !p_region->p_picture );
- p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
+ p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
@@ -897,7 +897,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_visible_height = p_region->fmt.i_visible_height;
fmt.i_x_offset = fmt.i_y_offset = 0;
- p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
+ p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
diff --git a/modules/misc/quartztext.c b/modules/misc/quartztext.c
index c6100d3..0590b7e 100644
--- a/modules/misc/quartztext.c
+++ b/modules/misc/quartztext.c
@@ -1050,7 +1050,7 @@ static int RenderYUVA( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_height = fmt.i_visible_height = __MIN( i_height, i_textblock_height + VERTICAL_MARGIN * 2);
fmt.i_x_offset = fmt.i_y_offset = 0;
- p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
+ p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
diff --git a/modules/misc/svg.c b/modules/misc/svg.c
index c6cf3d1..4135d33 100644
--- a/modules/misc/svg.c
+++ b/modules/misc/svg.c
@@ -283,7 +283,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
fmt.i_height = fmt.i_visible_height = i_height;
fmt.i_x_offset = fmt.i_y_offset = 0;
- p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
+ p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
return VLC_EGENERIC;
p_region->fmt = fmt;
diff --git a/modules/misc/win32text.c b/modules/misc/win32text.c
index 2c53cbf..e346467 100644
--- a/modules/misc/win32text.c
+++ b/modules/misc/win32text.c
@@ -240,7 +240,7 @@ static int Render( filter_t *p_filter, subpicture_region_t *p_region,
fmt.p_palette->palette[i][3] = pi_gamma[i];
}
- p_region->p_picture = picture_New( fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect );
+ p_region->p_picture = picture_NewFromFormat( &fmt );
if( !p_region->p_picture )
{
free( fmt.p_palette );
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 0f16170..449da23 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -666,10 +666,7 @@ static picture_t *video_new_buffer( vlc_object_t *p_this,
/* */
fmt_out->video.i_chroma = fmt_out->i_codec;
- return picture_New( fmt_out->video.i_chroma,
- fmt_out->video.i_width,
- fmt_out->video.i_height,
- fmt_out->video.i_aspect );
+ return picture_NewFromFormat( &fmt_out->video );
}
inline static void video_del_buffer_decoder( decoder_t *p_this,
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index e372dd6..352041e 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -96,19 +96,13 @@ static picture_t *video_new_buffer_decoder( decoder_t *p_dec )
}
p_dec->fmt_out.video.i_chroma = p_dec->fmt_out.i_codec;
- return picture_New( p_dec->fmt_out.video.i_chroma,
- p_dec->fmt_out.video.i_width,
- p_dec->fmt_out.video.i_height,
- p_dec->fmt_out.video.i_aspect );
+ return picture_NewFromFormat( &p_dec->fmt_out.video );
}
static picture_t *transcode_video_filter_buffer_new( filter_t *p_filter )
{
p_filter->fmt_out.video.i_chroma = p_filter->fmt_out.i_codec;
- return picture_New( p_filter->fmt_out.video.i_chroma,
- p_filter->fmt_out.video.i_width,
- p_filter->fmt_out.video.i_height,
- p_filter->fmt_out.video.i_aspect );
+ return picture_NewFromFormat( &p_filter->fmt_out.video );
}
static void transcode_video_filter_buffer_del( filter_t *p_filter, picture_t *p_pic )
{
diff --git a/modules/video_filter/motiondetect.c b/modules/video_filter/motiondetect.c
index e06b4d7..5d87518 100644
--- a/modules/video_filter/motiondetect.c
+++ b/modules/video_filter/motiondetect.c
@@ -114,8 +114,7 @@ static int Create( vlc_object_t *p_this )
return VLC_ENOMEM;
p_sys->b_old = false;
- p_sys->p_old = picture_New( p_fmt->i_chroma,
- p_fmt->i_width, p_fmt->i_height, 0 );
+ p_sys->p_old = picture_NewFromFormat( p_fmt );
p_sys->p_buf = calloc( p_fmt->i_width * p_fmt->i_height, sizeof(*p_sys->p_buf) );
p_sys->p_buf2 = calloc( p_fmt->i_width * p_fmt->i_height, sizeof(*p_sys->p_buf) );
diff --git a/modules/video_filter/scene.c b/modules/video_filter/scene.c
index 337e14e..0e9a3f7 100644
--- a/modules/video_filter/scene.c
+++ b/modules/video_filter/scene.c
@@ -249,9 +249,7 @@ static void SnapshotRatio( filter_t *p_filter, picture_t *p_pic )
p_sys->i_height = p_pic->format.i_height;
}
- p_sys->scene.p_pic = picture_New( p_pic->format.i_chroma,
- p_pic->format.i_width, p_pic->format.i_height,
- p_pic->format.i_sar_num );
+ p_sys->scene.p_pic = picture_NewFromFormat( &p_pic->format );
if( p_sys->scene.p_pic )
{
picture_Copy( p_sys->scene.p_pic, p_pic );
More information about the vlc-devel
mailing list