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
2015-05-29 21:43:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5caafadd451b15088fc47d8fd7cc3668b1f399ca
5caafadd
1 parent
3ad030fe
fix #409: support pure video hls. 2.0.172.
显示空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
35 行增加
和
9 行删除
README.md
trunk/conf/full.conf
trunk/src/app/srs_app_hls.cpp
trunk/src/core/srs_core.hpp
trunk/src/kernel/srs_kernel_codec.hpp
trunk/src/kernel/srs_kernel_error.hpp
trunk/src/kernel/srs_kernel_ts.cpp
README.md
查看文件 @
5caafad
...
...
@@ -342,6 +342,7 @@ Remark:
## History
### SRS 2.0 history
*
v2.0, 2015-05-29, fix
[
#409
](
https://github.com/simple-rtmp-server/srs/issues/409
)
support pure video hls. 2.0.172.
*
v2.0, 2015-05-28, support
[
srs-dolphin
][
srs-dolphin
]
, the multiple-process SRS.
*
v2.0, 2015-05-24, fix
[
#404
](
https://github.com/simple-rtmp-server/srs/issues/404
)
register handler then start http thread. 2.0.167.
*
v2.0, 2015-05-23, refine the thread, protocol, kbps code. 2.0.166
...
...
trunk/conf/full.conf
查看文件 @
5caafad
...
...
@@ -608,7 +608,7 @@ vhost with-hls.srs.com {
# when codec changed, write the PAT/PMT table, but maybe ok util next ts.
# so user can set the default codec for mp3.
# the available audio codec:
# aac, mp3
# aac, mp3
, an
# default: aac
hls_acodec
aac
;
# the default video codec of hls.
...
...
trunk/src/app/srs_app_hls.cpp
查看文件 @
5caafad
...
...
@@ -420,6 +420,9 @@ int SrsHlsMuxer::segment_open(int64_t segment_start_dts)
}
else
if
(
default_acodec_str
==
"aac"
)
{
default_acodec
=
SrsCodecAudioAAC
;
srs_info
(
"hls: use default aac acodec"
);
}
else
if
(
default_acodec_str
==
"an"
)
{
default_acodec
=
SrsCodecAudioDisabled
;
srs_info
(
"hls: use default an acodec for pure video"
);
}
else
{
srs_warn
(
"hls: use aac for other codec=%s"
,
default_acodec_str
.
c_str
());
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
5caafad
...
...
@@ -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 17
1
#define VERSION_REVISION 17
2
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
trunk/src/kernel/srs_kernel_codec.hpp
查看文件 @
5caafad
...
...
@@ -136,6 +136,9 @@ enum SrsCodecAudio
// set to the max value to reserved, for array map.
SrsCodecAudioReserved1
=
16
,
// for user to disable audio, for example, use pure video hls.
SrsCodecAudioDisabled
=
17
,
SrsCodecAudioLinearPCMPlatformEndian
=
0
,
SrsCodecAudioADPCM
=
1
,
SrsCodecAudioMP3
=
2
,
...
...
trunk/src/kernel/srs_kernel_error.hpp
查看文件 @
5caafad
...
...
@@ -215,13 +215,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define ERROR_HTTP_DVR_CREATE_REQUEST 3053
#define ERROR_HTTP_DVR_NO_TAEGET 3054
#define ERROR_ADTS_ID_NOT_AAC 3055
// HDS error code
#define ERROR_HDS_OPEN_F4M_FAILED 3056
#define ERROR_HDS_WRITE_F4M_FAILED 3057
#define ERROR_HDS_OPEN_BOOTSTRAP_FAILED 3058
#define ERROR_HDS_WRITE_BOOTSTRAP_FAILED 3059
#define ERROR_HDS_OPEN_FRAGMENT_FAILED 3060
#define ERROR_HDS_WRITE_FRAGMENT_FAILED 3061
#define ERROR_HLS_NO_STREAM 3062
///////////////////////////////////////////////////////
// HTTP/StreamCaster protocol error.
...
...
trunk/src/kernel/srs_kernel_ts.cpp
查看文件 @
5caafad
...
...
@@ -302,10 +302,12 @@ int SrsTsContext::encode(SrsFileWriter* writer, SrsTsMessage* msg, SrsCodecVideo
vs
=
SrsTsStreamVideoH264
;
video_pid
=
TS_VIDEO_AVC_PID
;
break
;
case
SrsCodecVideoDisabled
:
vs
=
SrsTsStreamReserved
;
break
;
case
SrsCodecVideoReserved
:
case
SrsCodecVideoReserved1
:
case
SrsCodecVideoReserved2
:
case
SrsCodecVideoDisabled
:
case
SrsCodecVideoSorensonH263
:
case
SrsCodecVideoScreenVideo
:
case
SrsCodecVideoOn2VP6
:
...
...
@@ -323,6 +325,9 @@ int SrsTsContext::encode(SrsFileWriter* writer, SrsTsMessage* msg, SrsCodecVideo
as
=
SrsTsStreamAudioMp3
;
audio_pid
=
TS_AUDIO_MP3_PID
;
break
;
case
SrsCodecAudioDisabled
:
as
=
SrsTsStreamReserved
;
break
;
case
SrsCodecAudioReserved1
:
case
SrsCodecAudioLinearPCMPlatformEndian
:
case
SrsCodecAudioADPCM
:
...
...
@@ -340,6 +345,12 @@ int SrsTsContext::encode(SrsFileWriter* writer, SrsTsMessage* msg, SrsCodecVideo
break
;
}
if
(
as
==
SrsTsStreamReserved
&&
vs
==
SrsTsStreamReserved
)
{
ret
=
ERROR_HLS_NO_STREAM
;
srs_error
(
"hls: no video or audio stream, vcodec=%d, acodec=%d. ret=%d"
,
vc
,
ac
,
ret
);
return
ret
;
}
// when any codec changed, write PAT/PMT table.
if
(
vcodec
!=
vc
||
acodec
!=
ac
)
{
vcodec
=
vc
;
...
...
@@ -361,6 +372,12 @@ int SrsTsContext::encode_pat_pmt(SrsFileWriter* writer, int16_t vpid, SrsTsStrea
{
int
ret
=
ERROR_SUCCESS
;
if
(
vs
!=
SrsTsStreamVideoH264
&&
as
!=
SrsTsStreamAudioAAC
&&
as
!=
SrsTsStreamAudioMp3
)
{
ret
=
ERROR_HLS_NO_STREAM
;
srs_error
(
"hls: no pmt pcr pid, vs=%d, as=%d. ret=%d"
,
vs
,
as
,
ret
);
return
ret
;
}
int16_t
pmt_number
=
TS_PMT_NUMBER
;
int16_t
pmt_pid
=
TS_PMT_PID
;
if
(
true
)
{
...
...
@@ -754,15 +771,17 @@ SrsTsPacket* SrsTsPacket::create_pmt(SrsTsContext* context, int16_t pmt_number,
pmt
->
last_section_number
=
0
;
pmt
->
program_info_length
=
0
;
// use audio to carray pcr by default.
// for hls, there must be atleast one audio channel.
pmt
->
PCR_PID
=
apid
;
pmt
->
infos
.
push_back
(
new
SrsTsPayloadPMTESInfo
(
as
,
apid
));
// if h.264 specified, use video to carry pcr.
if
(
vs
==
SrsTsStreamVideoH264
)
{
pmt
->
PCR_PID
=
vpid
;
pmt
->
infos
.
push_back
(
new
SrsTsPayloadPMTESInfo
(
vs
,
vpid
));
}
else
if
(
as
==
SrsTsStreamAudioAAC
||
as
==
SrsTsStreamAudioMp3
)
{
// use audio to carray pcr by default.
// for hls, there must be atleast one audio channel.
pmt
->
PCR_PID
=
apid
;
pmt
->
infos
.
push_back
(
new
SrsTsPayloadPMTESInfo
(
as
,
apid
));
}
else
{
srs_assert
(
false
);
}
pmt
->
CRC_32
=
0
;
// calc in encode.
...
...
请
注册
或
登录
后发表评论