提交 c50aac4e authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-10050: [core] chromakey

上级 7b846591
...@@ -901,6 +901,7 @@ struct switch_chromakey_s { ...@@ -901,6 +901,7 @@ struct switch_chromakey_s {
switch_rgb_color_t auto_color; switch_rgb_color_t auto_color;
int no_cache; int no_cache;
int frames_read;
}; };
SWITCH_DECLARE(switch_shade_t) switch_chromakey_str2shade(switch_chromakey_t *ck, const char *shade_name) SWITCH_DECLARE(switch_shade_t) switch_chromakey_str2shade(switch_chromakey_t *ck, const char *shade_name)
...@@ -1122,6 +1123,12 @@ SWITCH_DECLARE(void) switch_chromakey_process(switch_chromakey_t *ck, switch_ima ...@@ -1122,6 +1123,12 @@ SWITCH_DECLARE(void) switch_chromakey_process(switch_chromakey_t *ck, switch_ima
cache_img = ck->cache_img; cache_img = ck->cache_img;
ck->cache_img = NULL; ck->cache_img = NULL;
ck->frames_read++;
if ((ck->frames_read % 300) == 0) {
ck->no_cache = 2;
}
if (cache_img && (cache_img->d_w != img->d_w || cache_img->d_h != img->d_h)) { if (cache_img && (cache_img->d_w != img->d_w || cache_img->d_h != img->d_h)) {
switch_img_free(&cache_img); switch_img_free(&cache_img);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论