Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
deca66fb
Commit
deca66fb
authored
Dec 15, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used a sar for picture_New/Setup.
parent
63b7c098
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
49 additions
and
37 deletions
+49
-37
include/vlc_picture.h
include/vlc_picture.h
+2
-2
include/vlc_vout.h
include/vlc_vout.h
+3
-3
modules/access/dc1394.c
modules/access/dc1394.c
+1
-2
modules/access/screen/screen.c
modules/access/screen/screen.c
+2
-1
modules/access/v4l.c
modules/access/v4l.c
+2
-2
modules/codec/rawvideo.c
modules/codec/rawvideo.c
+1
-1
modules/stream_out/mosaic_bridge.c
modules/stream_out/mosaic_bridge.c
+2
-1
modules/stream_out/switcher.c
modules/stream_out/switcher.c
+1
-2
modules/video_filter/audiobargraph_v.c
modules/video_filter/audiobargraph_v.c
+1
-1
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
...les/video_filter/dynamicoverlay/dynamicoverlay_commands.c
+3
-1
modules/video_filter/filter_common.h
modules/video_filter/filter_common.h
+2
-1
modules/video_filter/remoteosd.c
modules/video_filter/remoteosd.c
+1
-1
modules/video_filter/swscale.c
modules/video_filter/swscale.c
+4
-4
modules/video_output/hd1000v.cpp
modules/video_output/hd1000v.cpp
+2
-1
modules/video_output/svgalib.c
modules/video_output/svgalib.c
+2
-1
modules/video_output/wrapper.c
modules/video_output/wrapper.c
+2
-1
modules/video_output/xcb/xvideo.c
modules/video_output/xcb/xvideo.c
+1
-1
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+17
-11
No files found.
include/vlc_picture.h
View file @
deca66fb
...
...
@@ -135,7 +135,7 @@ struct picture_t
* with picture_Hold and picture_Release. This default management will release
* p_sys, p_q, p_data_orig fields if non NULL.
*/
VLC_EXPORT
(
picture_t
*
,
picture_New
,
(
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
aspect
)
);
VLC_EXPORT
(
picture_t
*
,
picture_New
,
(
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
sar_num
,
int
i_sar_den
)
);
/**
* This function will create a new picture using the given format.
...
...
@@ -298,7 +298,7 @@ VLC_EXPORT( int, picture_Export, ( vlc_object_t *p_obj, block_t **pp_image, vide
*
* It can be usefull to get the properties of planes.
*/
VLC_EXPORT
(
int
,
picture_Setup
,
(
picture_t
*
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
aspect
)
);
VLC_EXPORT
(
int
,
picture_Setup
,
(
picture_t
*
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
sar_num
,
int
i_sar_den
)
);
/*****************************************************************************
* Flags used to describe the status of a picture
...
...
include/vlc_vout.h
View file @
deca66fb
...
...
@@ -80,9 +80,9 @@ struct picture_heap_t
* \param i_height the wanted height for the picture.
* \param i_aspect the wanted aspect ratio for the picture.
*/
#define vout_AllocatePicture(a,b,c,d,e,f) \
__vout_AllocatePicture(VLC_OBJECT(a),b,c,d,e,f)
VLC_EXPORT
(
int
,
__vout_AllocatePicture
,(
vlc_object_t
*
p_this
,
picture_t
*
p_pic
,
uint32_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
aspect
)
);
#define vout_AllocatePicture(a,b,c,d,e,f
,g
) \
__vout_AllocatePicture(VLC_OBJECT(a),b,c,d,e,f
,g
)
VLC_EXPORT
(
int
,
__vout_AllocatePicture
,(
vlc_object_t
*
p_this
,
picture_t
*
p_pic
,
uint32_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
sar_num
,
int
i_sar_den
)
);
/**
...
...
modules/access/dc1394.c
View file @
deca66fb
...
...
@@ -382,8 +382,7 @@ static int Open( vlc_object_t *p_this )
i_height
=
p_sys
->
height
;
if
(
picture_Setup
(
&
p_sys
->
pic
,
VLC_CODEC_UYVY
,
i_width
,
i_height
,
i_width
*
VOUT_ASPECT_FACTOR
/
i_height
)
)
i_width
,
i_height
,
1
,
1
)
)
{
msg_Err
(
p_demux
,
"unknown chroma"
);
Close
(
p_this
);
...
...
modules/access/screen/screen.c
View file @
deca66fb
...
...
@@ -340,7 +340,8 @@ void RenderCursor( demux_t *p_demux, int i_x, int i_y,
p_sys
->
fmt
.
video
.
i_chroma
,
p_sys
->
fmt
.
video
.
i_width
,
p_sys
->
fmt
.
video
.
i_height
,
p_sys
->
fmt
.
video
.
i_aspect
);
p_sys
->
fmt
.
video
.
i_aspect
*
p_sys
->
fmt
.
video
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_sys
->
fmt
.
video
.
i_width
);
if
(
!
p_sys
->
p_blend
)
{
p_sys
->
p_blend
=
vlc_object_create
(
p_demux
,
sizeof
(
filter_t
)
);
...
...
modules/access/v4l.c
View file @
deca66fb
...
...
@@ -1085,8 +1085,8 @@ static int OpenVideoDev( demux_t *p_demux, char *psz_device )
{
/* Fill in picture_t fields */
if
(
picture_Setup
(
&
p_sys
->
pic
,
p_sys
->
i_fourcc
,
p_sys
->
i_width
,
p_sys
->
i_height
,
p_sys
->
i_width
*
VOUT_ASPECT_FACTOR
/
p_sys
->
i_height
)
)
p_sys
->
i_width
,
p_sys
->
i_height
,
1
,
1
)
)
{
msg_Err
(
p_demux
,
"unsupported chroma"
);
goto
vdev_failed
;
...
...
modules/codec/rawvideo.c
View file @
deca66fb
...
...
@@ -334,7 +334,7 @@ static block_t *SendFrame( decoder_t *p_dec, block_t *p_block )
/* Fill in picture_t fields */
picture_Setup
(
&
pic
,
p_dec
->
fmt_out
.
i_codec
,
p_dec
->
fmt_out
.
video
.
i_width
,
p_dec
->
fmt_out
.
video
.
i_height
,
VOUT_ASPECT_FACTOR
);
p_dec
->
fmt_out
.
video
.
i_height
,
0
,
1
);
if
(
!
pic
.
i_planes
)
{
...
...
modules/stream_out/mosaic_bridge.c
View file @
deca66fb
...
...
@@ -592,7 +592,8 @@ static int Send( sout_stream_t *p_stream, sout_stream_id_t *id,
p_new_pic
=
picture_New
(
p_pic
->
format
.
i_chroma
,
p_pic
->
format
.
i_width
,
p_pic
->
format
.
i_height
,
p_sys
->
p_decoder
->
fmt_out
.
video
.
i_aspect
);
p_sys
->
p_decoder
->
fmt_out
.
video
.
i_aspect
*
p_pic
->
format
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_pic
->
format
.
i_width
);
if
(
!
p_new_pic
)
{
picture_Release
(
p_pic
);
...
...
modules/stream_out/switcher.c
View file @
deca66fb
...
...
@@ -615,8 +615,7 @@ static int UnpackFromFile( sout_stream_t *p_stream, const char *psz_file,
}
if
(
picture_Setup
(
p_pic
,
VLC_CODEC_I420
,
i_width
,
i_height
,
i_width
*
VOUT_ASPECT_FACTOR
/
i_height
)
)
i_width
,
i_height
,
1
,
1
)
)
{
msg_Err
(
p_stream
,
"unknown chroma"
);
return
-
1
;
...
...
modules/video_filter/audiobargraph_v.c
View file @
deca66fb
...
...
@@ -551,7 +551,7 @@ static picture_t *LoadImage( vlc_object_t *p_this, int nbChannels, int* i_values
moinsDix
=
0
.
32
*
scale
+
20
;
moinsVingt
=
0
.
1
*
scale
+
20
;
p_pic
=
picture_New
(
VLC_FOURCC
(
'Y'
,
'U'
,
'V'
,
'A'
),
i_width
+
20
,
scale
+
30
,
VOUT_ASPECT_FACTOR
*
(
i_width
+
20
)
/
(
scale
+
30
)
);
p_pic
=
picture_New
(
VLC_FOURCC
(
'Y'
,
'U'
,
'V'
,
'A'
),
i_width
+
20
,
scale
+
30
,
1
,
1
);
// blacken the whole picture
for
(
i
=
0
;
i
<
p_pic
->
i_planes
;
i
++
)
...
...
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c
View file @
deca66fb
...
...
@@ -492,7 +492,9 @@ static int exec_DataSharedMem( filter_t *p_filter,
1
,
1
);
if
(
vout_AllocatePicture
(
p_filter
,
p_ovl
->
data
.
p_pic
,
p_ovl
->
format
.
i_chroma
,
p_params
->
i_width
,
p_params
->
i_height
,
p_ovl
->
format
.
i_aspect
)
)
p_params
->
i_height
,
p_ovl
->
format
.
i_aspect
*
p_params
->
i_height
,
VOUT_ASPECT_FACTOR
*
p_params
->
i_width
)
)
{
msg_Err
(
p_filter
,
"Unable to allocate picture"
);
free
(
p_ovl
->
data
.
p_pic
);
...
...
modules/video_filter/filter_common.h
View file @
deca66fb
...
...
@@ -50,7 +50,8 @@ static inline void vout_filter_AllocateDirectBuffers( vout_thread_t *p_vout, int
vout_AllocatePicture
(
VLC_OBJECT
(
p_vout
),
p_pic
,
p_vout
->
output
.
i_chroma
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
p_vout
->
output
.
i_aspect
);
p_vout
->
output
.
i_aspect
*
p_vout
->
output
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_vout
->
output
.
i_width
);
if
(
!
p_pic
->
i_planes
)
break
;
...
...
modules/video_filter/remoteosd.c
View file @
deca66fb
...
...
@@ -695,7 +695,7 @@ static void* vnc_worker_thread( vlc_object_t *p_thread_obj )
/* Create an empty picture for VNC the data */
vlc_mutex_lock
(
&
p_sys
->
lock
);
p_sys
->
p_pic
=
picture_New
(
VLC_CODEC_YUVA
,
p_sys
->
i_vnc_width
,
p_sys
->
i_vnc_height
,
VOUT_ASPECT_FACTOR
);
p_sys
->
i_vnc_width
,
p_sys
->
i_vnc_height
,
1
,
1
);
if
(
!
p_sys
->
p_pic
)
{
vlc_mutex_unlock
(
&
p_sys
->
lock
);
...
...
modules/video_filter/swscale.c
View file @
deca66fb
...
...
@@ -379,13 +379,13 @@ static int Init( filter_t *p_filter )
}
if
(
p_sys
->
ctxA
)
{
p_sys
->
p_src_a
=
picture_New
(
VLC_CODEC_GREY
,
i_fmti_width
,
p_fmti
->
i_height
,
0
);
p_sys
->
p_dst_a
=
picture_New
(
VLC_CODEC_GREY
,
i_fmto_width
,
p_fmto
->
i_height
,
0
);
p_sys
->
p_src_a
=
picture_New
(
VLC_CODEC_GREY
,
i_fmti_width
,
p_fmti
->
i_height
,
0
,
1
);
p_sys
->
p_dst_a
=
picture_New
(
VLC_CODEC_GREY
,
i_fmto_width
,
p_fmto
->
i_height
,
0
,
1
);
}
if
(
p_sys
->
i_extend_factor
!=
1
)
{
p_sys
->
p_src_e
=
picture_New
(
p_fmti
->
i_chroma
,
i_fmti_width
,
p_fmti
->
i_height
,
0
);
p_sys
->
p_dst_e
=
picture_New
(
p_fmto
->
i_chroma
,
i_fmto_width
,
p_fmto
->
i_height
,
0
);
p_sys
->
p_src_e
=
picture_New
(
p_fmti
->
i_chroma
,
i_fmti_width
,
p_fmti
->
i_height
,
0
,
1
);
p_sys
->
p_dst_e
=
picture_New
(
p_fmto
->
i_chroma
,
i_fmto_width
,
p_fmto
->
i_height
,
0
,
1
);
memset
(
p_sys
->
p_src_e
->
p
[
0
].
p_pixels
,
0
,
p_sys
->
p_src_e
->
p
[
0
].
i_pitch
*
p_sys
->
p_src_e
->
p
[
0
].
i_lines
);
memset
(
p_sys
->
p_dst_e
->
p
[
0
].
p_pixels
,
0
,
p_sys
->
p_dst_e
->
p
[
0
].
i_pitch
*
p_sys
->
p_dst_e
->
p
[
0
].
i_lines
);
...
...
modules/video_output/hd1000v.cpp
View file @
deca66fb
...
...
@@ -259,7 +259,8 @@ static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
/* Fill in picture_t fields */
picture_Setup
(
p_pic
,
p_vout
->
output
.
i_chroma
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
p_vout
->
output
.
i_aspect
);
p_vout
->
output
.
i_aspect
*
p_vout
->
output
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_vout
->
output
.
i_width
);
p_pic
->
p_sys
->
p_image
=
new
CascadeSharedMemZone
();
if
(
p_pic
->
p_sys
->
p_image
==
NULL
)
...
...
modules/video_output/svgalib.c
View file @
deca66fb
...
...
@@ -183,7 +183,8 @@ static int Init( vout_thread_t *p_vout )
vout_AllocatePicture
(
p_vout
,
p_pic
,
p_vout
->
output
.
i_chroma
,
p_vout
->
output
.
i_width
,
p_vout
->
output
.
i_height
,
p_vout
->
output
.
i_aspect
);
p_vout
->
output
.
i_aspect
*
p_vout
->
output
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_vout
->
output
.
i_width
);
if
(
p_pic
->
i_planes
==
0
)
{
...
...
modules/video_output/wrapper.c
View file @
deca66fb
...
...
@@ -318,7 +318,8 @@ static int Init(vout_thread_t *vout)
vout_AllocatePicture
(
VLC_OBJECT
(
vd
),
picture
,
vd
->
source
.
i_chroma
,
vd
->
source
.
i_width
,
vd
->
source
.
i_height
,
vd
->
source
.
i_aspect
);
vd
->
source
.
i_aspect
*
vd
->
source
.
i_height
,
VOUT_ASPECT_FACTOR
*
vd
->
source
.
i_width
);
if
(
!
picture
->
i_planes
)
break
;
picture
->
p_sys
->
direct
=
NULL
;
...
...
modules/video_output/xcb/xvideo.c
View file @
deca66fb
...
...
@@ -572,7 +572,7 @@ static picture_pool_t *Pool (vout_display_t *vd, unsigned requested_count)
if
(
!
p_sys
->
pool
)
{
picture_t
*
pic
=
picture_New
(
vd
->
fmt
.
i_chroma
,
p_sys
->
att
->
width
,
p_sys
->
att
->
height
,
0
);
p_sys
->
att
->
height
,
0
,
1
);
if
(
!
pic
)
return
NULL
;
...
...
src/video_output/vout_pictures.c
View file @
deca66fb
...
...
@@ -170,7 +170,8 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
vout_AllocatePicture
(
VLC_OBJECT
(
p_vout
),
p_freepic
,
p_vout
->
render
.
i_chroma
,
p_vout
->
render
.
i_width
,
p_vout
->
render
.
i_height
,
p_vout
->
render
.
i_aspect
);
p_vout
->
render
.
i_aspect
*
p_vout
->
render
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_vout
->
render
.
i_width
);
if
(
p_freepic
->
i_planes
)
{
...
...
@@ -408,7 +409,8 @@ picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
p_tmp_pic
,
p_vout
->
fmt_out
.
i_chroma
,
p_vout
->
fmt_out
.
i_width
,
p_vout
->
fmt_out
.
i_height
,
p_vout
->
fmt_out
.
i_aspect
);
p_vout
->
fmt_out
.
i_aspect
*
p_vout
->
fmt_out
.
i_height
,
VOUT_ASPECT_FACTOR
*
p_vout
->
fmt_out
.
i_width
);
p_tmp_pic
->
i_type
=
MEMORY_PICTURE
;
p_tmp_pic
->
i_status
=
RESERVED_PICTURE
;
}
...
...
@@ -553,7 +555,8 @@ void vout_PlacePicture( const vout_thread_t *p_vout,
*/
int
__vout_AllocatePicture
(
vlc_object_t
*
p_this
,
picture_t
*
p_pic
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
int
i_width
,
int
i_height
,
int
i_sar_num
,
int
i_sar_den
)
{
VLC_UNUSED
(
p_this
);
int
i_index
,
i_width_aligned
,
i_height_aligned
;
...
...
@@ -562,8 +565,8 @@ int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
i_width_aligned
=
(
i_width
+
15
)
>>
4
<<
4
;
i_height_aligned
=
(
i_height
+
15
)
>>
4
<<
4
;
if
(
picture_Setup
(
p_pic
,
i_chroma
,
i_
width
,
i_height
,
i_aspect
)
!=
VLC_SUCCESS
)
if
(
picture_Setup
(
p_pic
,
i_chroma
,
i_width
,
i_height
,
i_
sar_num
,
i_sar_den
)
!=
VLC_SUCCESS
)
{
p_pic
->
i_planes
=
0
;
return
VLC_EGENERIC
;
...
...
@@ -693,7 +696,8 @@ void picture_Reset( picture_t *p_picture )
/*****************************************************************************
*
*****************************************************************************/
int
picture_Setup
(
picture_t
*
p_picture
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
int
picture_Setup
(
picture_t
*
p_picture
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_sar_num
,
int
i_sar_den
)
{
int
i_index
,
i_width_aligned
,
i_height_aligned
;
...
...
@@ -715,7 +719,7 @@ int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma, int i_width, int
p_picture
->
p_q
=
NULL
;
video_format_Setup
(
&
p_picture
->
format
,
i_chroma
,
i_width
,
i_height
,
i_
aspect
*
i_height
,
VOUT_ASPECT_FACTOR
*
i_width
);
i_
sar_num
,
i_sar_den
);
/* Make sure the real dimensions are a multiple of 16 */
i_width_aligned
=
(
i_width
+
15
)
>>
4
<<
4
;
...
...
@@ -959,7 +963,8 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
if
(
p_resource
)
{
if
(
picture_Setup
(
p_picture
,
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_aspect
)
)
if
(
picture_Setup
(
p_picture
,
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_sar_num
,
fmt
.
i_sar_den
)
)
{
free
(
p_picture
);
return
NULL
;
...
...
@@ -976,7 +981,8 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
else
{
if
(
__vout_AllocatePicture
(
NULL
,
p_picture
,
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_aspect
)
)
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_sar_num
,
fmt
.
i_sar_den
)
)
{
free
(
p_picture
);
return
NULL
;
...
...
@@ -994,13 +1000,13 @@ picture_t *picture_NewFromFormat( const video_format_t *p_fmt )
{
return
picture_NewFromResource
(
p_fmt
,
NULL
);
}
picture_t
*
picture_New
(
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
aspect
)
picture_t
*
picture_New
(
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_
sar_num
,
int
i_sar_den
)
{
video_format_t
fmt
;
memset
(
&
fmt
,
0
,
sizeof
(
fmt
)
);
video_format_Setup
(
&
fmt
,
i_chroma
,
i_width
,
i_height
,
i_
aspect
*
i_height
,
VOUT_ASPECT_FACTOR
*
i_width
);
i_
sar_num
,
i_sar_den
);
return
picture_NewFromFormat
(
&
fmt
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment