FFmpeg
Data Structures | Functions | Variables
hwcontext_drm.c File Reference
#include "config.h"
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <drm.h>
#include <xf86drm.h>
#include "avassert.h"
#include "hwcontext.h"
#include "hwcontext_drm.h"
#include "hwcontext_internal.h"
#include "imgutils.h"
#include "mem.h"

Go to the source code of this file.

Data Structures

struct  DRMMapping
 

Functions

static void drm_device_free (AVHWDeviceContext *hwdev)
 
static int drm_device_create (AVHWDeviceContext *hwdev, const char *device, AVDictionary *opts, int flags)
 
static int drm_get_buffer (AVHWFramesContext *hwfc, AVFrame *frame)
 
static void drm_unmap_frame (AVHWFramesContext *hwfc, HWMapDescriptor *hwmap)
 
static int drm_map_frame (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags)
 
static int drm_transfer_get_formats (AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
 
static int drm_transfer_data_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
 
static int drm_transfer_data_to (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
 
static int drm_map_from (AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags)
 

Variables

const HWContextType ff_hwcontext_type_drm
 

Function Documentation

◆ drm_device_free()

static void drm_device_free ( AVHWDeviceContext hwdev)
static

Definition at line 44 of file hwcontext_drm.c.

Referenced by drm_device_create().

◆ drm_device_create()

static int drm_device_create ( AVHWDeviceContext hwdev,
const char *  device,
AVDictionary opts,
int  flags 
)
static

Definition at line 51 of file hwcontext_drm.c.

◆ drm_get_buffer()

static int drm_get_buffer ( AVHWFramesContext hwfc,
AVFrame frame 
)
static

Definition at line 81 of file hwcontext_drm.c.

◆ drm_unmap_frame()

static void drm_unmap_frame ( AVHWFramesContext hwfc,
HWMapDescriptor hwmap 
)
static

Definition at line 105 of file hwcontext_drm.c.

◆ drm_map_frame()

static int drm_map_frame ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src,
int  flags 
)
static

Definition at line 121 of file hwcontext_drm.c.

Referenced by drm_map_from(), drm_transfer_data_from(), and drm_transfer_data_to().

◆ drm_transfer_get_formats()

static int drm_transfer_get_formats ( AVHWFramesContext ctx,
enum AVHWFrameTransferDirection  dir,
enum AVPixelFormat **  formats 
)
static

Definition at line 206 of file hwcontext_drm.c.

◆ drm_transfer_data_from()

static int drm_transfer_data_from ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 223 of file hwcontext_drm.c.

◆ drm_transfer_data_to()

static int drm_transfer_data_to ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 254 of file hwcontext_drm.c.

◆ drm_map_from()

static int drm_map_from ( AVHWFramesContext hwfc,
AVFrame dst,
const AVFrame src,
int  flags 
)
static

Definition at line 286 of file hwcontext_drm.c.

Variable Documentation

◆ ff_hwcontext_type_drm

const HWContextType ff_hwcontext_type_drm
Initial value:
= {
.name = "DRM",
.device_hwctx_size = sizeof(AVDRMDeviceContext),
.device_create = &drm_device_create,
.frames_get_buffer = &drm_get_buffer,
.transfer_get_formats = &drm_transfer_get_formats,
.transfer_data_to = &drm_transfer_data_to,
.transfer_data_from = &drm_transfer_data_from,
.map_from = &drm_map_from,
.pix_fmts = (const enum AVPixelFormat[]) {
},
}

Definition at line 305 of file hwcontext_drm.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
drm_device_create
static int drm_device_create(AVHWDeviceContext *hwdev, const char *device, AVDictionary *opts, int flags)
Definition: hwcontext_drm.c:51
AV_PIX_FMT_DRM_PRIME
@ AV_PIX_FMT_DRM_PRIME
DRM-managed buffers exposed through PRIME buffer sharing.
Definition: pixfmt.h:351
drm_transfer_get_formats
static int drm_transfer_get_formats(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
Definition: hwcontext_drm.c:206
drm_transfer_data_to
static int drm_transfer_data_to(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
Definition: hwcontext_drm.c:254
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:304
drm_get_buffer
static int drm_get_buffer(AVHWFramesContext *hwfc, AVFrame *frame)
Definition: hwcontext_drm.c:81
drm_map_from
static int drm_map_from(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src, int flags)
Definition: hwcontext_drm.c:286
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
drm_transfer_data_from
static int drm_transfer_data_from(AVHWFramesContext *hwfc, AVFrame *dst, const AVFrame *src)
Definition: hwcontext_drm.c:223
AVDRMDeviceContext
DRM device.
Definition: hwcontext_drm.h:157
AV_HWDEVICE_TYPE_DRM
@ AV_HWDEVICE_TYPE_DRM
Definition: hwcontext.h:36