mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #250, use udp packet handler.
This commit is contained in:
parent
35ab0ea627
commit
a384cc400a
3 changed files with 35 additions and 32 deletions
|
@ -39,6 +39,14 @@ using namespace std;
|
|||
|
||||
#ifdef SRS_AUTO_STREAM_CASTER
|
||||
|
||||
ISrsUdpHandler::ISrsUdpHandler()
|
||||
{
|
||||
}
|
||||
|
||||
ISrsUdpHandler::~ISrsUdpHandler()
|
||||
{
|
||||
}
|
||||
|
||||
SrsMpegtsOverUdp::SrsMpegtsOverUdp(SrsConfDirective* c)
|
||||
{
|
||||
stream = new SrsStream();
|
||||
|
@ -95,7 +103,7 @@ int SrsMpegtsOverUdp::on_udp_packet(sockaddr_in* from, char* buf, int nb_buf)
|
|||
}
|
||||
|
||||
// process each ts packet
|
||||
if ((ret = on_ts_packet(stream)) != ERROR_SUCCESS) {
|
||||
if ((ret = context->decode(stream, this)) != ERROR_SUCCESS) {
|
||||
srs_warn("mpegts: ignore parse ts packet failed. ret=%d", ret);
|
||||
continue;
|
||||
}
|
||||
|
@ -111,18 +119,6 @@ int SrsMpegtsOverUdp::on_udp_packet(sockaddr_in* from, char* buf, int nb_buf)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsMpegtsOverUdp::on_ts_packet(SrsStream* stream)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
if ((ret = context->decode(stream, this)) != ERROR_SUCCESS) {
|
||||
srs_error("mpegts: decode ts packet failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsMpegtsOverUdp::on_ts_message(SrsTsMessage* msg)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue