Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
3bdc428b
Commit
3bdc428b
authored
Feb 09, 2014
by
Felix Abecassis
Committed by
Jean-Baptiste Kempf
Feb 09, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
omxil: move code to parse profile and level of H264 format to omx_utils.h
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
91a4846e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
31 deletions
+39
-31
modules/codec/omxil/omxil.c
modules/codec/omxil/omxil.c
+4
-31
modules/codec/omxil/omxil_utils.h
modules/codec/omxil/omxil_utils.h
+5
-0
modules/codec/omxil/utils.c
modules/codec/omxil/utils.c
+30
-0
No files found.
modules/codec/omxil/omxil.c
View file @
3bdc428b
...
...
@@ -108,39 +108,12 @@ static OMX_ERRORTYPE ImplementationSpecificWorkarounds(decoder_t *p_dec,
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
OMX_PARAM_PORTDEFINITIONTYPE
*
def
=
&
p_port
->
definition
;
in
t
i_profile
=
0xFFFF
,
i_level
=
0xFFFF
;
size_
t
i_profile
=
0xFFFF
,
i_level
=
0xFFFF
;
/* Try to find out the profile of the video */
while
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
def
->
eDir
==
OMX_DirInput
&&
p_fmt
->
i_codec
==
VLC_CODEC_H264
)
{
uint8_t
*
p
=
(
uint8_t
*
)
p_dec
->
fmt_in
.
p_extra
;
if
(
!
p
||
!
p_dec
->
fmt_in
.
p_extra
)
break
;
/* Check the profile / level */
if
(
p_dec
->
fmt_in
.
i_original_fourcc
==
VLC_FOURCC
(
'a'
,
'v'
,
'c'
,
'1'
)
&&
p
[
0
]
==
1
)
{
if
(
p_dec
->
fmt_in
.
i_extra
<
12
)
break
;
p_sys
->
i_nal_size_length
=
1
+
(
p
[
4
]
&
0x03
);
if
(
!
(
p
[
5
]
&
0x1f
)
)
break
;
p
+=
8
;
}
else
{
if
(
p_dec
->
fmt_in
.
i_extra
<
8
)
break
;
if
(
!
p
[
0
]
&&
!
p
[
1
]
&&
!
p
[
2
]
&&
p
[
3
]
==
1
)
p
+=
4
;
else
if
(
!
p
[
0
]
&&
!
p
[
1
]
&&
p
[
2
]
==
1
)
p
+=
3
;
else
break
;
}
if
(
((
*
p
++
)
&
0x1f
)
!=
7
)
break
;
/* Get profile/level out of first SPS */
i_profile
=
p
[
0
];
i_level
=
p
[
2
];
break
;
}
if
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
def
->
eDir
==
OMX_DirInput
&&
p_fmt
->
i_codec
==
VLC_CODEC_H264
)
h264_get_profile_level
(
&
p_dec
->
fmt_in
,
&
i_profile
,
&
i_level
,
&
p_sys
->
i_nal_size_length
);
if
(
!
strcmp
(
p_sys
->
psz_component
,
"OMX.TI.Video.Decoder"
))
{
...
...
modules/codec/omxil/omxil_utils.h
View file @
3bdc428b
...
...
@@ -256,3 +256,8 @@ unsigned int GetAudioParamSize(OMX_INDEXTYPE index);
#define QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka 0x7FA30C03
#define OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar32m 0x7FA30C04
#define OMX_IndexVendorSetYUV420pMode 0x7f000003
/*****************************************************************************
* H264 specific code
*****************************************************************************/
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
size_t
*
p_level
,
size_t
*
p_nal_size
);
modules/codec/omxil/utils.c
View file @
3bdc428b
...
...
@@ -1043,3 +1043,33 @@ void PrintOmx(decoder_t *p_dec, OMX_HANDLETYPE omx_handle, OMX_U32 i_port)
}
}
}
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
size_t
*
p_level
,
size_t
*
p_nal_size
)
{
uint8_t
*
p
=
(
uint8_t
*
)
p_fmt
->
p_extra
;
if
(
!
p
||
!
p_fmt
->
p_extra
)
return
false
;
/* Check the profile / level */
if
(
p_fmt
->
i_original_fourcc
==
VLC_FOURCC
(
'a'
,
'v'
,
'c'
,
'1'
)
&&
p
[
0
]
==
1
)
{
if
(
p_fmt
->
i_extra
<
12
)
return
false
;
if
(
p_nal_size
)
*
p_nal_size
=
1
+
(
p
[
4
]
&
0x03
);
if
(
!
(
p
[
5
]
&
0x1f
)
)
return
false
;
p
+=
8
;
}
else
{
if
(
p_fmt
->
i_extra
<
8
)
return
false
;
if
(
!
p
[
0
]
&&
!
p
[
1
]
&&
!
p
[
2
]
&&
p
[
3
]
==
1
)
p
+=
4
;
else
if
(
!
p
[
0
]
&&
!
p
[
1
]
&&
p
[
2
]
==
1
)
p
+=
3
;
else
return
false
;
}
if
(
((
*
p
++
)
&
0x1f
)
!=
7
)
return
false
;
/* Get profile/level out of first SPS */
if
(
p_profile
)
*
p_profile
=
p
[
0
];
if
(
p_level
)
*
p_level
=
p
[
2
];
return
true
;
}
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