FFmpeg
hwcontext_amf.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 
20 #ifndef AVUTIL_HWCONTEXT_AMF_H
21 #define AVUTIL_HWCONTEXT_AMF_H
22 
23 #include "pixfmt.h"
24 #include "hwcontext.h"
25 #include <AMF/core/Factory.h>
26 #include <AMF/core/Context.h>
27 #include <AMF/core/Trace.h>
28 #include <AMF/core/Debug.h>
29 #include <AMF/components/ColorSpace.h>
31 
32 /**
33  * This struct is allocated as AVHWDeviceContext.hwctx
34  */
35 typedef struct AVAMFDeviceContext {
36  void * library;
37  AMFFactory *factory;
38  void *trace_writer;
39 
40  int64_t version; ///< version of AMF runtime
41  AMFContext *context;
42  AMF_MEMORY_TYPE memory_type;
43 
44  void (*lock)(void *lock_ctx);
45  void (*unlock)(void *lock_ctx);
46  void *lock_ctx;
48 
49 enum AMF_SURFACE_FORMAT av_av_to_amf_format(enum AVPixelFormat fmt);
50 enum AVPixelFormat av_amf_to_av_format(enum AMF_SURFACE_FORMAT fmt);
51 
52 enum AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM av_amf_get_color_profile(enum AVColorRange color_range, enum AVColorSpace color_space);
53 int av_amf_display_mastering_meta_to_hdrmeta(const AVMasteringDisplayMetadata *display_meta, AMFHDRMetadata *hdrmeta);
54 int av_amf_light_metadata_to_hdrmeta(const AVContentLightMetadata *light_meta, AMFHDRMetadata *hdrmeta);
55 int av_amf_extract_hdr_metadata(const AVFrame *frame, AMFHDRMetadata *hdrmeta);
56 int av_amf_attach_hdr_metadata(AVFrame *frame, const AMFHDRMetadata *hdrmeta);
57 
58 #endif /* AVUTIL_HWCONTEXT_AMF_H */
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
int64_t
long long int64_t
Definition: coverity.c:34
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
AVAMFDeviceContext::lock
void(* lock)(void *lock_ctx)
Definition: hwcontext_amf.h:44
av_amf_light_metadata_to_hdrmeta
int av_amf_light_metadata_to_hdrmeta(const AVContentLightMetadata *light_meta, AMFHDRMetadata *hdrmeta)
Definition: hwcontext_amf.c:222
AVContentLightMetadata
Content light level needed by to transmit HDR over HDMI (CTA-861.3).
Definition: mastering_display_metadata.h:107
AVAMFDeviceContext::lock_ctx
void * lock_ctx
Definition: hwcontext_amf.h:46
AVAMFDeviceContext::context
AMFContext * context
Definition: hwcontext_amf.h:41
AVAMFDeviceContext::version
int64_t version
version of AMF runtime
Definition: hwcontext_amf.h:40
color_range
color_range
Definition: vf_selectivecolor.c:43
av_amf_attach_hdr_metadata
int av_amf_attach_hdr_metadata(AVFrame *frame, const AMFHDRMetadata *hdrmeta)
Definition: hwcontext_amf.c:255
AVAMFDeviceContext::trace_writer
void * trace_writer
Definition: hwcontext_amf.h:38
av_av_to_amf_format
enum AMF_SURFACE_FORMAT av_av_to_amf_format(enum AVPixelFormat fmt)
Definition: hwcontext_amf.c:133
AVAMFDeviceContext::library
void * library
Definition: hwcontext_amf.h:36
av_amf_get_color_profile
enum AMF_VIDEO_CONVERTER_COLOR_PROFILE_ENUM av_amf_get_color_profile(enum AVColorRange color_range, enum AVColorSpace color_space)
Definition: hwcontext_amf.c:155
AVAMFDeviceContext
This struct is allocated as AVHWDeviceContext.hwctx.
Definition: hwcontext_amf.h:35
AVAMFDeviceContext::factory
AMFFactory * factory
Definition: hwcontext_amf.h:37
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:700
AVMasteringDisplayMetadata
Mastering display metadata capable of representing the color volume of the display used to master the...
Definition: mastering_display_metadata.h:38
pixfmt.h
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:265
AVAMFDeviceContext::memory_type
AMF_MEMORY_TYPE memory_type
Definition: hwcontext_amf.h:42
AVAMFDeviceContext::unlock
void(* unlock)(void *lock_ctx)
Definition: hwcontext_amf.h:45
av_amf_to_av_format
enum AVPixelFormat av_amf_to_av_format(enum AMF_SURFACE_FORMAT fmt)
Definition: hwcontext_amf.c:144
mastering_display_metadata.h
hwcontext.h
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:742
av_amf_display_mastering_meta_to_hdrmeta
int av_amf_display_mastering_meta_to_hdrmeta(const AVMasteringDisplayMetadata *display_meta, AMFHDRMetadata *hdrmeta)
Definition: hwcontext_amf.c:186
av_amf_extract_hdr_metadata
int av_amf_extract_hdr_metadata(const AVFrame *frame, AMFHDRMetadata *hdrmeta)
Definition: hwcontext_amf.c:233