Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
04b0143d
Commit
04b0143d
authored
Jan 27, 2014
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
picture_Setup: set visible dimensions correctly
parent
b07ed16e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
30 deletions
+14
-30
include/vlc_picture.h
include/vlc_picture.h
+1
-1
modules/access/screen/screen.c
modules/access/screen/screen.c
+1
-6
modules/codec/rawvideo.c
modules/codec/rawvideo.c
+3
-12
src/misc/picture.c
src/misc/picture.c
+9
-11
No files found.
include/vlc_picture.h
View file @
04b0143d
...
...
@@ -235,7 +235,7 @@ VLC_API int picture_Export( vlc_object_t *p_obj, block_t **pp_image, video_forma
*
* It can be useful to get the properties of planes.
*/
VLC_API
int
picture_Setup
(
picture_t
*
,
v
lc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_sar_num
,
int
i_sar_den
);
VLC_API
int
picture_Setup
(
picture_t
*
,
v
ideo_format_t
*
);
/**
...
...
modules/access/screen/screen.c
View file @
04b0143d
...
...
@@ -348,12 +348,7 @@ void RenderCursor( demux_t *p_demux, int i_x, int i_y,
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
if
(
!
p_sys
->
dst
.
i_planes
)
picture_Setup
(
&
p_sys
->
dst
,
p_sys
->
fmt
.
video
.
i_chroma
,
p_sys
->
fmt
.
video
.
i_width
,
p_sys
->
fmt
.
video
.
i_height
,
p_sys
->
fmt
.
video
.
i_sar_num
,
p_sys
->
fmt
.
video
.
i_sar_den
);
picture_Setup
(
&
p_sys
->
dst
,
&
p_sys
->
fmt
.
video
);
if
(
!
p_sys
->
p_blend
)
{
p_sys
->
p_blend
=
vlc_object_create
(
p_demux
,
sizeof
(
filter_t
)
);
...
...
modules/codec/rawvideo.c
View file @
04b0143d
...
...
@@ -182,9 +182,8 @@ static int OpenDecoder( vlc_object_t *p_this )
p_dec
->
fmt_in
.
video
.
i_sar_num
,
p_dec
->
fmt_in
.
video
.
i_sar_den
);
picture_t
picture
;
picture_Setup
(
&
picture
,
p_dec
->
fmt_out
.
i_codec
,
p_dec
->
fmt_in
.
video
.
i_width
,
p_dec
->
fmt_in
.
video
.
i_height
,
0
,
1
);
picture_Setup
(
&
picture
,
&
p_dec
->
fmt_out
);
p_sys
->
i_raw_size
=
0
;
for
(
int
i
=
0
;
i
<
picture
.
i_planes
;
i
++
)
{
...
...
@@ -193,12 +192,6 @@ static int OpenDecoder( vlc_object_t *p_this )
p_sys
->
planes
[
i
]
=
picture
.
p
[
i
];
}
if
(
!
p_dec
->
fmt_in
.
video
.
i_sar_num
||
!
p_dec
->
fmt_in
.
video
.
i_sar_den
)
{
p_dec
->
fmt_out
.
video
.
i_sar_num
=
1
;
p_dec
->
fmt_out
.
video
.
i_sar_den
=
1
;
}
/* Set callbacks */
p_dec
->
pf_decode_video
=
(
picture_t
*
(
*
)(
decoder_t
*
,
block_t
**
))
DecodeBlock
;
...
...
@@ -361,9 +354,7 @@ static block_t *SendFrame( decoder_t *p_dec, block_t *p_block )
int
i
,
j
;
/* 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
,
0
,
1
);
picture_Setup
(
&
pic
,
&
p_dec
->
fmt_out
);
if
(
!
pic
.
i_planes
)
{
...
...
src/misc/picture.c
View file @
04b0143d
...
...
@@ -128,8 +128,7 @@ static int LCM( int a, int b )
return
a
*
b
/
GCD
(
a
,
b
);
}
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
picture_Setup
(
picture_t
*
p_picture
,
video_format_t
*
fmt
)
{
/* Store default values */
p_picture
->
i_planes
=
0
;
...
...
@@ -146,9 +145,9 @@ 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
);
video_format_Setup
(
&
p_picture
->
format
,
fmt
->
i_chroma
,
fmt
->
i_width
,
fmt
->
i_height
,
fmt
->
i_visible_width
,
fmt
->
i_visible
_height
,
fmt
->
i_sar_num
,
fmt
->
i_sar_den
);
const
vlc_chroma_description_t
*
p_dsc
=
vlc_fourcc_GetChromaDescription
(
p_picture
->
format
.
i_chroma
);
...
...
@@ -173,17 +172,17 @@ int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma,
}
i_modulo_h
=
LCM
(
i_modulo_h
,
32
);
const
int
i_width_aligned
=
(
i_width
+
i_modulo_w
-
1
)
/
i_modulo_w
*
i_modulo_w
;
const
int
i_height_aligned
=
(
i_height
+
i_modulo_h
-
1
)
/
i_modulo_h
*
i_modulo_h
;
const
int
i_width_aligned
=
(
fmt
->
i_width
+
i_modulo_w
-
1
)
/
i_modulo_w
*
i_modulo_w
;
const
int
i_height_aligned
=
(
fmt
->
i_height
+
i_modulo_h
-
1
)
/
i_modulo_h
*
i_modulo_h
;
const
int
i_height_extra
=
2
*
i_ratio_h
;
/* This one is a hack for some ASM functions */
for
(
unsigned
i
=
0
;
i
<
p_dsc
->
plane_count
;
i
++
)
{
plane_t
*
p
=
&
p_picture
->
p
[
i
];
p
->
i_lines
=
(
i_height_aligned
+
i_height_extra
)
*
p_dsc
->
p
[
i
].
h
.
num
/
p_dsc
->
p
[
i
].
h
.
den
;
p
->
i_visible_lines
=
i
_height
*
p_dsc
->
p
[
i
].
h
.
num
/
p_dsc
->
p
[
i
].
h
.
den
;
p
->
i_visible_lines
=
fmt
->
i_visible
_height
*
p_dsc
->
p
[
i
].
h
.
num
/
p_dsc
->
p
[
i
].
h
.
den
;
p
->
i_pitch
=
i_width_aligned
*
p_dsc
->
p
[
i
].
w
.
num
/
p_dsc
->
p
[
i
].
w
.
den
*
p_dsc
->
pixel_size
;
p
->
i_visible_pitch
=
i
_width
*
p_dsc
->
p
[
i
].
w
.
num
/
p_dsc
->
p
[
i
].
w
.
den
*
p_dsc
->
pixel_size
;
p
->
i_visible_pitch
=
fmt
->
i_visible
_width
*
p_dsc
->
p
[
i
].
w
.
num
/
p_dsc
->
p
[
i
].
w
.
den
*
p_dsc
->
pixel_size
;
p
->
i_pixel_pitch
=
p_dsc
->
pixel_size
;
assert
(
(
p
->
i_pitch
%
16
)
==
0
);
...
...
@@ -217,8 +216,7 @@ picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_r
return
NULL
;
/* Make sure the real dimensions are a multiple of 16 */
if
(
picture_Setup
(
p_picture
,
fmt
.
i_chroma
,
fmt
.
i_width
,
fmt
.
i_height
,
fmt
.
i_sar_num
,
fmt
.
i_sar_den
)
)
if
(
picture_Setup
(
p_picture
,
&
fmt
)
)
{
free
(
p_picture
);
return
NULL
;
...
...
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