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
9cf0b9d4
Commit
9cf0b9d4
authored
Nov 13, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added video_format_ScaleCropAr().
It computes correct crop/ar settings when scaling a video format.
parent
351139f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
include/vlc_es.h
include/vlc_es.h
+5
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/es_format.c
src/misc/es_format.c
+18
-0
No files found.
include/vlc_es.h
View file @
9cf0b9d4
...
...
@@ -177,6 +177,11 @@ VLC_EXPORT( void, video_format_Setup, ( video_format_t *, vlc_fourcc_t i_chroma,
*/
VLC_EXPORT
(
void
,
video_format_CopyCrop
,
(
video_format_t
*
,
const
video_format_t
*
)
);
/**
* It will compute the crop/ar properties when scaling.
*/
VLC_EXPORT
(
void
,
video_format_ScaleCropAr
,
(
video_format_t
*
,
const
video_format_t
*
)
);
/**
* This function will check if the first video format is similar
* to the second one.
...
...
src/libvlccore.sym
View file @
9cf0b9d4
...
...
@@ -486,6 +486,7 @@ var_Type
var_Inherit
var_InheritURational
video_format_CopyCrop
video_format_ScaleCropAr
video_format_FixRgb
video_format_IsSimilar
video_format_Setup
...
...
src/misc/es_format.c
View file @
9cf0b9d4
...
...
@@ -215,6 +215,24 @@ void video_format_CopyCrop( video_format_t *p_dst, const video_format_t *p_src )
p_dst
->
i_visible_height
=
p_src
->
i_visible_height
;
}
void
video_format_ScaleCropAr
(
video_format_t
*
p_dst
,
const
video_format_t
*
p_src
)
{
p_dst
->
i_x_offset
=
(
uint64_t
)
p_src
->
i_x_offset
*
p_dst
->
i_width
/
p_src
->
i_width
;
p_dst
->
i_y_offset
=
(
uint64_t
)
p_src
->
i_y_offset
*
p_dst
->
i_height
/
p_src
->
i_height
;
p_dst
->
i_visible_width
=
(
uint64_t
)
p_src
->
i_visible_width
*
p_dst
->
i_width
/
p_src
->
i_width
;
p_dst
->
i_visible_height
=
(
uint64_t
)
p_src
->
i_visible_height
*
p_dst
->
i_height
/
p_src
->
i_height
;
p_dst
->
i_sar_num
*=
p_src
->
i_width
;
p_dst
->
i_sar_den
*=
p_dst
->
i_width
;
vlc_ureduce
(
&
p_dst
->
i_sar_num
,
&
p_dst
->
i_sar_den
,
p_dst
->
i_sar_num
,
p_dst
->
i_sar_den
,
65536
);
p_dst
->
i_sar_num
*=
p_dst
->
i_height
;
p_dst
->
i_sar_den
*=
p_src
->
i_height
;
vlc_ureduce
(
&
p_dst
->
i_sar_num
,
&
p_dst
->
i_sar_den
,
p_dst
->
i_sar_num
,
p_dst
->
i_sar_den
,
65536
);
}
bool
video_format_IsSimilar
(
const
video_format_t
*
p_fmt1
,
const
video_format_t
*
p_fmt2
)
{
video_format_t
v1
=
*
p_fmt1
;
...
...
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