65#define DEFAULT_SDP_COMPRESSION "lavc:codec=MJPEG:safe"
66#define MOD_NAME "[vrxtx/sdp] "
76 auto opts =
params.at(
"opts").str;
77 LOG(
LOG_LEVEL_WARNING) <<
"Warning: SDP support is experimental only. Things may be broken - feel free to report them but the support may be limited.\n";
81 throw ret == 1 ? 0 : 1;
88 if (s->m_saved_addr == address) {
96 path_sender, address);
105 throw ug_runtime_error(
"[SDP] Unsupported video codec for SDP (allowed H.264 and JPEG)!\n");
122 if (m_sent_compress_change) {
130 const char *path =
"sender.compress";
134 m_sent_compress_change =
true;
140 m_sdp_configured_codec = tx_frame->color_spec;
141 }
catch (exception
const &e) {
148 if (m_sdp_configured_codec != tx_frame->color_spec) {
153 if (m_sdp_configured_codec ==
H264) {
166 struct timeval timeout;
184 int ,
int audio_tx_port,
bool ipv6)
191 MSG(ERROR,
"Cannot add audio to SDP!\n");
201 "RTP standard (SDP version)",
This file contains definition of some common audio types.
void sdp_send_change_address_message(struct module *root, const enum module_class *path, const char *address)
virtual void send_frame(std::shared_ptr< video_frame >) noexcept override
void sdp_add_video(codec_t codec)
h264_sdp_video_rxtx(std::map< std::string, param_u > const &)
std::string m_saved_addr
for dynamic address reconfiguration,
void set_audio_spec(const struct audio_desc *desc, int audio_rx_port, int audio_tx_port, bool ipv6) override
static void change_address_callback(void *udata, const char *address)
struct rtp * m_network_device
std::string m_requested_receiver
static void new_message(struct module *m)
#define LOG_LEVEL_ERROR
general errors
#define LOG_LEVEL_WARNING
less severe errors
struct module * get_root_module(struct module *node)
static const struct video_rxtx_info h264_sdp_video_rxtx_info
static void sdp_change_address_callback(void *udata, const char *address)
#define DEFAULT_SDP_COMPRESSION
static video_rxtx * create_video_rxtx_h264_sdp(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.
struct response * send_message(struct module *root, const char *const_path, struct message *msg)
Sends message without waiting for response.
void free_response(struct response *r)
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.
bool rtp_is_ipv6(struct rtp *session)
int sdp_add_audio(bool ipv6, int port, int sample_rate, int channels, audio_codec_t codec, address_callback_t addr_callback, void *addr_callback_udata)
int sdp_set_options(const char *opts)
int sdp_add_video(bool ipv6, int port, codec_t codec, address_callback_t addr_callback, void *addr_callback_udata)
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)
uint32_t get_std_video_local_mediatime(void)
static time_ns_t get_time_in_ns()
@ VIDEO_CODEC_NONE
dummy color spec
bool is_codec_opaque(codec_t codec)
#define VIDEO_RXTX_ABI_VERSION