refactoring

This commit is contained in:
Maxim Devaev 2022-11-03 19:09:17 +03:00
parent a24e0eeb86
commit 335f19f0e3
2 changed files with 9 additions and 7 deletions

View File

@ -102,11 +102,11 @@ static void *_common_thread(void *v_client, bool video) {
packet.video = rtp->video;
packet.buffer = (char *)rtp->datagram;
packet.length = rtp->used;
#if JANUS_PLUGIN_API_VERSION >= 100
# if JANUS_PLUGIN_API_VERSION >= 100
// The uStreamer Janus plugin places video in stream index 0 and audio
// (if available) in stream index 1.
packet.mindex = (rtp->video ? 0 : 1);
#endif
# endif
janus_plugin_rtp_extensions_reset(&packet.extensions);
// FIXME: Это очень эффективный способ уменьшить задержку, но WebRTC стек в хроме и фоксе
// слишком корявый, чтобы обработать это, из-за чего на кейфреймах начинаются заикания.

View File

@ -440,14 +440,16 @@ static struct janus_plugin_result *_plugin_handle_message(
"s=PiKVM uStreamer" RN
"t=0 0" RN
"%s%s",
#if JANUS_PLUGIN_API_VERSION >= 100
us_get_now_id() >> 1,
# if JANUS_PLUGIN_API_VERSION >= 100
// Place video SDP before audio SDP so that the video and audio streams
// have predictable indices, even if audio is not available.
us_get_now_id() >> 1, video_sdp, audio_sdp
#else
// See also client.c.
video_sdp, audio_sdp
# else
// For versions of Janus prior to 1.x, place the audio SDP first.
us_get_now_id() >> 1, audio_sdp, video_sdp
#endif
audio_sdp, video_sdp
# endif
);
free(audio_sdp);
free(video_sdp);