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
50b81b09
Commit
50b81b09
authored
Jun 06, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added video_format/es_format_IsSimilar helper.
parent
1df51e7c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
0 deletions
+86
-0
include/vlc_es.h
include/vlc_es.h
+14
-0
src/libvlccore.sym
src/libvlccore.sym
+2
-0
src/misc/es_format.c
src/misc/es_format.c
+70
-0
No files found.
include/vlc_es.h
View file @
50b81b09
...
...
@@ -177,6 +177,12 @@ static inline void video_format_Clean( video_format_t *p_src )
*/
VLC_EXPORT
(
void
,
video_format_Setup
,
(
video_format_t
*
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
);
/**
* This function will check if the first video format is similar
* to the second one.
*/
VLC_EXPORT
(
bool
,
video_format_IsSimilar
,
(
const
video_format_t
*
,
const
video_format_t
*
)
);
/**
* subtitles format description
*/
...
...
@@ -293,4 +299,12 @@ VLC_EXPORT( int, es_format_Copy, ( es_format_t *p_dst, const es_format_t *p_src
*/
VLC_EXPORT
(
void
,
es_format_Clean
,
(
es_format_t
*
fmt
)
);
/**
* This function will check if the first ES format is similar
* to the second one.
*
* All descriptive fields are ignored.
*/
VLC_EXPORT
(
bool
,
es_format_IsSimilar
,
(
const
es_format_t
*
,
const
es_format_t
*
)
);
#endif
src/libvlccore.sym
View file @
50b81b09
...
...
@@ -121,6 +121,7 @@ EnsureUTF8
es_format_Clean
es_format_Copy
es_format_Init
es_format_IsSimilar
filename_sanitize
filter_Blend
filter_chain_AppendFilter
...
...
@@ -442,6 +443,7 @@ var_SetChecked
__var_TriggerCallback
__var_Type
video_format_FixRgb
video_format_IsSimilar
video_format_Setup
vlc_avcodec_mutex
vlc_b64_decode
...
...
src/misc/es_format.c
View file @
50b81b09
...
...
@@ -31,6 +31,7 @@
#include <vlc_common.h>
#include <vlc_es.h>
#include <vlc_aout.h>
/*****************************************************************************
...
...
@@ -201,6 +202,35 @@ void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma, int i_wid
break
;
}
}
bool
video_format_IsSimilar
(
const
video_format_t
*
p_fmt1
,
const
video_format_t
*
p_fmt2
)
{
video_format_t
v1
=
*
p_fmt1
;
video_format_t
v2
=
*
p_fmt2
;
if
(
v1
.
i_chroma
!=
v2
.
i_chroma
)
return
false
;
if
(
v1
.
i_width
!=
v2
.
i_width
||
v1
.
i_height
!=
v2
.
i_height
||
v1
.
i_visible_width
!=
v2
.
i_visible_width
||
v1
.
i_visible_height
!=
v2
.
i_visible_height
||
v1
.
i_x_offset
!=
v2
.
i_x_offset
||
v1
.
i_y_offset
!=
v2
.
i_y_offset
)
return
false
;
if
(
v1
.
i_chroma
==
VLC_CODEC_RGB15
||
v1
.
i_chroma
==
VLC_CODEC_RGB16
||
v1
.
i_chroma
==
VLC_CODEC_RGB24
||
v1
.
i_chroma
==
VLC_CODEC_RGB32
)
{
video_format_FixRgb
(
&
v1
);
video_format_FixRgb
(
&
v2
);
if
(
v1
.
i_rmask
!=
v2
.
i_rmask
||
v1
.
i_gmask
!=
v2
.
i_gmask
||
v1
.
i_bmask
!=
v2
.
i_bmask
)
return
false
;
}
return
true
;
}
void
es_format_Init
(
es_format_t
*
fmt
,
int
i_cat
,
vlc_fourcc_t
i_codec
)
...
...
@@ -313,3 +343,43 @@ void es_format_Clean( es_format_t *fmt )
memset
(
fmt
,
0
,
sizeof
(
*
fmt
)
);
}
bool
es_format_IsSimilar
(
const
es_format_t
*
p_fmt1
,
const
es_format_t
*
p_fmt2
)
{
if
(
p_fmt1
->
i_cat
!=
p_fmt2
->
i_cat
||
vlc_fourcc_GetCodec
(
p_fmt1
->
i_cat
,
p_fmt1
->
i_codec
)
!=
vlc_fourcc_GetCodec
(
p_fmt2
->
i_cat
,
p_fmt2
->
i_codec
)
)
return
false
;
switch
(
p_fmt1
->
i_cat
)
{
case
AUDIO_ES
:
{
audio_format_t
a1
=
p_fmt1
->
audio
;
audio_format_t
a2
=
p_fmt2
->
audio
;
if
(
a1
.
i_format
&&
a2
.
i_format
&&
a1
.
i_format
!=
a2
.
i_format
)
return
false
;
if
(
a1
.
i_rate
!=
a2
.
i_rate
||
a1
.
i_physical_channels
!=
a2
.
i_physical_channels
||
a1
.
i_original_channels
!=
a2
.
i_original_channels
)
return
false
;
return
true
;
}
case
VIDEO_ES
:
{
video_format_t
v1
=
p_fmt1
->
video
;
video_format_t
v2
=
p_fmt2
->
video
;
if
(
!
v1
.
i_chroma
)
v1
.
i_chroma
=
vlc_fourcc_GetCodec
(
p_fmt1
->
i_cat
,
p_fmt1
->
i_codec
);
if
(
!
v2
.
i_chroma
)
v2
.
i_chroma
=
vlc_fourcc_GetCodec
(
p_fmt1
->
i_cat
,
p_fmt2
->
i_codec
);
return
video_format_IsSimilar
(
&
p_fmt1
->
video
,
&
p_fmt2
->
video
);
}
case
SPU_ES
:
default:
return
true
;
}
}
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