Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2017-01-10 11:14:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c9a71b7fb2f39240ce4cdc03860e3f4908fc05d8
c9a71b7f
1 parent
ba1c92a7
fix #635, hls support NonIDR(open gop). 2.0.226
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
45 行增加
和
4 行删除
README.md
trunk/src/app/srs_app_hls.cpp
trunk/src/core/srs_core.hpp
trunk/src/kernel/srs_kernel_codec.cpp
trunk/src/kernel/srs_kernel_codec.hpp
trunk/src/kernel/srs_kernel_ts.cpp
README.md
查看文件 @
c9a71b7
...
...
@@ -345,6 +345,7 @@ Remark:
## History
*
v2.0, 2017-01-10, fix
[
#635
][
bug #635
]
, hls support NonIDR(open gop). 2.0.226
*
v2.0, 2017-01-06, for
[
#730
][
bug #730
]
, reset ack follow flash player rules. 2.0.225
*
v2.0, 2016-12-15, for
[
#513
][
bug #513
]
, remove hls ram from srs2 to srs3+. 2.0.224
*
<strong>
v2.0, 2016-12-13,
[
2.0 beta3(2.0.223)
][
r2.0b3
]
released. 86685 lines.
</strong>
...
...
@@ -1268,6 +1269,7 @@ Winlin
[
bug #713
]:
https://github.com/ossrs/srs/issues/713
[
bug #513
]:
https://github.com/ossrs/srs/issues/513
[
bug #730
]:
https://github.com/ossrs/srs/issues/730
[
bug #635
]:
https://github.com/ossrs/srs/issues/635
[
bug #xxxxxxxxxx
]:
https://github.com/ossrs/srs/issues/xxxxxxxxxx
[
exo #828
]:
https://github.com/google/ExoPlayer/pull/828
...
...
trunk/src/app/srs_app_hls.cpp
查看文件 @
c9a71b7
...
...
@@ -1070,8 +1070,8 @@ int SrsHlsCache::write_video(SrsAvcAacCodec* codec, SrsHlsMuxer* muxer, int64_t
// a. wait keyframe and got keyframe.
// b. always reap when not wait keyframe.
if
(
!
muxer
->
wait_keyframe
()
||
sample
->
frame_type
==
SrsCodecVideoAVCFrameKeyFrame
)
{
// when wait keyframe, there must exists idr frame in sample.
if
(
!
sample
->
has_idr
&&
muxer
->
wait_keyframe
())
{
// when wait keyframe, there must exists idr frame in sample, or NonIDR(open gop) specified.
if
(
!
sample
->
has_non_idr
&&
!
sample
->
has_idr
&&
muxer
->
wait_keyframe
())
{
srs_warn
(
"hls: ts starts without IDR, first nalu=%d, idr=%d"
,
sample
->
first_nalu_type
,
sample
->
has_idr
);
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
c9a71b7
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 22
5
#define VERSION_REVISION 22
6
// generated by configure, only macros.
#include <srs_auto_headers.hpp>
...
...
trunk/src/kernel/srs_kernel_codec.cpp
查看文件 @
c9a71b7
...
...
@@ -339,7 +339,7 @@ void SrsCodecSample::clear()
cts
=
0
;
frame_type
=
SrsCodecVideoAVCFrameReserved
;
avc_packet_type
=
SrsCodecVideoAVCTypeReserved
;
has_idr
=
false
;
has_
aud
=
has_sei
=
has_non_idr
=
has_
idr
=
false
;
first_nalu_type
=
SrsAvcNaluTypeReserved
;
acodec
=
SrsCodecAudioReserved1
;
...
...
@@ -370,6 +370,12 @@ int SrsCodecSample::add_sample_unit(char* bytes, int size)
if
(
nal_unit_type
==
SrsAvcNaluTypeIDR
)
{
has_idr
=
true
;
}
else
if
(
nal_unit_type
==
SrsAvcNaluTypeNonIDR
)
{
has_non_idr
=
true
;
}
else
if
(
nal_unit_type
==
SrsAvcNaluTypeSEI
)
{
has_sei
=
true
;
}
else
if
(
nal_unit_type
==
SrsAvcNaluTypeAccessUnitDelimiter
)
{
has_aud
=
true
;
}
if
(
first_nalu_type
==
SrsAvcNaluTypeReserved
)
{
...
...
trunk/src/kernel/srs_kernel_codec.hpp
查看文件 @
c9a71b7
...
...
@@ -385,6 +385,13 @@ public:
SrsCodecVideoAVCType
avc_packet_type
;
// whether sample_units contains IDR frame.
bool
has_idr
;
// Whether exists NonIDR NALU.
bool
has_non_idr
;
// Whether exists SEI NALU.
bool
has_sei
;
// Whether exists AUD NALU.
bool
has_aud
;
// The first nalu type.
SrsAvcNaluType
first_nalu_type
;
public
:
// audio specified
...
...
trunk/src/kernel/srs_kernel_ts.cpp
查看文件 @
c9a71b7
...
...
@@ -3009,6 +3009,32 @@ int SrsTsCache::do_cache_avc(SrsAvcAacCodec* codec, SrsCodecSample* sample)
// H.264-AVC-ISO_IEC_14496-10-2012.pdf, page 105.
static
u_int8_t
aud_nalu_7
[]
=
{
0x09
,
0xf0
};
// For NonIDR(open gop), we directly appends all frames.
if
(
sample
->
has_non_idr
||
(
sample
->
has_aud
&&
sample
->
has_sei
))
{
for
(
int
i
=
0
;
i
<
sample
->
nb_sample_units
;
i
++
)
{
SrsCodecSampleUnit
*
sample_unit
=
&
sample
->
sample_units
[
i
];
int32_t
size
=
sample_unit
->
size
;
if
(
!
sample_unit
->
bytes
||
size
<=
0
)
{
ret
=
ERROR_HLS_AVC_SAMPLE_SIZE
;
srs_error
(
"invalid avc sample length=%d, ret=%d"
,
size
,
ret
);
return
ret
;
}
// insert nalu header before rbsp.
if
(
i
==
0
)
{
video
->
payload
->
append
((
const
char
*
)
fresh_nalu_header
,
4
);
}
else
{
video
->
payload
->
append
((
const
char
*
)
cont_nalu_header
,
3
);
}
// sample data
video
->
payload
->
append
(
sample_unit
->
bytes
,
sample_unit
->
size
);
}
return
ret
;
}
// always append a aud nalu for each frame.
video
->
payload
->
append
((
const
char
*
)
fresh_nalu_header
,
4
);
video
->
payload
->
append
((
const
char
*
)
aud_nalu_7
,
2
);
...
...
请
注册
或
登录
后发表评论