Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
455
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
ac3da07e
Commit
ac3da07e
authored
7 years ago
by
Thomas Guillem
Browse files
Options
Downloads
Patches
Plain Diff
codec: mediacodec: use hevc_helper_get_annexb_config
parent
ddb5cc2f
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
modules/codec/omxil/mediacodec.c
+40
-15
40 additions, 15 deletions
modules/codec/omxil/mediacodec.c
with
40 additions
and
15 deletions
modules/codec/omxil/mediacodec.c
+
40
−
15
View file @
ac3da07e
...
...
@@ -245,18 +245,10 @@ static int CSDDup(decoder_t *p_dec, const void *p_buf, size_t i_buf)
return
VLC_SUCCESS
;
}
/* Fill the p_sys->p_csd struct with H264 Parameter Sets */
static
int
H264SetCSD
(
decoder_t
*
p_dec
,
bool
*
p_size_changed
)
static
void
HXXXInitSize
(
decoder_t
*
p_dec
,
bool
*
p_size_changed
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
struct
hxxx_helper
*
hh
=
&
p_sys
->
video
.
hh
;
assert
(
hh
->
h264
.
i_sps_count
>
0
||
hh
->
h264
.
i_pps_count
>
0
);
block_t
*
p_spspps_blocks
=
h264_helper_get_annexb_config
(
hh
);
if
(
p_spspps_blocks
!=
NULL
)
CSDInit
(
p_dec
,
p_spspps_blocks
,
2
);
unsigned
i_w
,
i_h
,
i_vw
,
i_vh
;
hxxx_helper_get_current_picture_size
(
hh
,
&
i_w
,
&
i_h
,
&
i_vw
,
&
i_vh
);
...
...
@@ -268,20 +260,48 @@ static int H264SetCSD(decoder_t *p_dec, bool *p_size_changed)
p_dec
->
fmt_out
.
video
.
i_width
=
i_w
;
p_dec
->
fmt_out
.
video
.
i_visible_height
=
p_dec
->
fmt_out
.
video
.
i_height
=
i_h
;
}
/* Fill the p_sys->p_csd struct with H264 Parameter Sets */
static
int
H264SetCSD
(
decoder_t
*
p_dec
,
bool
*
p_size_changed
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
struct
hxxx_helper
*
hh
=
&
p_sys
->
video
.
hh
;
assert
(
hh
->
h264
.
i_sps_count
>
0
||
hh
->
h264
.
i_pps_count
>
0
);
block_t
*
p_spspps_blocks
=
h264_helper_get_annexb_config
(
hh
);
if
(
p_spspps_blocks
!=
NULL
)
CSDInit
(
p_dec
,
p_spspps_blocks
,
2
);
HXXXInitSize
(
p_dec
,
p_size_changed
);
return
VLC_SUCCESS
;
}
/* Fill the p_sys->p_csd struct with HEVC Parameter Sets */
static
int
HEVCSetCSD
(
decoder_t
*
p_dec
,
bool
*
p_size_changed
)
{
(
void
)
p_size_changed
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
struct
hxxx_helper
*
hh
=
&
p_sys
->
video
.
hh
;
assert
(
hh
->
hevc
.
i_annexb_config_nal
>
0
);
assert
(
hh
->
hevc
.
i_vps_count
>
0
||
hh
->
hevc
.
i_sps_count
>
0
||
hh
->
hevc
.
i_pps_count
>
0
);
return
CSDDup
(
p_dec
,
hh
->
hevc
.
p_annexb_config_nal
,
hh
->
hevc
.
i_annexb_config_nal
);
block_t
*
p_xps_blocks
=
hevc_helper_get_annexb_config
(
hh
);
if
(
p_xps_blocks
!=
NULL
)
{
block_t
*
p_monolith
=
block_ChainGather
(
p_xps_blocks
);
if
(
p_monolith
==
NULL
)
{
block_ChainRelease
(
p_xps_blocks
);
return
VLC_ENOMEM
;
}
CSDInit
(
p_dec
,
p_monolith
,
1
);
}
HXXXInitSize
(
p_dec
,
p_size_changed
);
return
VLC_SUCCESS
;
}
static
int
ParseVideoExtraH264
(
decoder_t
*
p_dec
,
uint8_t
*
p_extra
,
int
i_extra
)
...
...
@@ -319,7 +339,8 @@ static int ParseVideoExtraHEVC(decoder_t *p_dec, uint8_t *p_extra, int i_extra)
p_sys
->
pf_on_new_block
=
VideoHXXX_OnNewBlock
;
if
(
hh
->
hevc
.
i_annexb_config_nal
>
0
)
if
(
hh
->
hevc
.
i_vps_count
>
0
||
hh
->
hevc
.
i_sps_count
>
0
||
hh
->
hevc
.
i_pps_count
>
0
)
return
HEVCSetCSD
(
p_dec
,
NULL
);
return
VLC_SUCCESS
;
}
...
...
@@ -1524,7 +1545,11 @@ static int VideoHXXX_OnNewBlock(decoder_t *p_dec, block_t **pp_block)
i_ret
=
VLC_EGENERIC
;
break
;
case
VLC_CODEC_HEVC
:
i_ret
=
HEVCSetCSD
(
p_dec
,
&
b_size_changed
);
if
(
hh
->
hevc
.
i_vps_count
>
0
||
hh
->
hevc
.
i_sps_count
>
0
||
hh
->
hevc
.
i_pps_count
>
0
)
i_ret
=
HEVCSetCSD
(
p_dec
,
&
b_size_changed
);
else
i_ret
=
VLC_EGENERIC
;
break
;
}
if
(
i_ret
!=
VLC_SUCCESS
)
...
...
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