@@ -113,7 +113,9 @@ class ISrsSrtConsumer
113113public:
114114 virtual srs_error_t enqueue (SrsSrtPacket *packet) = 0;
115115 virtual srs_error_t dump_packet (SrsSrtPacket **ppkt) = 0;
116- virtual void wait (int nb_msgs, srs_utime_t timeout) = 0;
116+ // Wait for at-least some messages incoming in queue.
117+ // @return true if there are enough messages, false if timeout.
118+ virtual bool wait (int nb_msgs, srs_utime_t timeout) = 0;
117119};
118120
119121// The SRT consumer, consume packets from SRT stream source.
@@ -146,7 +148,8 @@ class SrsSrtConsumer : public ISrsSrtConsumer
146148 // For SRT, we only got one packet, because there is not many packets in queue.
147149 virtual srs_error_t dump_packet (SrsSrtPacket **ppkt);
148150 // Wait for at-least some messages incoming in queue.
149- virtual void wait (int nb_msgs, srs_utime_t timeout);
151+ // @return true if there are enough messages, false if timeout.
152+ virtual bool wait (int nb_msgs, srs_utime_t timeout);
150153};
151154
152155// The SRT format interface.
@@ -271,6 +274,8 @@ class ISrsSrtSource : public ISrsSrtTarget
271274 virtual SrsContextId source_id () = 0;
272275 virtual SrsContextId pre_source_id () = 0;
273276 virtual void on_consumer_destroy (ISrsSrtConsumer *consumer) = 0;
277+ // Whether we can publish stream to the source, return true if no publisher.
278+ virtual bool can_publish () = 0;
274279};
275280
276281// A SRT source is a stream, to publish and to play with.
0 commit comments