Originally committed as revision 18758 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -24,6 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | #include <string.h> |
| 26 | 26 | #include "libavutil/avutil.h" |
| 27 | +#include "libavutil/random_seed.h" | |
| 27 | 28 | #include "parseutils.h" |
| 28 | 29 | |
| 29 | 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 | 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 | 227 | if (!strncmp(color_string, "0x", 2)) { |
| 220 | 228 | char *tail; |
| 221 | 229 | int len = strlen(color_string); |
| @@ -295,6 +303,7 @@ int main(void) · 73 unmodified lines | ||
| 295 | 303 | { |
| 296 | 304 | uint8_t rgba[4]; |
| 297 | 305 | const char *color_names[] = { |
| 306 | + "bikeshed", | |
| 298 | 307 | "foo", |
| 299 | 308 | "red", |
| 300 | 309 | "Red ", |