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

FS-7515: update cv to use new alpha supported switch_image_t

上级 cc27c51e
......@@ -46,6 +46,23 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_URL_UNSAFE "\r\n #%&+:;<=>?@[\\]^`{|}\""
static inline uint32_t switch_round_to_step(uint32_t num, uint32_t step)
{
uint32_t r;
uint32_t x;
if (!num) return 0;
r = (num % step);
x = num - r;
if (r > step / 2) {
x += step;
}
return x;
}
/* https://code.google.com/p/stringencoders/wiki/PerformanceAscii
http://www.azillionmonkeys.com/qed/asmexample.html
*/
......
......@@ -312,22 +312,6 @@ static void _switch_core_media_pass_zrtp_hash2(switch_core_session_t *aleg_sessi
}
}
static uint32_t round_to_step(uint32_t num, uint32_t step)
{
uint32_t r;
uint32_t x;
if (!num) return 0;
r = (num % step);
x = num - r;
if (r > step / 2) {
x += step;
}
return x;
}
SWITCH_DECLARE(uint32_t) switch_core_media_get_video_fps(switch_core_session_t *session)
{
switch_media_handle_t *smh;
......@@ -349,7 +333,7 @@ SWITCH_DECLARE(uint32_t) switch_core_media_get_video_fps(switch_core_session_t *
return 0;
}
return round_to_step(smh->vid_frames / (now - smh->vid_started), 5);
return switch_round_to_step(smh->vid_frames / (now - smh->vid_started), 5);
}
SWITCH_DECLARE(void) switch_core_media_pass_zrtp_hash2(switch_core_session_t *aleg_session, switch_core_session_t *bleg_session)
......@@ -10546,7 +10530,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_video_frame(switch_core
}
}
if (bp->ready && switch_test_flag(bp, SMBF_READ_VIDEO_PING)) {
if (bp->ready && (*frame)->img && switch_test_flag(bp, SMBF_READ_VIDEO_PING)) {
bp->ping_frame = *frame;
if (bp->callback) {
if (bp->callback(bp, bp->user_data, SWITCH_ABC_TYPE_READ_VIDEO_PING) == SWITCH_FALSE
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论