1 --- a/src/include/switch_core_video.h
2 +++ b/src/include/switch_core_video.h
3 @@ -394,6 +394,7 @@ SWITCH_DECLARE(switch_image_t *) switch_
4 SWITCH_DECLARE(switch_status_t) switch_img_write_png(switch_image_t *img, char *file_name);
5 SWITCH_DECLARE(switch_status_t) switch_png_open(switch_png_t **pngP, const char *file_name);
6 SWITCH_DECLARE(void) switch_png_free(switch_png_t **pngP);
7 +#ifdef SWITCH_HAVE_YUV
8 SWITCH_DECLARE(switch_status_t) switch_img_data_url_png(switch_image_t *img, char **urlP);
9 SWITCH_DECLARE(switch_status_t) switch_img_data_url(switch_image_t *img, char **urlP, const char *type, int quality);
11 @@ -405,6 +406,7 @@ SWITCH_DECLARE(switch_image_t *) switch_
12 * \param[in] quality Only used in jpg, 1 ~ 100
14 SWITCH_DECLARE(switch_status_t) switch_img_write_to_file(switch_image_t *img, const char* file_name, int quality);
17 /*!\brief put a small img over a big IMG at position x,y, with alpha transparency
19 --- a/src/switch_core_video.c
20 +++ b/src/switch_core_video.c
25 +#ifdef SWITCH_HAVE_YUV
26 #define STB_IMAGE_IMPLEMENTATION
27 #include "../libs/stb/stb_image.h"
29 #define STB_IMAGE_WRITE_IMPLEMENTATION
30 #include "../libs/stb/stb_image_write.h"
32 -#ifdef SWITCH_HAVE_YUV
33 static inline void switch_img_get_yuv_pixel(switch_image_t *img, switch_yuv_color_t *yuv, int x, int y);
36 @@ -3114,6 +3114,7 @@ SWITCH_DECLARE(switch_status_t) switch_i
40 +#ifdef SWITCH_HAVE_YUV
41 SWITCH_DECLARE(switch_image_t *) switch_img_read_from_file(const char* file_name, switch_img_fmt_t img_fmt)
43 int width = 0, height = 0, channels = 0;
44 @@ -3301,7 +3302,7 @@ SWITCH_DECLARE(switch_status_t) switch_i
46 return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
49 +#endif /* SWITCH_HAVE_YUV */
51 SWITCH_DECLARE(switch_status_t) switch_img_letterbox(switch_image_t *img, switch_image_t **imgP, int width, int height, const char *color)
53 --- a/tests/unit/switch_core_video.c
54 +++ b/tests/unit/switch_core_video.c
55 @@ -48,6 +48,7 @@ FST_CORE_BEGIN("./conf")
59 +#ifdef SWITCH_HAVE_YUV
60 FST_TEST_BEGIN(data_url_test)
62 char *data_url = NULL;
63 @@ -88,6 +89,7 @@ FST_CORE_BEGIN("./conf")
64 unlink(argb_filename);
67 +#endif /* SWITCH_HAVE_YUV */
69 FST_TEST_BEGIN(img_patch)
71 @@ -239,6 +241,7 @@ FST_CORE_BEGIN("./conf")
75 +#ifdef SWITCH_HAVE_YUV
76 FST_TEST_BEGIN(stb_data_url)
78 switch_image_t *img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, 120, 60, 1);
79 @@ -321,6 +324,7 @@ FST_CORE_BEGIN("./conf")
80 unlink(jpg_write_filename);
83 +#endif /* SWITCH_HAVE_YUV */