64#define MOD_NAME "[vrxtx/h264_rtp] "
95 "codecs other than H.264 and JPEG currently not "
96 "supported, got %s\n",
103 MSG(INFO,
"Waiting for audio specs...\n");
113 if (m_rtsp_server ==
nullptr) {
115 configure_rtsp_server_video();
117 if (m_rtsp_server ==
nullptr) {
121 tx_send_std(m_tx, tx_frame.get(), m_network_device);
125 uint32_t
ts = (curr_time - m_common.start_time) / 100'000 * 9;
130 struct timeval timeout;
150 int audio_rx_port,
int ,
163 printf(
"\n[RTSP SERVER] usage:\n");
165 printf(
"\t\tdefault rtsp server port number: 8554\n\n");
171 if (strncmp(config,
"port:", 5) != 0 &&
172 strncmp(config,
"port=", 5) != 0) {
177 if (strlen(config) == 5) {
182 if (config[4] ==
':') {
183 MSG(WARNING,
"deprecated usage - use port=number, not port:number!\n");
185 int port = atoi(config + 5);
186 if (port < 0 || port > 65535 || !isdigit(config[5])) {
197 const char *rtsp_port_str =
static_cast<const char *
>(
params.at(
"opts").ptr);
198 if (strlen(rtsp_port_str) == 0) {
201 if (strcmp(rtsp_port_str,
"help") == 0) {
206 if (rtsp_port == -1) {
214 "RTP standard (using RTSP)",
const char * get_codec_name(codec_t codec)
void c_stop_server(rtsp_serv_t *server)
rtsp_serv_t * c_start_server(struct rtsp_server_parameters params)
void set_audio_spec(const struct audio_desc *desc, int audio_rx_port, int audio_tx_port, bool ipv6) override
void(* tx_send_std)(struct tx *tx_session, struct video_frame *frame, struct rtp *rtp_session)
virtual ~h264_rtp_video_rxtx()
h264_rtp_video_rxtx(std::map< std::string, param_u > const &, int)
virtual void send_frame(std::shared_ptr< video_frame >) noexcept override
std::atomic< bool > audio_params_set
rtsp_serv_t * m_rtsp_server
void configure_rtsp_server_video()
int color_printf(const char *format,...)
void log_msg(int level, const char *format,...)
#define LOG_LEVEL_ERROR
general errors
static int get_rtsp_server_port(const char *config)
static void rtps_server_usage()
static const struct video_rxtx_info h264_video_rxtx_info
static video_rxtx * create_video_rxtx_h264_std(std::map< std::string, param_u > const ¶ms)
@ LIBRARY_CLASS_VIDEO_RXTX
#define REGISTER_MODULE(name, info, lclass, abi)
Registers module to global modules' registry.
void rtp_update(struct rtp *session, time_ns_t curr_time)
void rtp_send_ctrl(struct rtp *session, uint32_t rtp_ts, rtcp_app_callback appcallback, time_ns_t curr_time)
bool rtp_recv_r(struct rtp *session, struct timeval *timeout, uint32_t curr_rtp_ts)
Receive RTP packets and dispatch them.
void sdp_print_supported_codecs(void)
struct common_opts m_common
void tx_send_jpeg(struct tx *tx, struct video_frame *frame, struct rtp *rtp_session)
void tx_send_h264(struct tx *tx, struct video_frame *frame, struct rtp *rtp_session)
static time_ns_t get_time_in_ns()
@ JPEG
JPEG image, restart intervals may be used. Compatible with GPUJPEG.
@ MJPG
JPEG image, without restart intervals.
#define VIDEO_RXTX_ABI_VERSION