Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
15714d17
Commit
15714d17
authored
Jun 15, 2014
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move h264_get_profile_level from OMX to the h264_nal helper file
parent
c11981de
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
32 deletions
+33
-32
modules/codec/h264_nal.h
modules/codec/h264_nal.h
+33
-1
modules/codec/omxil/omxil_utils.h
modules/codec/omxil/omxil_utils.h
+0
-2
modules/codec/omxil/utils.c
modules/codec/omxil/utils.c
+0
-29
No files found.
modules/codec/h264_nal.h
View file @
15714d17
...
...
@@ -142,3 +142,35 @@ static void convert_h264_to_annexb( uint8_t *p_buf, uint32_t i_len,
}
}
}
/* Get level and Profile */
static
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
;
}
modules/codec/omxil/omxil_utils.h
View file @
15714d17
...
...
@@ -260,8 +260,6 @@ unsigned int GetAudioParamSize(OMX_INDEXTYPE index);
/*****************************************************************************
* 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
);
size_t
convert_omx_to_profile_idc
(
OMX_VIDEO_AVCPROFILETYPE
profile_type
);
size_t
convert_omx_to_level_idc
(
OMX_VIDEO_AVCLEVELTYPE
level_type
);
modules/codec/omxil/utils.c
View file @
15714d17
...
...
@@ -1044,35 +1044,6 @@ 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
;
}
static
const
struct
{
OMX_VIDEO_AVCPROFILETYPE
omx_profile
;
...
...
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