Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
858eba0c
Commit
858eba0c
authored
Apr 13, 2020
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: Extend hardware config metadata to encoders
parent
2594f6a3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
avcodec.h
libavcodec/avcodec.h
+10
-1
hwconfig.h
libavcodec/hwconfig.h
+18
-0
No files found.
libavcodec/avcodec.h
View file @
858eba0c
...
...
@@ -2541,6 +2541,10 @@ enum {
* AVCodecContext.hw_frames_ctx should be set to a suitable frames
* context inside the get_format() callback. The frames context
* must have been created on a device of the specified type.
*
* When selecting this format for an encoder,
* AVCodecContext.hw_frames_ctx should be set to the context which
* will be used for the input frames before calling avcodec_open2().
*/
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX
=
0x02
,
/**
...
...
@@ -2563,7 +2567,12 @@ enum {
typedef
struct
AVCodecHWConfig
{
/**
* A hardware pixel format which the codec can use.
* For decoders, a hardware pixel format which that decoder may be
* able to decode to if suitable hardware is available.
*
* For encoders, a pixel format which the encoder may be able to
* accept. If set to AV_PIX_FMT_NONE, this applies to all pixel
* formats supported by the codec.
*/
enum
AVPixelFormat
pix_fmt
;
/**
...
...
libavcodec/hwconfig.h
View file @
858eba0c
...
...
@@ -81,4 +81,22 @@ typedef struct AVCodecHWConfigInternal {
#define HWACCEL_XVMC(codec) \
HW_CONFIG_HWACCEL(0, 0, 1, XVMC, NONE, ff_ ## codec ## _xvmc_hwaccel)
#define HW_CONFIG_ENCODER(device, frames, ad_hoc, format, device_type_) \
&(const AVCodecHWConfigInternal) { \
.public = { \
.pix_fmt = AV_PIX_FMT_ ## format, \
.methods = (device ? AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX : 0) | \
(frames ? AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX : 0) | \
(ad_hoc ? AV_CODEC_HW_CONFIG_METHOD_AD_HOC : 0), \
.device_type = AV_HWDEVICE_TYPE_ ## device_type_, \
}, \
.hwaccel = NULL, \
}
#define HW_CONFIG_ENCODER_DEVICE(format, device_type_) \
HW_CONFIG_ENCODER(1, 0, 0, format, device_type_)
#define HW_CONFIG_ENCODER_FRAMES(format, device_type_) \
HW_CONFIG_ENCODER(0, 1, 0, format, device_type_)
#endif
/* AVCODEC_HWCONFIG_H */
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