misc/winutils/include/libavutil/pixdesc.h
author unc0rr
Thu, 06 Dec 2012 00:38:12 +0400
changeset 8247 d7cf4a9ce685
parent 7813 7ac83d79b897
permissions -rw-r--r--
Command to delegate room to other player
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7813
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     1
/*
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     2
 * pixel format descriptor
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     3
 * Copyright (c) 2009 Michael Niedermayer <michaelni@gmx.at>
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     4
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     5
 * This file is part of Libav.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     6
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     7
 * Libav is free software; you can redistribute it and/or
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     8
 * modify it under the terms of the GNU Lesser General Public
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
     9
 * License as published by the Free Software Foundation; either
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    10
 * version 2.1 of the License, or (at your option) any later version.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    11
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    12
 * Libav is distributed in the hope that it will be useful,
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    15
 * Lesser General Public License for more details.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    16
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    17
 * You should have received a copy of the GNU Lesser General Public
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    18
 * License along with Libav; if not, write to the Free Software
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    20
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    21
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    22
#ifndef AVUTIL_PIXDESC_H
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    23
#define AVUTIL_PIXDESC_H
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    24
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    25
#include <inttypes.h>
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    26
#include "pixfmt.h"
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    27
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    28
typedef struct AVComponentDescriptor{
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    29
    uint16_t plane        :2;            ///< which of the 4 planes contains the component
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    30
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    31
    /**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    32
     * Number of elements between 2 horizontally consecutive pixels minus 1.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    33
     * Elements are bits for bitstream formats, bytes otherwise.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    34
     */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    35
    uint16_t step_minus1  :3;
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    36
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    37
    /**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    38
     * Number of elements before the component of the first pixel plus 1.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    39
     * Elements are bits for bitstream formats, bytes otherwise.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    40
     */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    41
    uint16_t offset_plus1 :3;
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    42
    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    43
    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    44
}AVComponentDescriptor;
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    45
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    46
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    47
 * Descriptor that unambiguously describes how the bits of a pixel are
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    48
 * stored in the up to 4 data planes of an image. It also stores the
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    49
 * subsampling factors and number of components.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    50
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    51
 * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    52
 *       and all the YUV variants) AVPixFmtDescriptor just stores how values
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    53
 *       are stored not what these values represent.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    54
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    55
typedef struct AVPixFmtDescriptor{
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    56
    const char *name;
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    57
    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    58
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    59
    /**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    60
     * Amount to shift the luma width right to find the chroma width.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    61
     * For YV12 this is 1 for example.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    62
     * chroma_width = -((-luma_width) >> log2_chroma_w)
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    63
     * The note above is needed to ensure rounding up.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    64
     * This value only refers to the chroma components.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    65
     */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    66
    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    67
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    68
    /**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    69
     * Amount to shift the luma height right to find the chroma height.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    70
     * For YV12 this is 1 for example.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    71
     * chroma_height= -((-luma_height) >> log2_chroma_h)
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    72
     * The note above is needed to ensure rounding up.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    73
     * This value only refers to the chroma components.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    74
     */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    75
    uint8_t log2_chroma_h;
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    76
    uint8_t flags;
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    77
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    78
    /**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    79
     * Parameters that describe how pixels are packed. If the format
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    80
     * has chroma components, they must be stored in comp[1] and
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    81
     * comp[2].
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    82
     */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    83
    AVComponentDescriptor comp[4];
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    84
}AVPixFmtDescriptor;
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    85
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    86
#define PIX_FMT_BE        1 ///< Pixel format is big-endian.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    87
#define PIX_FMT_PAL       2 ///< Pixel format has a palette in data[1], values are indexes in this palette.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    88
#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    89
#define PIX_FMT_HWACCEL   8 ///< Pixel format is an HW accelerated format.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    90
#define PIX_FMT_PLANAR   16 ///< At least one pixel component is not in the first data plane
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    91
#define PIX_FMT_RGB      32 ///< The pixel format contains RGB-like data (as opposed to YUV/grayscale)
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    92
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    93
 * The pixel format is "pseudo-paletted". This means that Libav treats it as
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    94
 * paletted internally, but the palette is generated by the decoder and is not
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    95
 * stored in the file.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    96
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    97
#define PIX_FMT_PSEUDOPAL 64
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    98
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
    99
#if FF_API_PIX_FMT_DESC
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   100
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   101
 * The array of all the pixel format descriptors.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   102
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   103
extern const AVPixFmtDescriptor av_pix_fmt_descriptors[];
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   104
#endif
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   105
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   106
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   107
 * Read a line from an image, and write the values of the
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   108
 * pixel format component c to dst.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   109
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   110
 * @param data the array containing the pointers to the planes of the image
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   111
 * @param linesize the array containing the linesizes of the image
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   112
 * @param desc the pixel format descriptor for the image
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   113
 * @param x the horizontal coordinate of the first pixel to read
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   114
 * @param y the vertical coordinate of the first pixel to read
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   115
 * @param w the width of the line to read, that is the number of
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   116
 * values to write to dst
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   117
 * @param read_pal_component if not zero and the format is a paletted
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   118
 * format writes the values corresponding to the palette
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   119
 * component c in data[1] to dst, rather than the palette indexes in
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   120
 * data[0]. The behavior is undefined if the format is not paletted.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   121
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   122
void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   123
                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   124
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   125
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   126
 * Write the values from src to the pixel format component c of an
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   127
 * image line.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   128
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   129
 * @param src array containing the values to write
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   130
 * @param data the array containing the pointers to the planes of the
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   131
 * image to write into. It is supposed to be zeroed.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   132
 * @param linesize the array containing the linesizes of the image
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   133
 * @param desc the pixel format descriptor for the image
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   134
 * @param x the horizontal coordinate of the first pixel to write
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   135
 * @param y the vertical coordinate of the first pixel to write
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   136
 * @param w the width of the line to write, that is the number of
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   137
 * values to write to the image line
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   138
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   139
void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   140
                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   141
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   142
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   143
 * Return the pixel format corresponding to name.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   144
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   145
 * If there is no pixel format with name name, then looks for a
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   146
 * pixel format with the name corresponding to the native endian
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   147
 * format of name.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   148
 * For example in a little-endian system, first looks for "gray16",
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   149
 * then for "gray16le".
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   150
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   151
 * Finally if no pixel format has been found, returns PIX_FMT_NONE.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   152
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   153
enum AVPixelFormat av_get_pix_fmt(const char *name);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   154
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   155
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   156
 * Return the short name for a pixel format, NULL in case pix_fmt is
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   157
 * unknown.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   158
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   159
 * @see av_get_pix_fmt(), av_get_pix_fmt_string()
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   160
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   161
const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   162
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   163
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   164
 * Print in buf the string corresponding to the pixel format with
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   165
 * number pix_fmt, or an header if pix_fmt is negative.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   166
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   167
 * @param buf the buffer where to write the string
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   168
 * @param buf_size the size of buf
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   169
 * @param pix_fmt the number of the pixel format to print the
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   170
 * corresponding info string, or a negative value to print the
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   171
 * corresponding header.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   172
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   173
char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   174
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   175
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   176
 * Return the number of bits per pixel used by the pixel format
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   177
 * described by pixdesc.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   178
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   179
 * The returned number of bits refers to the number of bits actually
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   180
 * used for storing the pixel information, that is padding bits are
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   181
 * not counted.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   182
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   183
int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   184
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   185
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   186
 * @return a pixel format descriptor for provided pixel format or NULL if
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   187
 * this pixel format is unknown.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   188
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   189
const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   190
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   191
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   192
 * Iterate over all pixel format descriptors known to libavutil.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   193
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   194
 * @param prev previous descriptor. NULL to get the first descriptor.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   195
 *
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   196
 * @return next descriptor or NULL after the last descriptor
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   197
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   198
const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   199
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   200
/**
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   201
 * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   202
 * is not a valid pointer to a pixel format descriptor.
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   203
 */
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   204
enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   205
7ac83d79b897 support video recording on windows with automation and headers
koda
parents:
diff changeset
   206
#endif /* AVUTIL_PIXDESC_H */