Blame view

src/decoder/gb28181/rtp/RTPTcpReceiver.h 1.52 KB
c8285c8d   Hu Chunming   GB28181 UDP 有重大进展...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  #ifndef _RTP_TCP_RECEIVER_H_
  #define _RTP_TCP_RECEIVER_H_
  
  
  #include "demuxer.h"
  #include "buffer.h"
  
  #include "rtpsession.h"
  #include "rtptcptransmitter.h"
  #include "rtpipv4address.h"
  #include "rtptcpaddress.h"
  #include "rtpsessionparams.h"
  #include "rtperrors.h"
  #include "rtpsourcedata.h"
  #include "rtpsocketutil.h"
  #include <stdlib.h>
  #include <stdio.h>
  #include <iostream>
  #include <string>
  
  #include <queue>
  #include <atomic>
  #include <thread>
  #include <mutex>
  
  #include "RTPReceiver.h"
  
  
c8285c8d   Hu Chunming   GB28181 UDP 有重大进展...
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  using namespace jrtplib;
  using namespace std;
  
  
  
  class TcpRTPSession;
  class MyTCPTransmitter;
  
  class RTPTcpReceiver:public RTPReceiver
  {
  public:
  	RTPTcpReceiver();
  	~RTPTcpReceiver();
  
69ee81f3   Hu Chunming   提交websocket clien...
43
44
45
46
      virtual bool Open(string channel_id);
  	virtual bool virtual bool IsOpened() ;() virtual bool IsOpened() ;
  	virtual void virtual void Close() ;() virtual void Close() ;
  	virtual bool RequestStream();
c8285c8d   Hu Chunming   GB28181 UDP 有重大进展...
47
48
49
50
51
  
  public:
  	int OnRtpRecv();
      bool ReConnect();
      int ListenFinish();
c8285c8d   Hu Chunming   GB28181 UDP 有重大进展...
52
53
54
55
56
57
58
      bool isClosing();
  
  private:
      int initSession(int localPort);
      void close_task();
  
  private:
c8285c8d   Hu Chunming   GB28181 UDP 有重大进展...
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
      std::atomic_bool    m_bOpened;
      std::atomic_bool    m_bAccepted;
      std::atomic_bool    m_bClosing;
  
  	int64_t             m_idleCount;
  	int64_t             m_noDataCount;//线程计数,用于打开流成功但是实际没流过来
  
      std::thread      	m_rtpThread; 					// RTP接收线程
      SocketType          m_nListener;
  
      RTPSession*	        m_rtpSessionPtr;					// RTP会话
      RTPSessionParams*   m_pSessparams;
      MyTCPTransmitter*   m_pTrans;
  
      std::thread      	m_listenFinishThread; 					// RTP接收线程
      
  };
  
  #endif  // _RTP_TCP_RECEIVER_H_