freeswitch: bump to 1.10.7
[feed/telephony.git] / net / freeswitch / patches / 480-fix-libyuv-dependency.patch
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);
10
11 @@ -405,6 +406,7 @@ SWITCH_DECLARE(switch_image_t *) switch_
12 * \param[in] quality Only used in jpg, 1 ~ 100
13 */
14 SWITCH_DECLARE(switch_status_t) switch_img_write_to_file(switch_image_t *img, const char* file_name, int quality);
15 +#endif
16
17 /*!\brief put a small img over a big IMG at position x,y, with alpha transparency
18 *
19 --- a/src/switch_core_video.c
20 +++ b/src/switch_core_video.c
21 @@ -48,13 +48,13 @@
22 #include <gd.h>
23 #endif
24
25 +#ifdef SWITCH_HAVE_YUV
26 #define STB_IMAGE_IMPLEMENTATION
27 #include "../libs/stb/stb_image.h"
28
29 #define STB_IMAGE_WRITE_IMPLEMENTATION
30 #include "../libs/stb/stb_image_write.h"
31
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);
34 #endif
35
36 @@ -3114,6 +3114,7 @@ SWITCH_DECLARE(switch_status_t) switch_i
37
38 #endif
39
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)
42 {
43 int width = 0, height = 0, channels = 0;
44 @@ -3301,7 +3302,7 @@ SWITCH_DECLARE(switch_status_t) switch_i
45
46 return ret ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
47 }
48 -
49 +#endif /* SWITCH_HAVE_YUV */
50
51 SWITCH_DECLARE(switch_status_t) switch_img_letterbox(switch_image_t *img, switch_image_t **imgP, int width, int height, const char *color)
52 {
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")
56 }
57 FST_TEARDOWN_END()
58
59 +#ifdef SWITCH_HAVE_YUV
60 FST_TEST_BEGIN(data_url_test)
61 {
62 char *data_url = NULL;
63 @@ -88,6 +89,7 @@ FST_CORE_BEGIN("./conf")
64 unlink(argb_filename);
65 }
66 FST_TEST_END()
67 +#endif /* SWITCH_HAVE_YUV */
68
69 FST_TEST_BEGIN(img_patch)
70 {
71 @@ -239,6 +241,7 @@ FST_CORE_BEGIN("./conf")
72 }
73 FST_TEST_END()
74
75 +#ifdef SWITCH_HAVE_YUV
76 FST_TEST_BEGIN(stb_data_url)
77 {
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);
81 }
82 FST_TEST_END()
83 +#endif /* SWITCH_HAVE_YUV */
84 }
85 FST_SUITE_END()
86 }