21 #ifndef GV_RTPSERVER__H
22 #define GV_RTPSERVER__H
46 class RtpServerHandler ;
55 G_EXCEPTION( InvalidFmtp ,
"invalid fmtp" ) ;
58 unsigned int packet_type ,
const G::Path & fmtp_file ,
59 int jpeg_fudge_factor ,
const std::string & filter_spec ,
unsigned int source_stale_timeout ) ;
75 virtual void readEvent()
override ;
76 virtual void onException( std::exception & )
override ;
77 void onData(
const char * p , std::string::size_type n ) ;
78 void processRtpData(
const char * p , std::string::size_type n ) ;
79 void processJpegPayload(
const std::vector<char> & ) ;
80 void processAvcPayload(
const std::vector<char> & ) ;
84 void join(
const std::string & ) ;
85 static std::string readFmtpFile(
const G::Path & ) ;
86 static int autoscale(
int scale ,
int dx ) ;
92 unsigned int m_packet_type ;
93 unsigned long m_source_id ;
94 time_t m_source_time ;
95 unsigned int m_source_stale_timeout ;
97 int m_jpeg_fudge_factor ;
98 std::string m_filter_spec ;
99 std::vector<unsigned int> m_filter_list ;
100 unique_ptr<Gr::Avc::Configuration> m_avcc ;
102 std::vector<char> m_packet_buffer ;
104 std::vector<char> m_output_buffer ;
105 unsigned int m_seq_old ;
106 unique_ptr<Gv::AvcReaderStream> m_avc_reader_stream ;
112 std::vector<char> m_jpeg_buffer ;
121 virtual void onImage(
const std::vector<char> & ,
const Gr::ImageType & ,
bool avc_key_frame ) = 0 ;
A holder for image data, having eight bits per sample and one or three channels.
RtpServer(RtpServerHandler &, int scale, bool monochrome, GNet::Address bind_address, const std::string &group_address, unsigned int packet_type, const G::Path &fmtp_file, int jpeg_fudge_factor, const std::string &filter_spec, unsigned int source_stale_timeout)
Constructor.
An RTP payload parser for the jpeg payload type.
The GNet::Address class encapsulates a TCP/UDP transport address.
A derivation of GNet::Socket for a datagram socket.
An encapsulation of image type, including width, height and number of channels, with support for a st...
virtual ~RtpServer()
Destructor.
A read interface for libjpeg.
A class that accumulates RTP-AVC or RTP-JPEG packets and serves up AVC NALUs or JPEG JFIFs...
A base class for classes that handle asynchronous events from the event loop.
A write interface for libjpeg.
An RTP payload parser for the "H264" payload type.
A timer class template in which the timeout is delivered to the specified method. ...
A interface that Gv::RtpServer uses to deliver image data.
A Path object represents a file system path.
virtual void onImage(const std::vector< char > &, const Gr::ImageType &, bool avc_key_frame)=0
Called on receipt of an image.