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-01-31 12:21:04 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
66fccdbbd1456331255a8e6293aff9bad275115a
66fccdbb
1 parent
bce78fda
for #250, demux PES stream ok, only support h.264(annexb) and aac(adts) in mpegts over udp. 3.0.109.
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
32 行增加
和
6 行删除
trunk/src/app/srs_app_mpegts_udp.cpp
trunk/src/core/srs_core.hpp
trunk/src/kernel/srs_kernel_error.hpp
trunk/src/kernel/srs_kernel_ts.cpp
trunk/src/kernel/srs_kernel_ts.hpp
trunk/src/app/srs_app_mpegts_udp.cpp
查看文件 @
66fccdb
...
...
@@ -38,6 +38,7 @@ using namespace std;
#include <srs_kernel_buffer.hpp>
#include <srs_kernel_file.hpp>
#include <srs_core_autofree.hpp>
#include <srs_kernel_utility.hpp>
#ifdef SRS_AUTO_STREAM_CASTER
...
...
@@ -160,8 +161,8 @@ int SrsMpegtsOverUdp::on_ts_message(SrsTsMessage* msg)
// for example, when SrsTsStream of SrsTsChannel indicates stream_type is SrsTsStreamVideoMpeg4 and SrsTsStreamAudioMpeg4,
// the elementary stream can be mux in "2.11 Carriage of ISO/IEC 14496 data" in hls-mpeg-ts-iso13818-1.pdf, page 103
// @remark, the most popular stream_id is 0xe0 for h.264 over mpegts, which indicates the stream_id is video and
// stream_number is 0, where I guess the elementary is specified in 13818-2(video part).
// because when audio stream_number is 0, the elementary is ADTS specified in 13818-7(aac part).
// stream_number is 0, where I guess the elementary is specified in annexb format(H.264-AVC-ISO_IEC_14496-10.pdf, page 211).
// because when audio stream_number is 0, the elementary is ADTS(aac-mp4a-format-ISO_IEC_14496-3+2001.pdf, page 75, 1.A.2.2 ADTS).
// about the bytes of PES_packet_data_byte, defined in hls-mpeg-ts-iso13818-1.pdf, page 58
// PES_packet_data_byte ¨C PES_packet_data_bytes shall be contiguous bytes of data from the elementary stream
...
...
@@ -193,11 +194,19 @@ int SrsMpegtsOverUdp::on_ts_message(SrsTsMessage* msg)
// 14496-2 video stream number xxxx
// ((stream_id >> 4) & 0x0f) == SrsTsPESStreamIdVideo
srs_trace
(
"mpegts: got %s dts=%"
PRId64
", pts=%"
PRId64
", size=%d, us=%d, cc=%d, sid=%#x(%s-%d)"
,
(
msg
->
channel
->
apply
==
SrsTsPidApplyVideo
)
?
"Video"
:
"Audio"
,
msg
->
dts
,
msg
->
pts
,
msg
->
payload
->
length
(),
msg
->
packet
->
payload_unit_start_indicator
,
msg
->
continuity_counter
,
msg
->
sid
,
srs_trace
(
"mpegts: got %s stream=%s, dts=%"
PRId64
", pts=%"
PRId64
", size=%d, us=%d, cc=%d, sid=%#x(%s-%d)"
,
(
msg
->
channel
->
apply
==
SrsTsPidApplyVideo
)
?
"Video"
:
"Audio"
,
srs_ts_stream2string
(
msg
->
channel
->
stream
).
c_str
(),
msg
->
dts
,
msg
->
pts
,
msg
->
payload
->
length
(),
msg
->
packet
->
payload_unit_start_indicator
,
msg
->
continuity_counter
,
msg
->
sid
,
msg
->
is_audio
()
?
"A"
:
msg
->
is_video
()
?
"V"
:
"N"
,
msg
->
stream_number
());
// when not audio/video, or not adts/annexb format, donot support.
if
(
msg
->
stream_number
()
!=
0
)
{
ret
=
ERROR_STREAM_CASTER_TS_ES
;
srs_error
(
"mpegts: unsupported stream format, sid=%#x(%s-%d). ret=%d"
,
msg
->
sid
,
msg
->
is_audio
()
?
"A"
:
msg
->
is_video
()
?
"V"
:
"N"
,
msg
->
stream_number
(),
ret
);
return
ret
;
}
// TODO: FIXME: implements it.
return
ret
;
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
66fccdb
...
...
@@ -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 10
8
#define VERSION_REVISION 10
9
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
trunk/src/kernel/srs_kernel_error.hpp
查看文件 @
66fccdb
...
...
@@ -227,6 +227,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define ERROR_STREAM_CASTER_TS_PAT 4017
#define ERROR_STREAM_CASTER_TS_PMT 4018
#define ERROR_STREAM_CASTER_TS_PSE 4019
#define ERROR_STREAM_CASTER_TS_ES 4020
/**
* whether the error code is an system control error.
...
...
trunk/src/kernel/srs_kernel_ts.cpp
查看文件 @
66fccdb
...
...
@@ -402,6 +402,21 @@ SrsMpegtsFrame::SrsMpegtsFrame()
key
=
false
;
}
string
srs_ts_stream2string
(
SrsTsStream
stream
)
{
switch
(
stream
)
{
case
SrsTsStreamReserved
:
return
"Reserved"
;
case
SrsTsStreamAudioMp3
:
return
"MP3"
;
case
SrsTsStreamAudioAAC
:
return
"AAC"
;
case
SrsTsStreamAudioAC3
:
return
"AC3"
;
case
SrsTsStreamAudioDTS
:
return
"AudioDTS"
;
case
SrsTsStreamVideoH264
:
return
"H.264"
;
case
SrsTsStreamVideoMpeg4
:
return
"MP4"
;
case
SrsTsStreamAudioMpeg4
:
return
"MP4A"
;
default
:
return
"Other"
;
}
}
SrsTsChannel
::
SrsTsChannel
()
{
pid
=
0
;
...
...
trunk/src/kernel/srs_kernel_ts.hpp
查看文件 @
66fccdb
...
...
@@ -174,6 +174,7 @@ enum SrsTsStream
SrsTsStreamAudioAC3
=
0x81
,
SrsTsStreamAudioDTS
=
0x8a
,
};
std
::
string
srs_ts_stream2string
(
SrsTsStream
stream
);
/**
* the ts channel.
...
...
请
注册
或
登录
后发表评论