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 AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H
20 #define AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H
24 #include <VideoToolbox/VideoToolbox.h>
30 * An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX.
32 * This API currently does not support frame allocation, as the raw VideoToolbox
33 * API does allocation, and FFmpeg itself never has the need to allocate frames.
35 * If the API user sets a custom pool, AVHWFramesContext.pool must return
36 * AVBufferRefs whose data pointer is a CVImageBufferRef or CVPixelBufferRef.
38 * Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always
43 * Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat.
44 * Returns AV_PIX_FMT_NONE if no known equivalent was found.
46 enum AVPixelFormat av_map_videotoolbox_format_to_pixfmt(uint32_t cv_fmt);
49 * Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format.
50 * Returns 0 if no known equivalent was found.
52 uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt);
54 #endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */