#ifndef CRTPRECEIVER_H_ #define CRTPRECEIVER_H_ #include #include #include #define VIDEO_UDP_CAPS "application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H263-1998" #define UDP_RTP_PORT_SV 5000 #define UDP_RTP_PORT_SA 5002 #define UDP_RTCP_PORT_SV 5001 #define UDP_RTCP_PORT_SA 5003 #define UDP_RTCP_PORT_RV 5005 #define UDP_RTCP_PORT_RA 5007 #define RHOST "127.0.0.1" class CRtpReceiver { public: static CRtpReceiver* getInstance(){return &m_theInstance;} virtual ~CRtpReceiver(); bool startReceiver(); bool stopReceiver(); static void cb_new_pad(GstElement* element, GstPad* pad, gpointer data); static void state_changed(const GstBus* const bus, GstMessage* message, void* user_data); GMainLoop * m_mainLoop; private: CRtpReceiver(); typedef struct { GstElement* depayloader; GstElement* decoder; GstElement* colorspace; GstElement* render; } VideoReceiverPipe_t; typedef struct { GstElement* rtp_receiver; GstElement* rtcp_sender; GstElement* rtcp_receiver; } UdpReceiver_t; typedef struct { GstPad* recv_rtp_src0; GstPad* recv_rtp_sink0; GstPad* send_rtcp_src0; GstPad* recv_rtcp_sink0; } PadsReceiver_t; VideoReceiverPipe_t* createVideoReceiver(GstElement* bin); UdpReceiver_t* createUdpReceiver(GstElement* bin); PadsReceiver_t* getPadsReceiver(GstElement* rtpbin); GstElement* m_bin; GstElement* m_gstrtpbin; VideoReceiverPipe_t* m_vid_recvpipe; UdpReceiver_t* m_vid_udpreceiver; PadsReceiver_t* m_pads_receiver; static CRtpReceiver m_theInstance; }; #endif /*CRTPRECEIVER_H_*/