mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
rename the recv thread to queue recv thread for bug #237.
This commit is contained in:
parent
1847c5fef7
commit
22524f390a
4 changed files with 17 additions and 17 deletions
|
@ -26,13 +26,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
#include <srs_protocol_rtmp.hpp>
|
||||
#include <srs_protocol_stack.hpp>
|
||||
|
||||
SrsRecvThread::SrsRecvThread(SrsRtmpServer* rtmp_sdk)
|
||||
SrsQueueRecvThread::SrsQueueRecvThread(SrsRtmpServer* rtmp_sdk)
|
||||
{
|
||||
rtmp = rtmp_sdk;
|
||||
trd = new SrsThread(this, 0, true);
|
||||
}
|
||||
|
||||
SrsRecvThread::~SrsRecvThread()
|
||||
SrsQueueRecvThread::~SrsQueueRecvThread()
|
||||
{
|
||||
// stop recv thread.
|
||||
stop();
|
||||
|
@ -49,17 +49,17 @@ SrsRecvThread::~SrsRecvThread()
|
|||
queue.clear();
|
||||
}
|
||||
|
||||
bool SrsRecvThread::empty()
|
||||
bool SrsQueueRecvThread::empty()
|
||||
{
|
||||
return queue.empty();
|
||||
}
|
||||
|
||||
int SrsRecvThread::size()
|
||||
int SrsQueueRecvThread::size()
|
||||
{
|
||||
return (int)queue.size();
|
||||
}
|
||||
|
||||
SrsMessage* SrsRecvThread::pump()
|
||||
SrsMessage* SrsQueueRecvThread::pump()
|
||||
{
|
||||
srs_assert(!queue.empty());
|
||||
|
||||
|
@ -70,17 +70,17 @@ SrsMessage* SrsRecvThread::pump()
|
|||
return msg;
|
||||
}
|
||||
|
||||
int SrsRecvThread::start()
|
||||
int SrsQueueRecvThread::start()
|
||||
{
|
||||
return trd->start();
|
||||
}
|
||||
|
||||
void SrsRecvThread::stop()
|
||||
void SrsQueueRecvThread::stop()
|
||||
{
|
||||
trd->stop();
|
||||
}
|
||||
|
||||
int SrsRecvThread::cycle()
|
||||
int SrsQueueRecvThread::cycle()
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
@ -114,7 +114,7 @@ int SrsRecvThread::cycle()
|
|||
return ret;
|
||||
}
|
||||
|
||||
void SrsRecvThread::on_thread_start()
|
||||
void SrsQueueRecvThread::on_thread_start()
|
||||
{
|
||||
// the multiple messages writev improve performance large,
|
||||
// but the timeout recv will cause 33% sys call performance,
|
||||
|
@ -128,7 +128,7 @@ void SrsRecvThread::on_thread_start()
|
|||
rtmp->set_auto_response(false);
|
||||
}
|
||||
|
||||
void SrsRecvThread::on_thread_stop()
|
||||
void SrsQueueRecvThread::on_thread_stop()
|
||||
{
|
||||
// enable the protocol auto response,
|
||||
// for the isolate recv thread terminated.
|
||||
|
|
|
@ -43,15 +43,15 @@ class SrsMessage;
|
|||
* @see: SrsRtmpConn::playing
|
||||
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
|
||||
*/
|
||||
class SrsRecvThread : public ISrsThreadHandler
|
||||
class SrsQueueRecvThread : public ISrsThreadHandler
|
||||
{
|
||||
private:
|
||||
SrsThread* trd;
|
||||
SrsRtmpServer* rtmp;
|
||||
std::vector<SrsMessage*> queue;
|
||||
public:
|
||||
SrsRecvThread(SrsRtmpServer* rtmp_sdk);
|
||||
virtual ~SrsRecvThread();
|
||||
SrsQueueRecvThread(SrsRtmpServer* rtmp_sdk);
|
||||
virtual ~SrsQueueRecvThread();
|
||||
public:
|
||||
virtual bool empty();
|
||||
virtual int size();
|
||||
|
|
|
@ -500,7 +500,7 @@ int SrsRtmpConn::playing(SrsSource* source)
|
|||
|
||||
// use isolate thread to recv,
|
||||
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
|
||||
SrsRecvThread trd(rtmp);
|
||||
SrsQueueRecvThread trd(rtmp);
|
||||
|
||||
// start isolate recv thread.
|
||||
if ((ret = trd.start()) != ERROR_SUCCESS) {
|
||||
|
@ -522,7 +522,7 @@ int SrsRtmpConn::playing(SrsSource* source)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SrsRtmpConn::do_playing(SrsSource* source, SrsRecvThread* trd)
|
||||
int SrsRtmpConn::do_playing(SrsSource* source, SrsQueueRecvThread* trd)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class SrsBandwidth;
|
|||
class SrsKbps;
|
||||
class SrsRtmpClient;
|
||||
class SrsSharedPtrMessage;
|
||||
class SrsRecvThread;
|
||||
class SrsQueueRecvThread;
|
||||
|
||||
/**
|
||||
* the client provides the main logic control for RTMP clients.
|
||||
|
@ -89,7 +89,7 @@ private:
|
|||
virtual int stream_service_cycle();
|
||||
virtual int check_vhost();
|
||||
virtual int playing(SrsSource* source);
|
||||
virtual int do_playing(SrsSource* source, SrsRecvThread* trd);
|
||||
virtual int do_playing(SrsSource* source, SrsQueueRecvThread* trd);
|
||||
virtual int fmle_publishing(SrsSource* source);
|
||||
virtual int do_fmle_publishing(SrsSource* source);
|
||||
virtual int flash_publishing(SrsSource* source);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue