提交 a56e65ba authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Michael Jerris

FS-7513: add flag to choose between encoding each frame and using central…

FS-7513: add flag to choose between encoding each frame and using central encoder per codec, add parsing for floor fields and reservation fields in layouts, add param to control bandwidth for consolidated codecs, add  audio-position attr to images in layout to sync with virtual HRTF
上级 fa5d6af2
...@@ -175,9 +175,12 @@ ...@@ -175,9 +175,12 @@
<param name="caller-id-number" value="$${outbound_caller_id}"/> <param name="caller-id-number" value="$${outbound_caller_id}"/>
<param name="comfort-noise" value="true"/> <param name="comfort-noise" value="true"/>
<!--<param name="conference-flags" value="video-floor-only|rfc-4579|livearray-sync|auto-3d-position|transcode-video|minimize-video-encoding"/> -->
<!-- <param name="video-layout-name" value="3x3"/> --> <!-- <param name="video-layout-name" value="3x3"/> -->
<!-- <param name="video-canvas-size" value="1280x720"/> --> <!-- <param name="video-canvas-size" value="1280x720"/> -->
<!-- <param name="video-canvas-bgcolor" value="#0000FF"/> --> <!-- <param name="video-canvas-bgcolor" value="#0000FF"/> -->
<!-- <param name="video-codec-bandwidth" value="2mb"/> -->
<!--<param name="tts-engine" value="flite"/>--> <!--<param name="tts-engine" value="flite"/>-->
<!--<param name="tts-voice" value="kal16"/>--> <!--<param name="tts-voice" value="kal16"/>-->
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
<image x="300" y="300" scale="60"/> <image x="300" y="300" scale="60"/>
</layout> </layout>
<layout name="1up_top_left+5"> <layout name="1up_top_left+5">
<image x="0" y="0" scale="240" floor="true" reservation_id="primary"/> <image x="0" y="0" scale="240" floor="true"/>
<image x="240" y="0" scale="120"/> <image x="240" y="0" scale="120"/>
<image x="240" y="120" scale="120"/> <image x="240" y="120" scale="120"/>
<image x="0" y="240" scale="120"/> <image x="0" y="240" scale="120"/>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<image x="240" y="240" scale="120"/> <image x="240" y="240" scale="120"/>
</layout> </layout>
<layout name="1up_top_left+7"> <layout name="1up_top_left+7">
<image x="0" y="0" scale="270" floor="true" reservation_id="primary"/> <image x="0" y="0" scale="270" floor="true"/>
<image x="270" y="0" scale="90"/> <image x="270" y="0" scale="90"/>
<image x="270" y="90" scale="90"/> <image x="270" y="90" scale="90"/>
<image x="270" y="180" scale="90"/> <image x="270" y="180" scale="90"/>
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
<image x="270" y="270" scale="90"/> <image x="270" y="270" scale="90"/>
</layout> </layout>
<layout name="1up_top_left+9"> <layout name="1up_top_left+9">
<image x="0" y="0" scale="288" floor="true" reservation_id="primary"/> <image x="0" y="0" scale="288" floor="true"/>
<image x="288" y="0" scale="72"/> <image x="288" y="0" scale="72"/>
<image x="288" y="72" scale="72"/> <image x="288" y="72" scale="72"/>
<image x="288" y="144" scale="72"/> <image x="288" y="144" scale="72"/>
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
<image x="288" y="288" scale="72"/> <image x="288" y="288" scale="72"/>
</layout> </layout>
<layout name="2up_top+8"> <layout name="2up_top+8">
<image x="0" y="0" scale="180" floor="true" reservation_id="primary"/> <image x="0" y="0" scale="180" floor="true"/>
<image x="180" y="0" scale="180" reservation_id="secondary"/> <image x="180" y="0" scale="180" reservation_id="secondary"/>
<image x="0" y="180" scale="90"/> <image x="0" y="180" scale="90"/>
<image x="90" y="180" scale="90"/> <image x="90" y="180" scale="90"/>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<image x="270" y="270" scale="90"/> <image x="270" y="270" scale="90"/>
</layout> </layout>
<layout name="2up_middle+8"> <layout name="2up_middle+8">
<image x="0" y="90" scale="180" floor="true" reservation_id="primary"/> <image x="0" y="90" scale="180" floor="true"/>
<image x="180" y="90" scale="180" reservation_id="secondary"/> <image x="180" y="90" scale="180" reservation_id="secondary"/>
<image x="0" y="0" scale="90"/> <image x="0" y="0" scale="90"/>
<image x="90" y="0" scale="90"/> <image x="90" y="0" scale="90"/>
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<image x="270" y="270" scale="90"/> <image x="270" y="270" scale="90"/>
</layout> </layout>
<layout name="2up_bottom+8"> <layout name="2up_bottom+8">
<image x="0" y="180" scale="180" floor="true" reservation_id="primary"/> <image x="0" y="180" scale="180" floor="true"/>
<image x="180" y="180" scale="180" reservation_id="secondary"/> <image x="180" y="180" scale="180" reservation_id="secondary"/>
<image x="0" y="0" scale="90"/> <image x="0" y="0" scale="90"/>
<image x="90" y="0" scale="90"/> <image x="90" y="0" scale="90"/>
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
<image x="270" y="90" scale="90"/> <image x="270" y="90" scale="90"/>
</layout> </layout>
<layout name="3up+4"> <layout name="3up+4">
<image x="0" y="0" scale="180" floor="true" reservation_id="primary"/> <image x="0" y="0" scale="180" floor="true"/>
<image x="180" y="0" scale="180" reservation_id="secondary"/> <image x="180" y="0" scale="180" reservation_id="secondary"/>
<image x="0" y="180" scale="180" reservation_id="third"/> <image x="0" y="180" scale="180" reservation_id="third"/>
<image x="180" y="180" scale="90"/> <image x="180" y="180" scale="90"/>
...@@ -180,7 +180,7 @@ ...@@ -180,7 +180,7 @@
<image x="270" y="270" scale="90"/> <image x="270" y="270" scale="90"/>
</layout> </layout>
<layout name="3up+9"> <layout name="3up+9">
<image x="0" y="0" scale="180" floor="true" reservation_id="primary"/> <image x="0" y="0" scale="180" floor="true"/>
<image x="180" y="0" scale="180" reservation_id="secondary"/> <image x="180" y="0" scale="180" reservation_id="secondary"/>
<image x="0" y="180" scale="180" reservation_id="third"/> <image x="0" y="180" scale="180" reservation_id="third"/>
<image x="180" y="180" scale="60"/> <image x="180" y="180" scale="60"/>
......
...@@ -976,6 +976,27 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit ...@@ -976,6 +976,27 @@ SWITCH_DECLARE(char *) switch_util_quote_shell_arg_pool(const char *string, swit
#define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK || status == SWITCH_STATUS_INUSE) #define SWITCH_READ_ACCEPTABLE(status) (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK || status == SWITCH_STATUS_INUSE)
static inline uint32_t switch_parse_bandwidth_string(const char *bwv)
{
uint32_t bw = 0;
if (!bwv) return 0;
if (bwv && (bw = (uint32_t) atol(bwv))) {
if (bw < 0) return 0;
if (switch_stristr("KB", bwv)) {
bw *= 8;
} else if (switch_stristr("mb", bwv)) {
bw *= 1024;
} else if (switch_stristr("MB", bwv)) {
bw *= 8192;
}
}
return bw;
}
static inline int switch_needs_url_encode(const char *s) static inline int switch_needs_url_encode(const char *s)
{ {
const char hex[] = "0123456789ABCDEF"; const char hex[] = "0123456789ABCDEF";
......
...@@ -2367,23 +2367,12 @@ static void switch_core_session_parse_codec_settings(switch_core_session_t *sess ...@@ -2367,23 +2367,12 @@ static void switch_core_session_parse_codec_settings(switch_core_session_t *sess
case SWITCH_MEDIA_TYPE_VIDEO: case SWITCH_MEDIA_TYPE_VIDEO:
{ {
const char *bwv = switch_channel_get_variable(session->channel, "rtp_video_max_bandwidth"); const char *bwv = switch_channel_get_variable(session->channel, "rtp_video_max_bandwidth");
uint32_t bw = 0;
if (!bwv) { if (!bwv) {
bwv = switch_channel_get_variable(session->channel, "rtp_video_max_bandwidth_out"); bwv = switch_channel_get_variable(session->channel, "rtp_video_max_bandwidth_out");
} }
engine->codec_settings.video.bandwidth = switch_parse_bandwidth_string(bwv);
if (bwv && (bw = (uint32_t) atol(bwv))) {
if (switch_stristr("KB", bwv)) {
bw *= 8;
} else if (switch_stristr("mb", bwv)) {
bw *= 1024;
} else if (switch_stristr("MB", bwv)) {
bw *= 8192;
}
engine->codec_settings.video.bandwidth = bw;
}
} }
break; break;
default: default:
...@@ -7291,26 +7280,12 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess ...@@ -7291,26 +7280,12 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
vbw = switch_channel_get_variable(smh->session->channel, "rtp_video_max_bandwidth_in"); vbw = switch_channel_get_variable(smh->session->channel, "rtp_video_max_bandwidth_in");
} }
bw = switch_parse_bandwidth_string(vbw);
if (vbw) {
int v = atoi(vbw);
bw = v;
if (switch_stristr("KB", vbw)) {
bw *= 8;
} else if (switch_stristr("mb", vbw)) {
bw *= 1024;
} else if (switch_stristr("MB", vbw)) {
bw *= 8192;
}
}
if (bw > 0) { if (bw > 0) {
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=AS:%d\n", bw); switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=AS:%d\n", bw);
//switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=TIAS:%d\n", bw); //switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=TIAS:%d\n", bw);
} }
if (sdp_type == SDP_TYPE_REQUEST) { if (sdp_type == SDP_TYPE_REQUEST) {
fir++; fir++;
......
...@@ -191,8 +191,8 @@ static inline void add_node(switch_vb_t *vb, switch_rtp_packet_t *packet, switch ...@@ -191,8 +191,8 @@ static inline void add_node(switch_vb_t *vb, switch_rtp_packet_t *packet, switch
if (vb->write_init && ((abs(htons(packet->header.seq) - htons(vb->highest_wrote_seq)) > 10) || if (vb->write_init && ((abs(htons(packet->header.seq) - htons(vb->highest_wrote_seq)) > 16) ||
(abs(ntohl(node->packet.header.ts) - ntohl(vb->highest_wrote_ts)) > 270000))) { (abs(ntohl(node->packet.header.ts) - ntohl(vb->highest_wrote_ts)) > 900000))) {
vb_debug(vb, 2, "%s", "CHANGE DETECTED, PUNT\n"); vb_debug(vb, 2, "%s", "CHANGE DETECTED, PUNT\n");
switch_vb_reset(vb); switch_vb_reset(vb);
} }
...@@ -408,11 +408,9 @@ SWITCH_DECLARE(uint32_t) switch_vb_pop_nack(switch_vb_t *vb) ...@@ -408,11 +408,9 @@ SWITCH_DECLARE(uint32_t) switch_vb_pop_nack(switch_vb_t *vb)
nack = (uint32_t) htons(least); nack = (uint32_t) htons(least);
for(i = 0; i < 16; i++) { for(i = 0; i < 16; i++) {
if (switch_core_inthash_delete(vb->missing_seq_hash, (uint32_t)htons(least + i))) { if (switch_core_inthash_delete(vb->missing_seq_hash, (uint32_t)htons(least + i + 1))) {
vb_debug(vb, 3, "Found addtl NACKABLE seq %u\n", least + i + 1); vb_debug(vb, 3, "Found addtl NACKABLE seq %u\n", least + i + 1);
blp |= (1 << i); blp |= (1 << i);
} else {
break;
} }
} }
...@@ -443,18 +441,17 @@ SWITCH_DECLARE(switch_status_t) switch_vb_put_packet(switch_vb_t *vb, switch_rtp ...@@ -443,18 +441,17 @@ SWITCH_DECLARE(switch_status_t) switch_vb_put_packet(switch_vb_t *vb, switch_rtp
if (!want) want = got; if (!want) want = got;
if (got > want) { if (got > want) {
vb_debug(vb, 2, "GOT %u WANTED %u; MARK SEQS MISSING %u - %u\n", got, want, want, got - 1);
for (i = want; i < got; i++) { for (i = want; i < got; i++) {
vb_debug(vb, 2, "MARK SEQ MISSING %u\n", i);
switch_core_inthash_insert(vb->missing_seq_hash, (uint32_t)htons(i), (void *)SWITCH_TRUE); switch_core_inthash_insert(vb->missing_seq_hash, (uint32_t)htons(i), (void *)SWITCH_TRUE);
} }
} else { } else {
if (switch_core_inthash_delete(vb->missing_seq_hash, (uint32_t)htons(got))) { switch_core_inthash_delete(vb->missing_seq_hash, (uint32_t)htons(got));
vb_debug(vb, 2, "MARK SEQ FOUND %u\n", got);
}
} }
if (got >= want) { if (got >= want) {
vb->next_seq = htons(ntohs(packet->header.seq) + 1); vb->next_seq = htons(got + 1);
} }
add_node(vb, packet, len); add_node(vb, packet, len);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论