svq3: Use a separate buffer for decoding the slices
[libav.git] / libavutil / hwcontext_internal.h
CommitLineData
89923e41
AK
1/*
2 * This file is part of Libav.
3 *
4 * Libav 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.
8 *
9 * Libav 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.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with Libav; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef AVUTIL_HWCONTEXT_INTERNAL_H
20#define AVUTIL_HWCONTEXT_INTERNAL_H
21
22#include <stddef.h>
23
24#include "buffer.h"
25#include "hwcontext.h"
26#include "frame.h"
27#include "pixfmt.h"
28
29typedef struct HWContextType {
30 enum AVHWDeviceType type;
31 const char *name;
32
33 /**
34 * An array of pixel formats supported by the AVHWFramesContext instances
35 * Terminated by AV_PIX_FMT_NONE.
36 */
37 const enum AVPixelFormat *pix_fmts;
38
39 /**
40 * size of the public hardware-specific context,
41 * i.e. AVHWDeviceContext.hwctx
42 */
43 size_t device_hwctx_size;
44 /**
45 * size of the private data, i.e.
46 * AVHWDeviceInternal.priv
47 */
48 size_t device_priv_size;
49
50 /**
51 * size of the public frame pool hardware-specific context,
52 * i.e. AVHWFramesContext.hwctx
53 */
54 size_t frames_hwctx_size;
55 /**
56 * size of the private data, i.e.
57 * AVHWFramesInternal.priv
58 */
59 size_t frames_priv_size;
60
61 int (*device_init)(AVHWDeviceContext *ctx);
62 void (*device_uninit)(AVHWDeviceContext *ctx);
63
64 int (*frames_init)(AVHWFramesContext *ctx);
65 void (*frames_uninit)(AVHWFramesContext *ctx);
66
67 int (*frames_get_buffer)(AVHWFramesContext *ctx, AVFrame *frame);
68 int (*transfer_get_formats)(AVHWFramesContext *ctx,
69 enum AVHWFrameTransferDirection dir,
70 enum AVPixelFormat **formats);
71 int (*transfer_data_to)(AVHWFramesContext *ctx, AVFrame *dst,
72 const AVFrame *src);
73 int (*transfer_data_from)(AVHWFramesContext *ctx, AVFrame *dst,
74 const AVFrame *src);
75} HWContextType;
76
77struct AVHWDeviceInternal {
78 const HWContextType *hw_type;
79 void *priv;
80};
81
82struct AVHWFramesInternal {
83 const HWContextType *hw_type;
84 void *priv;
85
86 AVBufferPool *pool_internal;
87};
88
ad884d10 89extern const HWContextType ff_hwcontext_type_cuda;
a001ce31
AK
90extern const HWContextType ff_hwcontext_type_vdpau;
91
89923e41 92#endif /* AVUTIL_HWCONTEXT_INTERNAL_H */