2 * This file is part of FFmpeg.
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 * common internal api header.
24 #ifndef AVCODEC_INTERNAL_H
25 #define AVCODEC_INTERNAL_H
29 #include "libavutil/pixfmt.h"
32 typedef struct InternalBuffer {
33 uint8_t *base[AV_NUM_DATA_POINTERS];
34 uint8_t *data[AV_NUM_DATA_POINTERS];
35 int linesize[AV_NUM_DATA_POINTERS];
38 enum PixelFormat pix_fmt;
39 uint8_t **extended_data;
44 typedef struct AVCodecInternal {
46 * internal buffer count
47 * used by default get/release/reget_buffer().
53 * used by default get/release/reget_buffer().
55 InternalBuffer *buffer;
58 * Whether the parent AVCodecContext is a copy of the context which had
59 * init() called on it.
60 * This is used by multithreading - shared tables and picture pointers
61 * should be freed from the original context only.
66 struct AVCodecDefault {
72 * Determine whether pix_fmt is a hardware accelerated format.
74 int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt);
77 * Return the hardware accelerated codec for codec codec_id and
78 * pixel format pix_fmt.
80 * @param codec_id the codec to match
81 * @param pix_fmt the pixel format to match
82 * @return the hardware accelerated codec, or NULL if none was found.
84 AVHWAccel *ff_find_hwaccel(enum CodecID codec_id, enum PixelFormat pix_fmt);
87 * Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
88 * If there is no such matching pair then size is returned.
90 int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b);
92 unsigned int avpriv_toupper4(unsigned int x);
95 * does needed setup of pkt_pts/pos and such for (re)get_buffer();
97 void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic);
99 int avpriv_lock_avformat(void);
100 int avpriv_unlock_avformat(void);
102 #endif /* AVCODEC_INTERNAL_H */