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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Luma Media Server
ffmpeg
Commits
222d7055
Commit
222d7055
authored
7 years ago
by
James Almer
Browse files
Options
Downloads
Patches
Plain Diff
avcodec/hevc_parser: use ff_hevc_decode_extradata() to parse extradata
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
42323c3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/hevc_parser.c
+9
-12
9 additions, 12 deletions
libavcodec/hevc_parser.c
with
9 additions
and
12 deletions
libavcodec/hevc_parser.c
+
9
−
12
View file @
222d7055
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include
"golomb.h"
#include
"golomb.h"
#include
"hevc.h"
#include
"hevc.h"
#include
"hevc_parse.h"
#include
"hevc_ps.h"
#include
"hevc_ps.h"
#include
"hevc_sei.h"
#include
"hevc_sei.h"
#include
"h2645_parse.h"
#include
"h2645_parse.h"
...
@@ -43,6 +44,8 @@ typedef struct HEVCParserContext {
...
@@ -43,6 +44,8 @@ typedef struct HEVCParserContext {
HEVCSEI
sei
;
HEVCSEI
sei
;
SliceHeader
sh
;
SliceHeader
sh
;
int
is_avc
;
int
nal_length_size
;
int
parsed_extradata
;
int
parsed_extradata
;
int
poc
;
int
poc
;
...
@@ -181,7 +184,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -181,7 +184,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
HEVCParserContext
*
ctx
=
s
->
priv_data
;
HEVCParserContext
*
ctx
=
s
->
priv_data
;
HEVCParamSets
*
ps
=
&
ctx
->
ps
;
HEVCParamSets
*
ps
=
&
ctx
->
ps
;
HEVCSEI
*
sei
=
&
ctx
->
sei
;
HEVCSEI
*
sei
=
&
ctx
->
sei
;
int
is_global
=
buf
==
avctx
->
extradata
;
int
ret
,
i
;
int
ret
,
i
;
/* set some sane default values */
/* set some sane default values */
...
@@ -191,8 +193,8 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -191,8 +193,8 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
ff_hevc_reset_sei
(
sei
);
ff_hevc_reset_sei
(
sei
);
ret
=
ff_h2645_packet_split
(
&
ctx
->
pkt
,
buf
,
buf_size
,
avctx
,
0
,
0
,
ret
=
ff_h2645_packet_split
(
&
ctx
->
pkt
,
buf
,
buf_size
,
avctx
,
ctx
->
is_avc
,
AV_CODEC_ID_HEVC
,
1
);
ctx
->
nal_length_size
,
AV_CODEC_ID_HEVC
,
1
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
@@ -230,12 +232,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -230,12 +232,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
case
HEVC_NAL_RADL_R
:
case
HEVC_NAL_RADL_R
:
case
HEVC_NAL_RASL_N
:
case
HEVC_NAL_RASL_N
:
case
HEVC_NAL_RASL_R
:
case
HEVC_NAL_RASL_R
:
if
(
is_global
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid NAL unit: %d
\n
"
,
nal
->
type
);
return
AVERROR_INVALIDDATA
;
}
ret
=
hevc_parse_slice_header
(
s
,
nal
,
avctx
);
ret
=
hevc_parse_slice_header
(
s
,
nal
,
avctx
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -243,8 +239,7 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -243,8 +239,7 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
}
}
}
}
/* didn't find a picture! */
/* didn't find a picture! */
if
(
!
is_global
)
av_log
(
avctx
,
AV_LOG_ERROR
,
"missing picture in access unit
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"missing picture in access unit
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -301,7 +296,9 @@ static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
...
@@ -301,7 +296,9 @@ static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
ParseContext
*
pc
=
&
ctx
->
pc
;
ParseContext
*
pc
=
&
ctx
->
pc
;
if
(
avctx
->
extradata
&&
!
ctx
->
parsed_extradata
)
{
if
(
avctx
->
extradata
&&
!
ctx
->
parsed_extradata
)
{
parse_nal_units
(
s
,
avctx
->
extradata
,
avctx
->
extradata_size
,
avctx
);
ff_hevc_decode_extradata
(
avctx
->
extradata
,
avctx
->
extradata_size
,
&
ctx
->
ps
,
&
ctx
->
sei
,
&
ctx
->
is_avc
,
&
ctx
->
nal_length_size
,
avctx
->
err_recognition
,
1
,
avctx
);
ctx
->
parsed_extradata
=
1
;
ctx
->
parsed_extradata
=
1
;
}
}
...
...
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