Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
d825b1a5
Commit
d825b1a5
authored
8 years ago
by
Martin Storsjö
Browse files
Options
Downloads
Patches
Plain Diff
libopenh264: Support building with the 1.6 release
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
4f7723cb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavcodec/libopenh264dec.c
+2
-0
2 additions, 0 deletions
libavcodec/libopenh264dec.c
libavcodec/libopenh264enc.c
+24
-2
24 additions, 2 deletions
libavcodec/libopenh264enc.c
with
26 additions
and
2 deletions
libavcodec/libopenh264dec.c
+
2
−
0
View file @
d825b1a5
...
...
@@ -90,7 +90,9 @@ static av_cold int svc_decode_init(AVCodecContext *avctx)
(
*
s
->
decoder
)
->
SetOption
(
s
->
decoder
,
DECODER_OPTION_TRACE_CALLBACK
,
(
void
*
)
&
callback_function
);
(
*
s
->
decoder
)
->
SetOption
(
s
->
decoder
,
DECODER_OPTION_TRACE_CALLBACK_CONTEXT
,
(
void
*
)
&
avctx
);
#if !OPENH264_VER_AT_LEAST(1, 6)
param
.
eOutputColorFormat
=
videoFormatI420
;
#endif
param
.
eEcActiveIdc
=
ERROR_CON_DISABLE
;
param
.
sVideoProperty
.
eVideoBsType
=
VIDEO_BITSTREAM_DEFAULT
;
...
...
This diff is collapsed.
Click to expand it.
libavcodec/libopenh264enc.c
+
24
−
2
View file @
d825b1a5
...
...
@@ -33,6 +33,10 @@
#include
"internal.h"
#include
"libopenh264.h"
#if !OPENH264_VER_AT_LEAST(1, 6)
#define SM_SIZELIMITED_SLICE SM_DYN_SLICE
#endif
typedef
struct
SVCContext
{
const
AVClass
*
av_class
;
ISVCEncoder
*
encoder
;
...
...
@@ -48,11 +52,20 @@ typedef struct SVCContext {
#define OFFSET(x) offsetof(SVCContext, x)
#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
#if OPENH264_VER_AT_LEAST(1, 6)
{
"slice_mode"
,
"Slice mode"
,
OFFSET
(
slice_mode
),
AV_OPT_TYPE_INT
,
{
.
i64
=
SM_FIXEDSLCNUM_SLICE
},
SM_SINGLE_SLICE
,
SM_RESERVED
,
VE
,
"slice_mode"
},
#else
{
"slice_mode"
,
"Slice mode"
,
OFFSET
(
slice_mode
),
AV_OPT_TYPE_INT
,
{
.
i64
=
SM_AUTO_SLICE
},
SM_SINGLE_SLICE
,
SM_RESERVED
,
VE
,
"slice_mode"
},
#endif
{
"fixed"
,
"A fixed number of slices"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_FIXEDSLCNUM_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
#if OPENH264_VER_AT_LEAST(1, 6)
{
"dyn"
,
"Size limited (compatibility name)"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_SIZELIMITED_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
{
"sizelimited"
,
"Size limited"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_SIZELIMITED_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
#else
{
"rowmb"
,
"One slice per row of macroblocks"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_ROWMB_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
{
"auto"
,
"Automatic number of slices according to number of threads"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_AUTO_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
{
"dyn"
,
"Dynamic slicing"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SM_DYN_SLICE
},
0
,
0
,
VE
,
"slice_mode"
},
#endif
{
"loopfilter"
,
"Enable loop filter"
,
OFFSET
(
loopfilter
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
0
,
1
,
VE
},
{
"profile"
,
"Set profile restrictions"
,
OFFSET
(
profile
),
AV_OPT_TYPE_STRING
,
{
.
str
=
NULL
},
0
,
0
,
VE
},
{
"max_nal_size"
,
"Set maximum NAL size in bytes"
,
OFFSET
(
max_nal_size
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
INT_MAX
,
VE
},
...
...
@@ -161,15 +174,24 @@ FF_ENABLE_DEPRECATION_WARNINGS
s
->
slice_mode
=
SM_FIXEDSLCNUM_SLICE
;
if
(
s
->
max_nal_size
)
s
->
slice_mode
=
SM_
DYN
_SLICE
;
s
->
slice_mode
=
SM_
SIZELIMITED
_SLICE
;
#if OPENH264_VER_AT_LEAST(1, 6)
param
.
sSpatialLayers
[
0
].
sSliceArgument
.
uiSliceMode
=
s
->
slice_mode
;
param
.
sSpatialLayers
[
0
].
sSliceArgument
.
uiSliceNum
=
avctx
->
slices
;
#else
param
.
sSpatialLayers
[
0
].
sSliceCfg
.
uiSliceMode
=
s
->
slice_mode
;
param
.
sSpatialLayers
[
0
].
sSliceCfg
.
sSliceArgument
.
uiSliceNum
=
avctx
->
slices
;
#endif
if
(
s
->
slice_mode
==
SM_
DYN
_SLICE
)
{
if
(
s
->
slice_mode
==
SM_
SIZELIMITED
_SLICE
)
{
if
(
s
->
max_nal_size
){
param
.
uiMaxNalSize
=
s
->
max_nal_size
;
#if OPENH264_VER_AT_LEAST(1, 6)
param
.
sSpatialLayers
[
0
].
sSliceArgument
.
uiSliceSizeConstraint
=
s
->
max_nal_size
;
#else
param
.
sSpatialLayers
[
0
].
sSliceCfg
.
sSliceArgument
.
uiSliceSizeConstraint
=
s
->
max_nal_size
;
#endif
}
else
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid -max_nal_size, "
"specify a valid max_nal_size to use -slice_mode dyn
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment