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
793671b6
Commit
793671b6
authored
Apr 23, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add vlc_va_GetChroma() helper
parent
072dac3f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
modules/codec/avcodec/va.c
modules/codec/avcodec/va.c
+41
-0
modules/codec/avcodec/va.h
modules/codec/avcodec/va.h
+9
-0
No files found.
modules/codec/avcodec/va.c
View file @
793671b6
...
...
@@ -25,9 +25,50 @@
#include <vlc_common.h>
#include <vlc_modules.h>
#include <vlc_fourcc.h>
#include <libavutil/pixfmt.h>
#include <libavcodec/avcodec.h>
#include "va.h"
vlc_fourcc_t
vlc_va_GetChroma
(
enum
PixelFormat
hwfmt
,
enum
PixelFormat
swfmt
)
{
/* NOTE: At the time of writing this comment, the return value was only
* used to probe support as decoder output. So incorrect values were not
* fatal, especially not if a software format. */
switch
(
hwfmt
)
{
case
AV_PIX_FMT_VAAPI_VLD
:
return
VLC_CODEC_YV12
;
case
AV_PIX_FMT_DXVA2_VLD
:
return
VLC_CODEC_YV12
;
#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(53, 14, 0))
case
AV_PIX_FMT_VDA_VLD
:
return
VLC_CODEC_UYVY
;
#endif
#if (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(52, 4, 0))
case
AV_PIX_FMT_VDPAU
:
switch
(
swfmt
)
{
case
AV_PIX_FMT_YUVJ444P
:
case
AV_PIX_FMT_YUV444P
:
return
VLC_CODEC_VDPAU_VIDEO_444
;
case
AV_PIX_FMT_YUVJ422P
:
case
AV_PIX_FMT_YUV422P
:
return
VLC_CODEC_VDPAU_VIDEO_422
;
case
AV_PIX_FMT_YUVJ420P
:
case
AV_PIX_FMT_YUV420P
:
return
VLC_CODEC_VDPAU_VIDEO_420
;
default:
return
0
;
}
break
;
#endif
default:
return
0
;
}
}
static
int
vlc_va_Start
(
void
*
func
,
va_list
ap
)
{
vlc_va_t
*
va
=
va_arg
(
ap
,
vlc_va_t
*
);
...
...
modules/codec/avcodec/va.h
View file @
793671b6
...
...
@@ -42,6 +42,15 @@ struct vlc_va_t {
int
(
*
extract
)(
vlc_va_t
*
,
picture_t
*
pic
,
uint8_t
*
data
);
};
/**
* Determines the VLC video chroma value for a pair of hardware acceleration
* PixelFormat and software PixelFormat.
* @param hwfmt the hardware acceleration pixel format
* @param swfmt the software pixel format
* @return a VLC chroma value, or 0 on error.
*/
vlc_fourcc_t
vlc_va_GetChroma
(
enum
PixelFormat
hwfmt
,
enum
PixelFormat
swfmt
);
/**
* Creates an accelerated video decoding back-end for libavcodec.
* @param obj parent VLC object
...
...
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