int (*device_create)(AVHWDeviceContext *ctx, const char *device,
AVDictionary *opts, int flags);
+ int (*device_derive)(AVHWDeviceContext *dst_ctx,
+ AVHWDeviceContext *src_ctx, int flags);
int (*device_init)(AVHWDeviceContext *ctx);
void (*device_uninit)(AVHWDeviceContext *ctx);
const AVFrame *src, int flags);
int (*map_from)(AVHWFramesContext *ctx, AVFrame *dst,
const AVFrame *src, int flags);
+
+ int (*frames_derive_to)(AVHWFramesContext *dst_ctx,
+ AVHWFramesContext *src_ctx, int flags);
+ int (*frames_derive_from)(AVHWFramesContext *dst_ctx,
+ AVHWFramesContext *src_ctx, int flags);
} HWContextType;
struct AVHWDeviceInternal {
const HWContextType *hw_type;
void *priv;
+
+ /**
+ * For a derived device, a reference to the original device
+ * context it was derived from.
+ */
+ AVBufferRef *source_device;
};
struct AVHWFramesInternal {
* context it was derived from.
*/
AVBufferRef *source_frames;
+ /**
+ * Flags to apply to the mapping from the source to the derived
+ * frame context when trying to allocate in the derived context.
+ */
+ int source_allocation_map_flags;
};
typedef struct HWMapDescriptor {
extern const HWContextType ff_hwcontext_type_cuda;
+extern const HWContextType ff_hwcontext_type_d3d11va;
+extern const HWContextType ff_hwcontext_type_drm;
extern const HWContextType ff_hwcontext_type_dxva2;
extern const HWContextType ff_hwcontext_type_qsv;
extern const HWContextType ff_hwcontext_type_vaapi;
extern const HWContextType ff_hwcontext_type_vdpau;
+extern const HWContextType ff_hwcontext_type_videotoolbox;
#endif /* AVUTIL_HWCONTEXT_INTERNAL_H */