mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Remove unused conn from consumer.
This commit is contained in:
parent
88826aae8f
commit
d8a158290f
4 changed files with 8 additions and 12 deletions
|
@ -129,7 +129,7 @@ srs_error_t SrsBufferCache::cycle()
|
||||||
// which will trigger to fetch stream from origin for edge.
|
// which will trigger to fetch stream from origin for edge.
|
||||||
SrsConsumer* consumer = NULL;
|
SrsConsumer* consumer = NULL;
|
||||||
SrsAutoFree(SrsConsumer, consumer);
|
SrsAutoFree(SrsConsumer, consumer);
|
||||||
if ((err = source->create_consumer(NULL, consumer)) != srs_success) {
|
if ((err = source->create_consumer(consumer)) != srs_success) {
|
||||||
return srs_error_wrap(err, "create consumer");
|
return srs_error_wrap(err, "create consumer");
|
||||||
}
|
}
|
||||||
if ((err = source->consumer_dumps(consumer, false, false, true)) != srs_success) {
|
if ((err = source->consumer_dumps(consumer, false, false, true)) != srs_success) {
|
||||||
|
@ -587,7 +587,7 @@ srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
|
||||||
// create consumer of souce, ignore gop cache, use the audio gop cache.
|
// create consumer of souce, ignore gop cache, use the audio gop cache.
|
||||||
SrsConsumer* consumer = NULL;
|
SrsConsumer* consumer = NULL;
|
||||||
SrsAutoFree(SrsConsumer, consumer);
|
SrsAutoFree(SrsConsumer, consumer);
|
||||||
if ((err = source->create_consumer(NULL, consumer)) != srs_success) {
|
if ((err = source->create_consumer(consumer)) != srs_success) {
|
||||||
return srs_error_wrap(err, "create consumer");
|
return srs_error_wrap(err, "create consumer");
|
||||||
}
|
}
|
||||||
if ((err = source->consumer_dumps(consumer, true, true, !enc->has_cache())) != srs_success) {
|
if ((err = source->consumer_dumps(consumer, true, true, !enc->has_cache())) != srs_success) {
|
||||||
|
|
|
@ -659,7 +659,7 @@ srs_error_t SrsRtmpConn::playing(SrsSource* source)
|
||||||
// Create a consumer of source.
|
// Create a consumer of source.
|
||||||
SrsConsumer* consumer = NULL;
|
SrsConsumer* consumer = NULL;
|
||||||
SrsAutoFree(SrsConsumer, consumer);
|
SrsAutoFree(SrsConsumer, consumer);
|
||||||
if ((err = source->create_consumer(this, consumer)) != srs_success) {
|
if ((err = source->create_consumer(consumer)) != srs_success) {
|
||||||
return srs_error_wrap(err, "rtmp: create consumer");
|
return srs_error_wrap(err, "rtmp: create consumer");
|
||||||
}
|
}
|
||||||
if ((err = source->consumer_dumps(consumer)) != srs_success) {
|
if ((err = source->consumer_dumps(consumer)) != srs_success) {
|
||||||
|
|
|
@ -418,10 +418,9 @@ ISrsWakable::~ISrsWakable()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
SrsConsumer::SrsConsumer(SrsSource* s, SrsTcpConnection* c)
|
SrsConsumer::SrsConsumer(SrsSource* s)
|
||||||
{
|
{
|
||||||
source = s;
|
source = s;
|
||||||
conn = c;
|
|
||||||
paused = false;
|
paused = false;
|
||||||
jitter = new SrsRtmpJitter();
|
jitter = new SrsRtmpJitter();
|
||||||
queue = new SrsMessageQueue();
|
queue = new SrsMessageQueue();
|
||||||
|
@ -2578,11 +2577,11 @@ void SrsSource::on_unpublish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_error_t SrsSource::create_consumer(SrsTcpConnection* conn, SrsConsumer*& consumer)
|
srs_error_t SrsSource::create_consumer(SrsConsumer*& consumer)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
consumer = new SrsConsumer(this, conn);
|
consumer = new SrsConsumer(this);
|
||||||
consumers.push_back(consumer);
|
consumers.push_back(consumer);
|
||||||
|
|
||||||
// for edge, when play edge stream, check the state
|
// for edge, when play edge stream, check the state
|
||||||
|
|
|
@ -51,7 +51,6 @@ class SrsRtmpServer;
|
||||||
class SrsEdgeProxyContext;
|
class SrsEdgeProxyContext;
|
||||||
class SrsMessageArray;
|
class SrsMessageArray;
|
||||||
class SrsNgExec;
|
class SrsNgExec;
|
||||||
class SrsTcpConnection;
|
|
||||||
class SrsMessageHeader;
|
class SrsMessageHeader;
|
||||||
class SrsHls;
|
class SrsHls;
|
||||||
class SrsRtc;
|
class SrsRtc;
|
||||||
|
@ -189,8 +188,6 @@ private:
|
||||||
SrsRtmpJitter* jitter;
|
SrsRtmpJitter* jitter;
|
||||||
SrsSource* source;
|
SrsSource* source;
|
||||||
SrsMessageQueue* queue;
|
SrsMessageQueue* queue;
|
||||||
// The owner connection for debug, maybe NULL.
|
|
||||||
SrsTcpConnection* conn;
|
|
||||||
bool paused;
|
bool paused;
|
||||||
// when source id changed, notice all consumers
|
// when source id changed, notice all consumers
|
||||||
bool should_update_source_id;
|
bool should_update_source_id;
|
||||||
|
@ -203,7 +200,7 @@ private:
|
||||||
srs_utime_t mw_duration;
|
srs_utime_t mw_duration;
|
||||||
#endif
|
#endif
|
||||||
public:
|
public:
|
||||||
SrsConsumer(SrsSource* s, SrsTcpConnection* c);
|
SrsConsumer(SrsSource* s);
|
||||||
virtual ~SrsConsumer();
|
virtual ~SrsConsumer();
|
||||||
public:
|
public:
|
||||||
// Set the size of queue.
|
// Set the size of queue.
|
||||||
|
@ -599,7 +596,7 @@ public:
|
||||||
public:
|
public:
|
||||||
// Create consumer
|
// Create consumer
|
||||||
// @param consumer, output the create consumer.
|
// @param consumer, output the create consumer.
|
||||||
virtual srs_error_t create_consumer(SrsTcpConnection* conn, SrsConsumer*& consumer);
|
virtual srs_error_t create_consumer(SrsConsumer*& consumer);
|
||||||
// Dumps packets in cache to consumer.
|
// Dumps packets in cache to consumer.
|
||||||
// @param ds, whether dumps the sequence header.
|
// @param ds, whether dumps the sequence header.
|
||||||
// @param dm, whether dumps the metadata.
|
// @param dm, whether dumps the metadata.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue