Originally committed as revision 18828 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -217,7 +217,7 @@ static int color_table_compare(const void *lhs, const void *rhs) · 216 unmodified lines | |||
| 217 | 217 | ||
| 218 | 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) |
| 219 | { | 219 | { |
| 220 | if (!strcasecmp(color_string, "bikeshed")) { | 220 | if (!strcasecmp(color_string, "random") || !strcasecmp(color_string, "bikeshed")) { |
| 221 | int rgba = ff_random_get_seed(); | 221 | int rgba = ff_random_get_seed(); |
| 222 | rgba_color[0] = rgba >> 24; | 222 | rgba_color[0] = rgba >> 24; |
| 223 | rgba_color[1] = rgba >> 16; | 223 | rgba_color[1] = rgba >> 16; |
| @@ -304,6 +304,7 @@ int main(void) · 80 unmodified lines | |||
| 304 | uint8_t rgba[4]; | 304 | uint8_t rgba[4]; |
| 305 | const char *color_names[] = { | 305 | const char *color_names[] = { |
| 306 | "bikeshed", | 306 | "bikeshed", |
| 307 | "RaNdOm", | ||
| 307 | "foo", | 308 | "foo", |
| 308 | "red", | 309 | "red", |
| 309 | "Red ", | 310 | "Red ", |
| @@ -45,6 +45,7 @@ char *av_get_token(const char **buf, const char *term); · 44 unmodified lines | |||
| 45 | * | 45 | * |
| 46 | * @param color_string a string specifying a color. It can be the name of | 46 | * @param color_string a string specifying a color. It can be the name of |
| 47 | * a color (case insensitive match) or a 0xRRGGBB[AA] sequence. | 47 | * a color (case insensitive match) or a 0xRRGGBB[AA] sequence. |
| 48 | * The string "random" will result in a random color. | ||
| 48 | * @return >= 0 in case of success, a negative value in case of | 49 | * @return >= 0 in case of success, a negative value in case of |
| 49 | * failure (for example if color_string cannot be parsed). | 50 | * failure (for example if color_string cannot be parsed). |
| 50 | */ | 51 | */ |