2 * copyright (c) 2001 Fabrice Bellard
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVFORMAT_RAWUTILS_H
22 #define AVFORMAT_RAWUTILS_H
25 #include "libavcodec/codec_par.h"
26 #include "libavcodec/packet.h"
29 #define CONTAINS_PAL 2
31 * Reshuffles the lines to use the user specified stride.
33 * @param ppkt input and output packet
34 * @return negative error code or
35 * 0 if no new packet was allocated
36 * non-zero if a new packet was allocated and ppkt has to be freed
37 * CONTAINS_PAL if in addition to a new packet the old contained a palette
39 int ff_reshuffle_raw_rgb(AVFormatContext
*s
, AVPacket
**ppkt
, AVCodecParameters
*par
, int expected_stride
);
42 * Retrieves the palette from a packet, either from side data, or
43 * appended to the video data in the packet itself (raw video only).
44 * It is commonly used after a call to ff_reshuffle_raw_rgb().
46 * Use 0 for the ret parameter to check for side data only.
48 * @param pkt pointer to packet before calling ff_reshuffle_raw_rgb()
49 * @param ret return value from ff_reshuffle_raw_rgb(), or 0
50 * @param palette pointer to palette buffer
51 * @return negative error code or
52 * 1 if the packet has a palette, else 0
54 int ff_get_packet_palette(AVFormatContext
*s
, AVPacket
*pkt
, int ret
, uint32_t *palette
);
56 #endif /* AVFORMAT_RAWUTILS_H */