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
247bda44
Commit
247bda44
authored
May 12, 2019
by
Rick Kern
Committed by
Rick Kern
May 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/videotoolboxenc: add require_sw option to force software encoding.
Signed-off-by:
Rick Kern
<
kernrj@gmail.com
>
parent
bd6942b4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
videotoolboxenc.c
libavcodec/videotoolboxenc.c
+8
-1
No files found.
libavcodec/videotoolboxenc.c
View file @
247bda44
...
@@ -210,6 +210,7 @@ typedef struct VTEncContext {
...
@@ -210,6 +210,7 @@ typedef struct VTEncContext {
int64_t
frames_after
;
int64_t
frames_after
;
int64_t
allow_sw
;
int64_t
allow_sw
;
int64_t
require_sw
;
bool
flushing
;
bool
flushing
;
bool
has_b_frames
;
bool
has_b_frames
;
...
@@ -1314,7 +1315,11 @@ static int vtenc_configure_encoder(AVCodecContext *avctx)
...
@@ -1314,7 +1315,11 @@ static int vtenc_configure_encoder(AVCodecContext *avctx)
if
(
!
enc_info
)
return
AVERROR
(
ENOMEM
);
if
(
!
enc_info
)
return
AVERROR
(
ENOMEM
);
#if !TARGET_OS_IPHONE
#if !TARGET_OS_IPHONE
if
(
!
vtctx
->
allow_sw
)
{
if
(
vtctx
->
require_sw
)
{
CFDictionarySetValue
(
enc_info
,
compat_keys
.
kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder
,
kCFBooleanFalse
);
}
else
if
(
!
vtctx
->
allow_sw
)
{
CFDictionarySetValue
(
enc_info
,
CFDictionarySetValue
(
enc_info
,
compat_keys
.
kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder
,
compat_keys
.
kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder
,
kCFBooleanTrue
);
kCFBooleanTrue
);
...
@@ -2543,6 +2548,8 @@ static const enum AVPixelFormat pix_fmts[] = {
...
@@ -2543,6 +2548,8 @@ static const enum AVPixelFormat pix_fmts[] = {
#define COMMON_OPTIONS \
#define COMMON_OPTIONS \
{ "allow_sw", "Allow software encoding", OFFSET(allow_sw), AV_OPT_TYPE_BOOL, \
{ "allow_sw", "Allow software encoding", OFFSET(allow_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
{ .i64 = 0 }, 0, 1, VE }, \
{ "require_sw", "Require software encoding", OFFSET(require_sw), AV_OPT_TYPE_BOOL, \
{ .i64 = 0 }, 0, 1, VE }, \
{ "realtime", "Hint that encoding should happen in real-time if not faster (e.g. capturing from camera).", \
{ "realtime", "Hint that encoding should happen in real-time if not faster (e.g. capturing from camera).", \
OFFSET(realtime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
OFFSET(realtime), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, \
{ "frames_before", "Other frames will come before the frames in this session. This helps smooth concatenation issues.", \
{ "frames_before", "Other frames will come before the frames in this session. This helps smooth concatenation issues.", \
...
...
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