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
eec22355
Commit
eec22355
authored
Dec 03, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: packetizer: change nal length size to uint8
parent
7d1d0736
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
21 additions
and
20 deletions
+21
-20
modules/codec/crystalhd.c
modules/codec/crystalhd.c
+1
-1
modules/codec/mft.c
modules/codec/mft.c
+1
-1
modules/codec/omxil/mediacodec.c
modules/codec/omxil/mediacodec.c
+1
-1
modules/codec/omxil/omxil.h
modules/codec/omxil/omxil.h
+1
-1
modules/codec/videotoolbox.m
modules/codec/videotoolbox.m
+1
-1
modules/packetizer/h264_nal.c
modules/packetizer/h264_nal.c
+10
-9
modules/packetizer/h264_nal.h
modules/packetizer/h264_nal.h
+4
-4
modules/packetizer/hevc_nal.c
modules/packetizer/hevc_nal.c
+1
-1
modules/packetizer/hevc_nal.h
modules/packetizer/hevc_nal.h
+1
-1
No files found.
modules/codec/crystalhd.c
View file @
eec22355
...
@@ -110,7 +110,7 @@ struct decoder_sys_t
...
@@ -110,7 +110,7 @@ struct decoder_sys_t
uint8_t
*
p_sps_pps_buf
;
/* SPS/PPS buffer */
uint8_t
*
p_sps_pps_buf
;
/* SPS/PPS buffer */
uint32_t
i_sps_pps_size
;
/* SPS/PPS size */
uint32_t
i_sps_pps_size
;
/* SPS/PPS size */
uint
32
_t
i_nal_size
;
/* NAL header size */
uint
8
_t
i_nal_size
;
/* NAL header size */
/* Callback */
/* Callback */
picture_t
*
p_pic
;
picture_t
*
p_pic
;
...
...
modules/codec/mft.c
View file @
eec22355
...
@@ -100,7 +100,7 @@ struct decoder_sys_t
...
@@ -100,7 +100,7 @@ struct decoder_sys_t
IMFMediaType
*
output_type
;
IMFMediaType
*
output_type
;
/* H264 only. */
/* H264 only. */
uint
32
_t
nal_length_size
;
uint
8
_t
nal_length_size
;
};
};
static
const
int
pi_channels_maps
[
9
]
=
static
const
int
pi_channels_maps
[
9
]
=
...
...
modules/codec/omxil/mediacodec.c
View file @
eec22355
...
@@ -109,7 +109,7 @@ struct decoder_sys_t
...
@@ -109,7 +109,7 @@ struct decoder_sys_t
{
{
AWindowHandler
*
p_awh
;
AWindowHandler
*
p_awh
;
int
i_pixel_format
,
i_stride
,
i_slice_height
,
i_width
,
i_height
;
int
i_pixel_format
,
i_stride
,
i_slice_height
,
i_width
,
i_height
;
uint
32
_t
i_nal_length_size
;
uint
8
_t
i_nal_length_size
;
size_t
i_h264_profile
;
size_t
i_h264_profile
;
ArchitectureSpecificCopyData
ascd
;
ArchitectureSpecificCopyData
ascd
;
/* stores the inflight picture for each output buffer or NULL */
/* stores the inflight picture for each output buffer or NULL */
...
...
modules/codec/omxil/omxil.h
View file @
eec22355
...
@@ -135,7 +135,7 @@ struct decoder_sys_t
...
@@ -135,7 +135,7 @@ struct decoder_sys_t
date_t
end_date
;
date_t
end_date
;
size
_t
i_nal_size_length
;
/* Length of the NAL size field for H264 */
uint8
_t
i_nal_size_length
;
/* Length of the NAL size field for H264 */
int
b_use_pts
;
int
b_use_pts
;
};
};
modules/codec/videotoolbox.m
View file @
eec22355
...
@@ -108,7 +108,7 @@ struct decoder_sys_t
...
@@ -108,7 +108,7 @@ struct decoder_sys_t
CMVideoCodecType
codec
;
CMVideoCodecType
codec
;
size_t
codec_profile
;
size_t
codec_profile
;
size_t
codec_level
;
size_t
codec_level
;
uint
32_t
i_nal_length_size
;
uint
8_t
i_nal_length_size
;
bool
b_started
;
bool
b_started
;
bool
b_is_avcc
;
bool
b_is_avcc
;
...
...
modules/packetizer/h264_nal.c
View file @
eec22355
...
@@ -54,7 +54,7 @@ static inline bool strip_AnnexB_startcode( const uint8_t **pp_data, size_t *pi_d
...
@@ -54,7 +54,7 @@ static inline bool strip_AnnexB_startcode( const uint8_t **pp_data, size_t *pi_d
int
convert_sps_pps
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
int
convert_sps_pps
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint
32_t
*
p
_nal_length_size
)
uint
8_t
*
pi
_nal_length_size
)
{
{
int
i_profile
;
int
i_profile
;
uint32_t
i_data_size
=
i_buf_size
,
i_nal_size
,
i_sps_pps_size
=
0
;
uint32_t
i_data_size
=
i_buf_size
,
i_nal_size
,
i_sps_pps_size
=
0
;
...
@@ -69,8 +69,8 @@ int convert_sps_pps( decoder_t *p_dec, const uint8_t *p_buf,
...
@@ -69,8 +69,8 @@ int convert_sps_pps( decoder_t *p_dec, const uint8_t *p_buf,
/* Read infos in first 6 bytes */
/* Read infos in first 6 bytes */
i_profile
=
(
p_buf
[
1
]
<<
16
)
|
(
p_buf
[
2
]
<<
8
)
|
p_buf
[
3
];
i_profile
=
(
p_buf
[
1
]
<<
16
)
|
(
p_buf
[
2
]
<<
8
)
|
p_buf
[
3
];
if
(
p_nal_length_size
)
if
(
p
i
_nal_length_size
)
*
p_nal_length_size
=
(
p_buf
[
4
]
&
0x03
)
+
1
;
*
p
i
_nal_length_size
=
(
p_buf
[
4
]
&
0x03
)
+
1
;
p_buf
+=
5
;
p_buf
+=
5
;
i_data_size
-=
5
;
i_data_size
-=
5
;
...
@@ -129,9 +129,10 @@ int convert_sps_pps( decoder_t *p_dec, const uint8_t *p_buf,
...
@@ -129,9 +129,10 @@ int convert_sps_pps( decoder_t *p_dec, const uint8_t *p_buf,
}
}
void
convert_h264_to_annexb
(
uint8_t
*
p_buf
,
uint32_t
i_len
,
void
convert_h264_to_annexb
(
uint8_t
*
p_buf
,
uint32_t
i_len
,
size
_t
i_nal_length_size
)
uint8
_t
i_nal_length_size
)
{
{
uint32_t
nal_len
=
0
,
nal_pos
=
0
;
uint32_t
nal_len
=
0
;
uint8_t
nal_pos
=
0
;
if
(
i_nal_length_size
!=
4
)
if
(
i_nal_length_size
!=
4
)
return
;
return
;
...
@@ -234,7 +235,7 @@ static block_t *h264_increase_startcode_size( block_t *p_block,
...
@@ -234,7 +235,7 @@ static block_t *h264_increase_startcode_size( block_t *p_block,
}
}
static
int
h264_replace_startcode
(
uint8_t
*
p_buf
,
static
int
h264_replace_startcode
(
uint8_t
*
p_buf
,
size
_t
i_nal_length_size
,
uint8
_t
i_nal_length_size
,
size_t
i_startcode_ofs
,
size_t
i_startcode_ofs
,
size_t
i_nal_size
)
size_t
i_nal_size
)
{
{
...
@@ -255,7 +256,7 @@ static int h264_replace_startcode( uint8_t *p_buf,
...
@@ -255,7 +256,7 @@ static int h264_replace_startcode( uint8_t *p_buf,
return
0
;
return
0
;
}
}
block_t
*
convert_annexb_to_h264
(
block_t
*
p_block
,
size
_t
i_nal_length_size
)
block_t
*
convert_annexb_to_h264
(
block_t
*
p_block
,
uint8
_t
i_nal_length_size
)
{
{
size_t
i_startcode_ofs
=
0
;
size_t
i_startcode_ofs
=
0
;
size_t
i_startcode_size
=
0
;
size_t
i_startcode_size
=
0
;
...
@@ -748,7 +749,7 @@ block_t *h264_create_avcdec_config_record( uint8_t i_nal_length_size,
...
@@ -748,7 +749,7 @@ block_t *h264_create_avcdec_config_record( uint8_t i_nal_length_size,
}
}
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
size_t
*
p_level
,
size_t
*
p
_nal_length_size
)
size_t
*
p_level
,
uint8_t
*
pi
_nal_length_size
)
{
{
uint8_t
*
p
=
(
uint8_t
*
)
p_fmt
->
p_extra
;
uint8_t
*
p
=
(
uint8_t
*
)
p_fmt
->
p_extra
;
if
(
!
p
||
!
p_fmt
->
p_extra
)
return
false
;
if
(
!
p
||
!
p_fmt
->
p_extra
)
return
false
;
...
@@ -757,7 +758,7 @@ bool h264_get_profile_level(const es_format_t *p_fmt, size_t *p_profile,
...
@@ -757,7 +758,7 @@ bool h264_get_profile_level(const es_format_t *p_fmt, size_t *p_profile,
if
(
p_fmt
->
i_original_fourcc
==
VLC_FOURCC
(
'a'
,
'v'
,
'c'
,
'1'
)
&&
p
[
0
]
==
1
)
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_fmt
->
i_extra
<
12
)
return
false
;
if
(
p
_nal_length_size
)
*
p
_nal_length_size
=
1
+
(
p
[
4
]
&
0x03
);
if
(
p
i_nal_length_size
)
*
pi
_nal_length_size
=
1
+
(
p
[
4
]
&
0x03
);
if
(
!
(
p
[
5
]
&
0x1f
))
return
false
;
if
(
!
(
p
[
5
]
&
0x1f
))
return
false
;
p
+=
8
;
p
+=
8
;
}
}
...
...
modules/packetizer/h264_nal.h
View file @
eec22355
...
@@ -122,17 +122,17 @@ static inline void CreateRbspFromNAL( uint8_t **pp_ret, int *pi_ret,
...
@@ -122,17 +122,17 @@ static inline void CreateRbspFromNAL( uint8_t **pp_ret, int *pi_ret,
int
convert_sps_pps
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
int
convert_sps_pps
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint
32
_t
*
p_nal_length_size
);
uint
8
_t
*
p_nal_length_size
);
/* Convert avcC format to Annex B in-place */
/* Convert avcC format to Annex B in-place */
void
convert_h264_to_annexb
(
uint8_t
*
p_buf
,
uint32_t
i_len
,
void
convert_h264_to_annexb
(
uint8_t
*
p_buf
,
uint32_t
i_len
,
size
_t
i_nal_length_size
);
uint8
_t
i_nal_length_size
);
/* Convert Annex B to avcC format in-place
/* Convert Annex B to avcC format in-place
* Returns the same p_block or a new p_block if there is not enough room to put
* Returns the same p_block or a new p_block if there is not enough room to put
* the NAL size. In case of error, NULL is returned and p_block is released.
* the NAL size. In case of error, NULL is returned and p_block is released.
* */
* */
block_t
*
convert_annexb_to_h264
(
block_t
*
p_block
,
size
_t
i_nal_length_size
);
block_t
*
convert_annexb_to_h264
(
block_t
*
p_block
,
uint8
_t
i_nal_length_size
);
/* Get the SPS/PPS pointers from an Annex B buffer
/* Get the SPS/PPS pointers from an Annex B buffer
* Returns 0 if a SPS and/or a PPS is found */
* Returns 0 if a SPS and/or a PPS is found */
...
@@ -160,6 +160,6 @@ block_t *h264_create_avcdec_config_record( uint8_t i_nal_length_size,
...
@@ -160,6 +160,6 @@ block_t *h264_create_avcdec_config_record( uint8_t i_nal_length_size,
/* Get level and Profile */
/* Get level and Profile */
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
bool
h264_get_profile_level
(
const
es_format_t
*
p_fmt
,
size_t
*
p_profile
,
size_t
*
p_level
,
size
_t
*
p_nal_length_size
);
size_t
*
p_level
,
uint8
_t
*
p_nal_length_size
);
#endif
/* H264_NAL_H */
#endif
/* H264_NAL_H */
modules/packetizer/hevc_nal.c
View file @
eec22355
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
int
convert_hevc_nal_units
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
int
convert_hevc_nal_units
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint
32
_t
*
p_nal_size
)
uint
8
_t
*
p_nal_size
)
{
{
int
i
,
num_arrays
;
int
i
,
num_arrays
;
const
uint8_t
*
p_end
=
p_buf
+
i_buf_size
;
const
uint8_t
*
p_end
=
p_buf
+
i_buf_size
;
...
...
modules/packetizer/hevc_nal.h
View file @
eec22355
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
int
convert_hevc_nal_units
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
int
convert_hevc_nal_units
(
decoder_t
*
p_dec
,
const
uint8_t
*
p_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_buf_size
,
uint8_t
*
p_out_buf
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint32_t
i_out_buf_size
,
uint32_t
*
p_sps_pps_size
,
uint
32
_t
*
p_nal_size
);
uint
8
_t
*
p_nal_size
);
#endif
/* HEVC_NAL_H */
#endif
/* HEVC_NAL_H */
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