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
19 #ifndef AVCODEC_VT_INTERNAL_H
20 #define AVCODEC_VT_INTERNAL_H
23 #include "videotoolbox.h"
25 typedef struct VTContext
{
26 // The current bitstream buffer.
29 // The current size of the bitstream.
32 // The reference size used for fast reallocation.
35 // The core video buffer
36 CVImageBufferRef frame
;
38 // Current dummy frames context (depends on exact CVImageBufferRef params).
39 struct AVBufferRef
*cached_hw_frames_ctx
;
41 // Non-NULL if the new hwaccel API is used. This is only a separate struct
42 // to ease compatibility with the old API.
43 struct AVVideotoolboxContext
*vt_ctx
;
45 // Current H264 parameters (used to trigger decoder restart on SPS changes).
52 int ff_videotoolbox_alloc_frame(AVCodecContext
*avctx
, AVFrame
*frame
);
53 int ff_videotoolbox_common_init(AVCodecContext
*avctx
);
54 int ff_videotoolbox_frame_params(AVCodecContext
*avctx
,
55 AVBufferRef
*hw_frames_ctx
);
56 int ff_videotoolbox_buffer_copy(VTContext
*vtctx
,
57 const uint8_t *buffer
,
59 int ff_videotoolbox_buffer_append(VTContext
*vtctx
,
60 const uint8_t *buffer
,
62 int ff_videotoolbox_uninit(AVCodecContext
*avctx
);
63 int ff_videotoolbox_h264_start_frame(AVCodecContext
*avctx
,
64 const uint8_t *buffer
,
66 int ff_videotoolbox_h264_decode_slice(AVCodecContext
*avctx
,
67 const uint8_t *buffer
,
69 int ff_videotoolbox_common_end_frame(AVCodecContext
*avctx
, AVFrame
*frame
);
70 CFDataRef
ff_videotoolbox_av1c_extradata_create(AVCodecContext
*avctx
);
71 CFDataRef
ff_videotoolbox_avcc_extradata_create(AVCodecContext
*avctx
);
72 CFDataRef
ff_videotoolbox_hvcc_extradata_create(AVCodecContext
*avctx
);
73 CFDataRef
ff_videotoolbox_vpcc_extradata_create(AVCodecContext
*avctx
);
75 #endif /* AVCODEC_VT_INTERNAL_H */