mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 06:40:26 +00:00
SDP: Set correct IP version
+ some documentation
This commit is contained in:
@@ -1114,7 +1114,7 @@ int main(int argc, char *argv[])
|
||||
audio_codec = "OPUS:sample_rate=48000";
|
||||
}
|
||||
if (requested_compression == nullptr) {
|
||||
requested_compression = "none"; // will be set later
|
||||
requested_compression = "none"; // will be set later by h264_sdp_video_rxtx::send_frame()
|
||||
}
|
||||
if (force_ip_version == 0 && strcasecmp(video_protocol, "rtsp") == 0) {
|
||||
force_ip_version = 4;
|
||||
|
||||
@@ -106,7 +106,7 @@ struct sdp {
|
||||
};
|
||||
|
||||
struct sdp *new_sdp(int ip_version, const char *receiver) {
|
||||
assert(ip_version == 0 || ip_version == 4 || ip_version == 6);
|
||||
assert(ip_version == 4 || ip_version == 6);
|
||||
struct sdp *sdp;
|
||||
sdp = calloc(1, sizeof(struct sdp));
|
||||
assert(sdp != NULL);
|
||||
@@ -137,9 +137,9 @@ struct sdp *new_sdp(int ip_version, const char *receiver) {
|
||||
connection_address = receiver;
|
||||
}
|
||||
strncpy(sdp->version, "v=0\n", STR_LENGTH - 1);
|
||||
snprintf(sdp->origin, STR_LENGTH, "o=- 0 0 IN IP%d %s\n", ip_version == 0 ? 4 : 6, origin_address);
|
||||
snprintf(sdp->origin, STR_LENGTH, "o=- 0 0 IN IP%d %s\n", ip_version, origin_address);
|
||||
strncpy(sdp->session_name, "s=Ultragrid streams\n", STR_LENGTH - 1);
|
||||
snprintf(sdp->connection, STR_LENGTH, "c=IN IP%d %s\n", ip_version == 0 ? 4 : 6, connection_address);
|
||||
snprintf(sdp->connection, STR_LENGTH, "c=IN IP%d %s\n", ip_version, connection_address);
|
||||
strncpy(sdp->times, "t=0 0\n", STR_LENGTH - 1);
|
||||
|
||||
return sdp;
|
||||
|
||||
@@ -82,7 +82,7 @@ h264_sdp_video_rxtx::h264_sdp_video_rxtx(std::map<std::string, param_u> const &p
|
||||
}
|
||||
|
||||
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";
|
||||
m_sdp = new_sdp(params.at("force_ip_version").i, m_requested_receiver.c_str());
|
||||
m_sdp = new_sdp(rtp_is_ipv6(m_network_devices[0]) ? 6 : 4 , m_requested_receiver.c_str());
|
||||
m_saved_addr = m_requested_receiver;
|
||||
if (m_sdp == nullptr) {
|
||||
throw string("[SDP] SDP creation failed\n");
|
||||
@@ -162,6 +162,12 @@ void h264_sdp_video_rxtx::sdp_add_video(codec_t codec)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* @note
|
||||
* This function sets compression just after first frame is received. The delayed initialization is to allow devices
|
||||
* producing H.264/JPEG natively (eg. v4l2) to be passed untouched to transport. Fallback H.264 is applied when uncompressed
|
||||
* stream is detected.
|
||||
*/
|
||||
void h264_sdp_video_rxtx::send_frame(shared_ptr<video_frame> tx_frame)
|
||||
{
|
||||
if (!is_codec_opaque(tx_frame->color_spec)) {
|
||||
|
||||
Reference in New Issue
Block a user