Unified · Split
| @@ -15,6 +15,11 @@ libavutil: 2015-08-28 · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | API changes, most recent first: | 16 | API changes, most recent first: |
| 17 | 17 | ||
| 18 | 2017-xx-xx - xxxxxxx - lavu 55.76.100 / 56.6.0 - pixdesc.h | ||
| 19 | Add av_color_range_from_name(), av_color_primaries_from_name(), | ||
| 20 | av_color_transfer_from_name(), av_color_space_from_name(), and | ||
| 21 | av_chroma_location_from_name(). | ||
| 22 | |||
| 18 | 2017-09-13 - xxxxxxx - lavc 57.106.100 - avcodec.h | 23 | 2017-09-13 - xxxxxxx - lavc 57.106.100 - avcodec.h |
| 19 | Add AV_PKT_FLAG_TRUSTED. | 24 | Add AV_PKT_FLAG_TRUSTED. |
| 20 | 25 | ||
| @@ -2749,26 +2749,91 @@ const char *av_color_range_name(enum AVColorRange range) · 2748 unmodified lines | |||
| 2749 | color_range_names[range] : NULL; | 2749 | color_range_names[range] : NULL; |
| 2750 | } | 2750 | } |
| 2751 | 2751 | ||
| 2752 | int av_color_range_from_name(const char *name) | ||
| 2753 | { | ||
| 2754 | int i; | ||
| 2755 | |||
| 2756 | for (i = 0; i < FF_ARRAY_ELEMS(color_range_names); i++) { | ||
| 2757 | size_t len = strlen(color_range_names[i]); | ||
| 2758 | if (!strncmp(color_range_names[i], name, len)) | ||
| 2759 | return i; | ||
| 2760 | } | ||
| 2761 | |||
| 2762 | return AVERROR(EINVAL); | ||
| 2763 | } | ||
| 2764 | |||
| 2752 | const char *av_color_primaries_name(enum AVColorPrimaries primaries) | 2765 | const char *av_color_primaries_name(enum AVColorPrimaries primaries) |
| 2753 | { | 2766 | { |
| 2754 | return (unsigned) primaries < AVCOL_PRI_NB ? | 2767 | return (unsigned) primaries < AVCOL_PRI_NB ? |
| 2755 | color_primaries_names[primaries] : NULL; | 2768 | color_primaries_names[primaries] : NULL; |
| 2756 | } | 2769 | } |
| 2757 | 2770 | ||
| 2771 | int av_color_primaries_from_name(const char *name) | ||
| 2772 | { | ||
| 2773 | int i; | ||
| 2774 | |||
| 2775 | for (i = 0; i < FF_ARRAY_ELEMS(color_primaries_names); i++) { | ||
| 2776 | size_t len = strlen(color_primaries_names[i]); | ||
| 2777 | if (!strncmp(color_primaries_names[i], name, len)) | ||
| 2778 | return i; | ||
| 2779 | } | ||
| 2780 | |||
| 2781 | return AVERROR(EINVAL); | ||
| 2782 | } | ||
| 2783 | |||
| 2758 | const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer) | 2784 | const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer) |
| 2759 | { | 2785 | { |
| 2760 | return (unsigned) transfer < AVCOL_TRC_NB ? | 2786 | return (unsigned) transfer < AVCOL_TRC_NB ? |
| 2761 | color_transfer_names[transfer] : NULL; | 2787 | color_transfer_names[transfer] : NULL; |
| 2762 | } | 2788 | } |
| 2763 | 2789 | ||
| 2790 | int av_color_transfer_from_name(const char *name) | ||
| 2791 | { | ||
| 2792 | int i; | ||
| 2793 | |||
| 2794 | for (i = 0; i < FF_ARRAY_ELEMS(color_transfer_names); i++) { | ||
| 2795 | size_t len = strlen(color_transfer_names[i]); | ||
| 2796 | if (!strncmp(color_transfer_names[i], name, len)) | ||
| 2797 | return i; | ||
| 2798 | } | ||
| 2799 | |||
| 2800 | return AVERROR(EINVAL); | ||
| 2801 | } | ||
| 2802 | |||
| 2764 | const char *av_color_space_name(enum AVColorSpace space) | 2803 | const char *av_color_space_name(enum AVColorSpace space) |
| 2765 | { | 2804 | { |
| 2766 | return (unsigned) space < AVCOL_SPC_NB ? | 2805 | return (unsigned) space < AVCOL_SPC_NB ? |
| 2767 | color_space_names[space] : NULL; | 2806 | color_space_names[space] : NULL; |
| 2768 | } | 2807 | } |
| 2769 | 2808 | ||
| 2809 | int av_color_space_from_name(const char *name) | ||
| 2810 | { | ||
| 2811 | int i; | ||
| 2812 | |||
| 2813 | for (i = 0; i < FF_ARRAY_ELEMS(color_space_names); i++) { | ||
| 2814 | size_t len = strlen(color_space_names[i]); | ||
| 2815 | if (!strncmp(color_space_names[i], name, len)) | ||
| 2816 | return i; | ||
| 2817 | } | ||
| 2818 | |||
| 2819 | return AVERROR(EINVAL); | ||
| 2820 | } | ||
| 2821 | |||
| 2770 | const char *av_chroma_location_name(enum AVChromaLocation location) | 2822 | const char *av_chroma_location_name(enum AVChromaLocation location) |
| 2771 | { | 2823 | { |
| 2772 | return (unsigned) location < AVCHROMA_LOC_NB ? | 2824 | return (unsigned) location < AVCHROMA_LOC_NB ? |
| 2773 | chroma_location_names[location] : NULL; | 2825 | chroma_location_names[location] : NULL; |
| 2774 | } | 2826 | } |
| 2827 | |||
| 2828 | int av_chroma_location_from_name(const char *name) | ||
| 2829 | { | ||
| 2830 | int i; | ||
| 2831 | |||
| 2832 | for (i = 0; i < FF_ARRAY_ELEMS(chroma_location_names); i++) { | ||
| 2833 | size_t len = strlen(chroma_location_names[i]); | ||
| 2834 | if (!strncmp(chroma_location_names[i], name, len)) | ||
| 2835 | return i; | ||
| 2836 | } | ||
| 2837 | |||
| 2838 | return AVERROR(EINVAL); | ||
| 2839 | } | ||
| @@ -250,26 +250,51 @@ int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt); · 249 unmodified lines | |||
| 250 | */ | 250 | */ |
| 251 | const char *av_color_range_name(enum AVColorRange range); | 251 | const char *av_color_range_name(enum AVColorRange range); |
| 252 | 252 | ||
| 253 | /** | ||
| 254 | * @return the AVColorRange value for name or an AVError if not found. | ||
| 255 | */ | ||
| 256 | int av_color_range_from_name(const char *name); | ||
| 257 | |||
| 253 | /** | 258 | /** |
| 254 | * @return the name for provided color primaries or NULL if unknown. | 259 | * @return the name for provided color primaries or NULL if unknown. |
| 255 | */ | 260 | */ |
| 256 | const char *av_color_primaries_name(enum AVColorPrimaries primaries); | 261 | const char *av_color_primaries_name(enum AVColorPrimaries primaries); |
| 257 | 262 | ||
| 263 | /** | ||
| 264 | * @return the AVColorPrimaries value for name or an AVError if not found. | ||
| 265 | */ | ||
| 266 | int av_color_primaries_from_name(const char *name); | ||
| 267 | |||
| 258 | /** | 268 | /** |
| 259 | * @return the name for provided color transfer or NULL if unknown. | 269 | * @return the name for provided color transfer or NULL if unknown. |
| 260 | */ | 270 | */ |
| 261 | const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer); | 271 | const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer); |
| 262 | 272 | ||
| 273 | /** | ||
| 274 | * @return the AVColorTransferCharacteristic value for name or an AVError if not found. | ||
| 275 | */ | ||
| 276 | int av_color_transfer_from_name(const char *name); | ||
| 277 | |||
| 263 | /** | 278 | /** |
| 264 | * @return the name for provided color space or NULL if unknown. | 279 | * @return the name for provided color space or NULL if unknown. |
| 265 | */ | 280 | */ |
| 266 | const char *av_color_space_name(enum AVColorSpace space); | 281 | const char *av_color_space_name(enum AVColorSpace space); |
| 267 | 282 | ||
| 283 | /** | ||
| 284 | * @return the AVColorSpace value for name or an AVError if not found. | ||
| 285 | */ | ||
| 286 | int av_color_space_from_name(const char *name); | ||
| 287 | |||
| 268 | /** | 288 | /** |
| 269 | * @return the name for provided chroma location or NULL if unknown. | 289 | * @return the name for provided chroma location or NULL if unknown. |
| 270 | */ | 290 | */ |
| 271 | const char *av_chroma_location_name(enum AVChromaLocation location); | 291 | const char *av_chroma_location_name(enum AVChromaLocation location); |
| 272 | 292 | ||
| 293 | /** | ||
| 294 | * @return the AVChromaLocation value for name or an AVError if not found. | ||
| 295 | */ | ||
| 296 | int av_chroma_location_from_name(const char *name); | ||
| 297 | |||
| 273 | /** | 298 | /** |
| 274 | * Return the pixel format corresponding to name. | 299 | * Return the pixel format corresponding to name. |
| 275 | * | 300 | * |
| @@ -80,7 +80,7 @@ · 79 unmodified lines | |||
| 80 | 80 | ||
| 81 | 81 | ||
| 82 | #define LIBAVUTIL_VERSION_MAJOR 55 | 82 | #define LIBAVUTIL_VERSION_MAJOR 55 |
| 83 | #define LIBAVUTIL_VERSION_MINOR 75 | 83 | #define LIBAVUTIL_VERSION_MINOR 76 |
| 84 | #define LIBAVUTIL_VERSION_MICRO 100 | 84 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 85 | 85 | ||
| 86 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 86 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |