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
4e34f941
Commit
4e34f941
authored
Aug 05, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added YUV fourcc helpers mainly for vout.
parent
76c81b47
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
170 additions
and
0 deletions
+170
-0
include/vlc_fourcc.h
include/vlc_fourcc.h
+15
-0
src/libvlccore.sym
src/libvlccore.sym
+2
-0
src/misc/fourcc.c
src/misc/fourcc.c
+153
-0
No files found.
include/vlc_fourcc.h
View file @
4e34f941
...
...
@@ -350,5 +350,20 @@ VLC_EXPORT( vlc_fourcc_t, vlc_fourcc_GetCodecAudio, ( vlc_fourcc_t i_fourcc, int
*/
VLC_EXPORT
(
const
char
*
,
vlc_fourcc_GetDescription
,
(
int
i_cat
,
vlc_fourcc_t
i_fourcc
)
);
/**
* It returns a list (terminated with the value 0) of YUV fourccs in
* decreasing priority order for the given chroma.
*
* It will always return a non NULL pointer that must not freed.
*/
VLC_EXPORT
(
const
vlc_fourcc_t
*
,
vlc_fourcc_GetYUVFallback
,
(
vlc_fourcc_t
)
);
/**
* It returns true if the two fourccs are equivalent if their U&V planes are
* swapped.
*/
VLC_EXPORT
(
bool
,
vlc_fourcc_AreUVPlanesSwapped
,
(
vlc_fourcc_t
,
vlc_fourcc_t
)
);
#endif
/* _VLC_FOURCC_H */
src/libvlccore.sym
View file @
4e34f941
...
...
@@ -483,6 +483,8 @@ vlc_fourcc_GetCodec
vlc_fourcc_GetCodecAudio
vlc_fourcc_GetCodecFromString
vlc_fourcc_GetDescription
vlc_fourcc_GetYUVFallback
vlc_fourcc_AreUVPlanesSwapped
vlc_gai_strerror
vlc_gc_init
vlc_getaddrinfo
...
...
src/misc/fourcc.c
View file @
4e34f941
...
...
@@ -1283,3 +1283,156 @@ const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc )
return
e
.
psz_description
;
}
/* */
#define VLC_CODEC_YUV_PLANAR_420 \
VLC_CODEC_I420, VLC_CODEC_YV12, VLC_CODEC_J420
#define VLC_CODEC_YUV_PLANAR_422 \
VLC_CODEC_I422, VLC_CODEC_J422
#define VLC_CODEC_YUV_PLANAR_440 \
VLC_CODEC_I440, VLC_CODEC_J440
#define VLC_CODEC_YUV_PLANAR_444 \
VLC_CODEC_I444, VLC_CODEC_J444
#define VLC_CODEC_YUV_PACKED \
VLC_CODEC_YUYV, VLC_CODEC_YVYU, \
VLC_CODEC_UYVY, VLC_CODEC_VYUY
#define VLC_CODEC_FALLBACK_420 \
VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
VLC_CODEC_I411, VLC_CODEC_I410, VLC_CODEC_Y211
static
const
vlc_fourcc_t
p_I420_fallback
[]
=
{
VLC_CODEC_I420
,
VLC_CODEC_YV12
,
VLC_CODEC_J420
,
VLC_CODEC_FALLBACK_420
,
0
};
static
const
vlc_fourcc_t
p_J420_fallback
[]
=
{
VLC_CODEC_J420
,
VLC_CODEC_I420
,
VLC_CODEC_YV12
,
VLC_CODEC_FALLBACK_420
,
0
};
static
const
vlc_fourcc_t
p_YV12_fallback
[]
=
{
VLC_CODEC_YV12
,
VLC_CODEC_I420
,
VLC_CODEC_J420
,
VLC_CODEC_FALLBACK_420
,
0
};
#define VLC_CODEC_FALLBACK_422 \
VLC_CODEC_YUV_PACKED, VLC_CODEC_YUV_PLANAR_420, \
VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
VLC_CODEC_I411, VLC_CODEC_I410, VLC_CODEC_Y211
static
const
vlc_fourcc_t
p_I422_fallback
[]
=
{
VLC_CODEC_I422
,
VLC_CODEC_J422
,
VLC_CODEC_FALLBACK_422
,
0
};
static
const
vlc_fourcc_t
p_J422_fallback
[]
=
{
VLC_CODEC_J422
,
VLC_CODEC_I422
,
VLC_CODEC_FALLBACK_422
,
0
};
#define VLC_CODEC_FALLBACK_444 \
VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PACKED, \
VLC_CODEC_YUV_PLANAR_420, VLC_CODEC_YUV_PLANAR_440, \
VLC_CODEC_I411, VLC_CODEC_I410, VLC_CODEC_Y211
static
const
vlc_fourcc_t
p_I444_fallback
[]
=
{
VLC_CODEC_I444
,
VLC_CODEC_J444
,
VLC_CODEC_FALLBACK_444
,
0
};
static
const
vlc_fourcc_t
p_J444_fallback
[]
=
{
VLC_CODEC_J444
,
VLC_CODEC_I444
,
VLC_CODEC_FALLBACK_444
,
0
};
static
const
vlc_fourcc_t
p_I440_fallback
[]
=
{
VLC_CODEC_I440
,
VLC_CODEC_YUV_PLANAR_420
,
VLC_CODEC_YUV_PLANAR_422
,
VLC_CODEC_YUV_PLANAR_444
,
VLC_CODEC_YUV_PACKED
,
VLC_CODEC_I411
,
VLC_CODEC_I410
,
VLC_CODEC_Y211
,
};
#define VLC_CODEC_FALLBACK_PACKED \
VLC_CODEC_YUV_PLANAR_422, VLC_CODEC_YUV_PLANAR_420, \
VLC_CODEC_YUV_PLANAR_444, VLC_CODEC_YUV_PLANAR_440, \
VLC_CODEC_I411, VLC_CODEC_I410, VLC_CODEC_Y211
static
const
vlc_fourcc_t
p_YUYV_fallback
[]
=
{
VLC_CODEC_YUYV
,
VLC_CODEC_YVYU
,
VLC_CODEC_UYVY
,
VLC_CODEC_VYUY
,
VLC_CODEC_FALLBACK_PACKED
,
0
};
static
const
vlc_fourcc_t
p_YVYU_fallback
[]
=
{
VLC_CODEC_YVYU
,
VLC_CODEC_YUYV
,
VLC_CODEC_UYVY
,
VLC_CODEC_VYUY
,
VLC_CODEC_FALLBACK_PACKED
,
0
};
static
const
vlc_fourcc_t
p_UYVY_fallback
[]
=
{
VLC_CODEC_UYVY
,
VLC_CODEC_VYUY
,
VLC_CODEC_YUYV
,
VLC_CODEC_YVYU
,
VLC_CODEC_FALLBACK_PACKED
,
0
};
static
const
vlc_fourcc_t
p_VYUY_fallback
[]
=
{
VLC_CODEC_VYUY
,
VLC_CODEC_UYVY
,
VLC_CODEC_YUYV
,
VLC_CODEC_YVYU
,
VLC_CODEC_FALLBACK_PACKED
,
0
};
static
const
vlc_fourcc_t
*
pp_YUV_fallback
[]
=
{
p_YV12_fallback
,
p_I420_fallback
,
p_J420_fallback
,
p_I422_fallback
,
p_J422_fallback
,
p_I444_fallback
,
p_J444_fallback
,
p_I440_fallback
,
p_YUYV_fallback
,
p_YVYU_fallback
,
p_UYVY_fallback
,
p_VYUY_fallback
,
NULL
,
};
static
const
vlc_fourcc_t
p_list_YUV
[]
=
{
VLC_CODEC_YUV_PLANAR_420
,
VLC_CODEC_YUV_PLANAR_422
,
VLC_CODEC_YUV_PLANAR_440
,
VLC_CODEC_YUV_PLANAR_444
,
VLC_CODEC_YUV_PACKED
,
VLC_CODEC_I411
,
VLC_CODEC_I410
,
VLC_CODEC_Y211
,
0
,
};
const
vlc_fourcc_t
*
vlc_fourcc_GetYUVFallback
(
vlc_fourcc_t
i_fourcc
)
{
for
(
unsigned
i
=
0
;
pp_YUV_fallback
[
i
];
i
++
)
{
if
(
pp_YUV_fallback
[
i
][
0
]
==
i_fourcc
)
return
pp_YUV_fallback
[
i
];
}
return
p_list_YUV
;
}
bool
vlc_fourcc_AreUVPlanesSwapped
(
vlc_fourcc_t
a
,
vlc_fourcc_t
b
)
{
return
(((
a
==
VLC_CODEC_I420
||
a
==
VLC_CODEC_J420
)
&&
b
==
VLC_CODEC_YV12
)
||
((
b
==
VLC_CODEC_I420
||
b
==
VLC_CODEC_J420
)
&&
a
==
VLC_CODEC_YV12
));
}
#if 0
static inline bool vlc_fourcc_IsYUV(vlc_fourcc_t fcc)
{
for( unsigned i = 0; p_list_YUV[i]; i++ )
{
if( p_list_YUV[i] == fcc )
return true;
}
return false;
}
#endif
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