1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Refine source state to created and delivering

This commit is contained in:
winlin 2020-08-17 18:15:34 +08:00
parent 5afabe4adf
commit 66a0143f14
5 changed files with 42 additions and 19 deletions

View file

@ -152,8 +152,10 @@ private:
private:
// To delivery stream to clients.
std::vector<SrsRtcConsumer*> consumers;
// Whether source is avaiable for publishing.
bool _can_publish;
// Whether stream is created, that is, SDP is done.
bool is_created_;
// Whether stream is delivering data, that is, DTLS is done.
bool is_delivering_packets_;
public:
SrsRtcStream();
virtual ~SrsRtcStream();
@ -179,7 +181,10 @@ public:
virtual srs_error_t consumer_dumps(SrsRtcConsumer* consumer, bool ds = true, bool dm = true, bool dg = true);
virtual void on_consumer_destroy(SrsRtcConsumer* consumer);
// Whether we can publish stream to the source, return false if it exists.
// @remark Note that when SDP is done, we set the stream is not able to publish.
virtual bool can_publish();
// For RTC, the stream is created when SDP is done, and then do DTLS
virtual void set_stream_created();
// When start publish stream.
virtual srs_error_t on_publish();
// When stop publish stream.