]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10050: [core] chromakey
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 4 Mar 2017 01:04:51 +0000 (19:04 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 4 Mar 2017 01:04:51 +0000 (19:04 -0600)
src/switch_core_video.c

index a9645c58021ccc768c90b25496d5c1a52870403f..135b1b3e0cbbf10d56e977be48a4e48f3e926f4d 100644 (file)
@@ -346,6 +346,10 @@ SWITCH_DECLARE(void) switch_img_attenuate(switch_image_t *img)
                return;
        }
 
+       if (img->user_priv) return;
+
+       img->user_priv = (void *)(intptr_t)1;
+
        ARGBAttenuate(img->planes[SWITCH_PLANE_PACKED], img->stride[SWITCH_PLANE_PACKED], 
                                  img->planes[SWITCH_PLANE_PACKED], img->stride[SWITCH_PLANE_PACKED], img->d_w, img->d_h);
 }
@@ -370,10 +374,7 @@ SWITCH_DECLARE(void) switch_img_patch_rgb(switch_image_t *IMG, switch_image_t *i
                int height = MIN(img->d_h, IMG->d_h - abs(y));
                void (*ARGBBlendRow)(const uint8* src_argb, const uint8* src_argb1, uint8* dst_argb, int width) = GetARGBBlend();
 
-               if (!img->user_priv) {
-                       img->user_priv = (void *)(intptr_t)1;
-                       ARGBAttenuate(src_argb0, src_stride_argb0, src_argb0, src_stride_argb0, img->d_w, img->d_h);
-               }
+               switch_img_attenuate(img);
 
                // Coalesce rows. we have same size images, treat as a single row
                if (src_stride_argb0 == width * 4 &&