mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
for #250, parse pes packet ok, ts message ok.
This commit is contained in:
parent
486277089d
commit
1685cdd48e
6 changed files with 740 additions and 25 deletions
|
@ -73,7 +73,8 @@ 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) {
|
||||
break;
|
||||
srs_warn("mpegts: ignore parse ts packet failed. ret=%d", ret);
|
||||
continue;
|
||||
}
|
||||
srs_info("mpegts: parse ts packet completed");
|
||||
}
|
||||
|
@ -86,7 +87,7 @@ int SrsMpegtsOverUdp::on_ts_packet(SrsStream* stream)
|
|||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
if ((ret = context->decode(stream)) != ERROR_SUCCESS) {
|
||||
if ((ret = context->decode(stream, this)) != ERROR_SUCCESS) {
|
||||
srs_error("mpegts: decode ts packet failed. ret=%d", ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -94,4 +95,11 @@ int SrsMpegtsOverUdp::on_ts_packet(SrsStream* stream)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsMpegtsOverUdp::on_ts_message(SrsTsMessage* msg)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
// TODO: FIXME: implements it.
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,10 +39,12 @@ class SrsConfDirective;
|
|||
|
||||
#ifdef SRS_AUTO_STREAM_CASTER
|
||||
|
||||
#include <srs_kernel_ts.hpp>
|
||||
|
||||
/**
|
||||
* the mpegts over udp stream caster.
|
||||
*/
|
||||
class SrsMpegtsOverUdp
|
||||
class SrsMpegtsOverUdp : public ISrsTsHandler
|
||||
{
|
||||
private:
|
||||
SrsStream* stream;
|
||||
|
@ -67,6 +69,9 @@ private:
|
|||
* the stream contains the ts packet to parse.
|
||||
*/
|
||||
virtual int on_ts_packet(SrsStream* stream);
|
||||
// interface ISrsTsHandler
|
||||
public:
|
||||
virtual int on_ts_message(SrsTsMessage* msg);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue