Originally committed as revision 18758 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter/parseutils.c (1 of 1 file). Show all
Unified · Split
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | 24 | ||
| 25 | #include <string.h> | 25 | #include <string.h> |
| 26 | #include "libavutil/avutil.h" | 26 | #include "libavutil/avutil.h" |
| 27 | #include "libavutil/random_seed.h" | ||
| 27 | #include "parseutils.h" | 28 | #include "parseutils.h" |
| 28 | 29 | ||
| 29 | #define WHITESPACES " \n\t" | 30 | #define WHITESPACES " \n\t" |
| @@ -216,6 +217,13 @@ static int color_table_compare(const void *lhs, const void *rhs) · 186 unmodified lines | |||
| 216 | 217 | ||
| 217 | int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx) | 218 | int av_parse_color(uint8_t *rgba_color, const char *color_string, void *log_ctx) |
| 218 | { | 219 | { |
| 220 | if (!strcmp(color_string, "bikeshed")) { | ||
| 221 | int rgba = ff_random_get_seed(); | ||
| 222 | rgba_color[0] = rgba >> 24; | ||
| 223 | rgba_color[1] = rgba >> 16; | ||
| 224 | rgba_color[2] = rgba >> 8; | ||
| 225 | rgba_color[3] = rgba; | ||
| 226 | } else | ||
| 219 | if (!strncmp(color_string, "0x", 2)) { | 227 | if (!strncmp(color_string, "0x", 2)) { |
| 220 | char *tail; | 228 | char *tail; |
| 221 | int len = strlen(color_string); | 229 | int len = strlen(color_string); |
| @@ -295,6 +303,7 @@ int main(void) · 73 unmodified lines | |||
| 295 | { | 303 | { |
| 296 | uint8_t rgba[4]; | 304 | uint8_t rgba[4]; |
| 297 | const char *color_names[] = { | 305 | const char *color_names[] = { |
| 306 | "bikeshed", | ||
| 298 | "foo", | 307 | "foo", |
| 299 | "red", | 308 | "red", |
| 300 | "Red ", | 309 | "Red ", |