#include "config.h"
#include <windows.h>
#include <initguid.h>
#include <d3d11.h>
#include <dxgi1_2.h>
#include "avassert.h"
#include "common.h"
#include "hwcontext.h"
#include "hwcontext_d3d11va.h"
#include "hwcontext_internal.h"
#include "imgutils.h"
#include "pixdesc.h"
#include "pixfmt.h"
#include "thread.h"
#include "compat/w32dlfcn.h"
Go to the source code of this file.
|
static av_cold void | load_functions (void) |
|
static void | d3d11va_default_lock (void *ctx) |
|
static void | d3d11va_default_unlock (void *ctx) |
|
static void | d3d11va_frames_uninit (AVHWFramesContext *ctx) |
|
static int | d3d11va_frames_get_constraints (AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints) |
|
static void | free_texture (void *opaque, uint8_t *data) |
|
static AVBufferRef * | wrap_texture_buf (AVHWFramesContext *ctx, ID3D11Texture2D *tex, int index) |
|
static AVBufferRef * | d3d11va_alloc_single (AVHWFramesContext *ctx) |
|
static AVBufferRef * | d3d11va_pool_alloc (void *opaque, size_t size) |
|
static int | d3d11va_frames_init (AVHWFramesContext *ctx) |
|
static int | d3d11va_get_buffer (AVHWFramesContext *ctx, AVFrame *frame) |
|
static int | d3d11va_transfer_get_formats (AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats) |
|
static int | d3d11va_create_staging_texture (AVHWFramesContext *ctx, DXGI_FORMAT format) |
|
static void | fill_texture_ptrs (uint8_t *data[4], int linesize[4], AVHWFramesContext *ctx, D3D11_TEXTURE2D_DESC *desc, D3D11_MAPPED_SUBRESOURCE *map) |
|
static int | d3d11va_transfer_data (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src) |
|
static int | d3d11va_device_init (AVHWDeviceContext *hwdev) |
|
static void | d3d11va_device_uninit (AVHWDeviceContext *hwdev) |
|
static int | d3d11va_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags) |
|
◆ COBJMACROS
◆ PFN_CREATE_DXGI_FACTORY
typedef HRESULT(WINAPI * PFN_CREATE_DXGI_FACTORY) (REFIID riid, void **ppFactory) |
◆ load_functions()
static av_cold void load_functions |
( |
void |
| ) |
|
|
static |
◆ d3d11va_default_lock()
static void d3d11va_default_lock |
( |
void * |
ctx | ) |
|
|
static |
◆ d3d11va_default_unlock()
static void d3d11va_default_unlock |
( |
void * |
ctx | ) |
|
|
static |
◆ d3d11va_frames_uninit()
◆ d3d11va_frames_get_constraints()
◆ free_texture()
static void free_texture |
( |
void * |
opaque, |
|
|
uint8_t * |
data |
|
) |
| |
|
static |
◆ wrap_texture_buf()
◆ d3d11va_alloc_single()
◆ d3d11va_pool_alloc()
static AVBufferRef* d3d11va_pool_alloc |
( |
void * |
opaque, |
|
|
size_t |
size |
|
) |
| |
|
static |
◆ d3d11va_frames_init()
◆ d3d11va_get_buffer()
◆ d3d11va_transfer_get_formats()
◆ d3d11va_create_staging_texture()
◆ fill_texture_ptrs()
static void fill_texture_ptrs |
( |
uint8_t * |
data[4], |
|
|
int |
linesize[4], |
|
|
AVHWFramesContext * |
ctx, |
|
|
D3D11_TEXTURE2D_DESC * |
desc, |
|
|
D3D11_MAPPED_SUBRESOURCE * |
map |
|
) |
| |
|
static |
◆ d3d11va_transfer_data()
◆ d3d11va_device_init()
◆ d3d11va_device_uninit()
◆ d3d11va_device_create()
◆ functions_loaded
◆ mCreateDXGIFactory
◆ mD3D11CreateDevice
PFN_D3D11_CREATE_DEVICE mD3D11CreateDevice |
|
static |
◆ d3d_format
◆ pix_fmt
◆ supported_formats
const { ... } supported_formats[] |
◆ ff_hwcontext_type_d3d11va
AVPixelFormat
Pixel format.
@ DXGI_FORMAT_B8G8R8A8_UNORM
static int d3d11va_transfer_get_formats(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
static int d3d11va_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
static int d3d11va_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
@ AV_HWDEVICE_TYPE_D3D11VA
static void d3d11va_frames_uninit(AVHWFramesContext *ctx)
static int d3d11va_frames_get_constraints(AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
static int device_init(AVFormatContext *ctx, int *width, int *height, uint32_t pixelformat)
static int d3d11va_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
static enum AVPixelFormat pix_fmts[]
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
This struct is allocated as AVHWFramesContext.hwctx.
#define AV_PIX_FMT_X2BGR10
static int d3d11va_frames_init(AVHWFramesContext *ctx)
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
@ DXGI_FORMAT_R16G16B16A16_FLOAT
This struct is allocated as AVHWDeviceContext.hwctx.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
static void d3d11va_device_uninit(AVHWDeviceContext *hwdev)
static int d3d11va_device_init(AVHWDeviceContext *hwdev)
#define AV_PIX_FMT_RGBAF16
@ AV_PIX_FMT_VUYX
packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined