FFmpeg
Data Structures | Macros | Functions | Variables
mf_utils.c File Reference
#include "mf_utils.h"
#include "libavutil/pixdesc.h"

Go to the source code of this file.

Data Structures

struct  mf_pix_fmt_entry
 
struct  GUID_Entry
 

Macros

#define COBJMACROS
 
#define _WIN32_WINNT   0x0602
 
#define ff_MFSetAttributeRatio   ff_MFSetAttributeSize
 
#define ff_MFGetAttributeRatio   ff_MFGetAttributeSize
 
#define HR(x)   case x: return (char *) # x;
 
#define GUID_ENTRY(var)   {&(var), # var}
 

Functions

HRESULT ff_MFGetAttributeSize (IMFAttributes *pattr, REFGUID guid, UINT32 *pw, UINT32 *ph)
 
HRESULT ff_MFSetAttributeSize (IMFAttributes *pattr, REFGUID guid, UINT32 uw, UINT32 uh)
 
HRESULT ff_MFTEnumEx (GUID guidCategory, UINT32 Flags, const MFT_REGISTER_TYPE_INFO *pInputType, const MFT_REGISTER_TYPE_INFO *pOutputType, IMFActivate ***pppMFTActivate, UINT32 *pnumMFTActivate)
 
char * ff_hr_str_buf (char *buf, size_t size, HRESULT hr)
 
IMFSample * ff_create_memory_sample (void *fill_data, size_t size, size_t align)
 
enum AVSampleFormat ff_media_type_to_sample_fmt (IMFAttributes *type)
 
enum AVPixelFormat ff_media_type_to_pix_fmt (IMFAttributes *type)
 
const GUID * ff_pix_fmt_to_guid (enum AVPixelFormat pix_fmt)
 
int ff_fourcc_from_guid (const GUID *guid, uint32_t *out_fourcc)
 
char * ff_guid_str_buf (char *buf, size_t buf_size, const GUID *guid)
 
void ff_attributes_dump (void *log, IMFAttributes *attrs)
 
void ff_media_type_dump (void *log, IMFMediaType *type)
 
const CLSID * ff_codec_to_mf_subtype (enum AVCodecID codec)
 
static int init_com_mf (void *log)
 
static void uninit_com_mf (void)
 
int ff_instantiate_mf (void *log, GUID category, MFT_REGISTER_TYPE_INFO *in_type, MFT_REGISTER_TYPE_INFO *out_type, int use_hw, IMFTransform **res)
 
void ff_free_mf (IMFTransform **mft)
 

Variables

static const struct mf_pix_fmt_entry mf_pix_fmts []
 
static struct GUID_Entry guid_names []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file mf_utils.c.

◆ _WIN32_WINNT

#define _WIN32_WINNT   0x0602

Definition at line 22 of file mf_utils.c.

◆ ff_MFSetAttributeRatio

#define ff_MFSetAttributeRatio   ff_MFSetAttributeSize

Definition at line 47 of file mf_utils.c.

◆ ff_MFGetAttributeRatio

#define ff_MFGetAttributeRatio   ff_MFGetAttributeSize

Definition at line 48 of file mf_utils.c.

◆ HR

#define HR (   x)    case x: return (char *) # x;

◆ GUID_ENTRY

#define GUID_ENTRY (   var)    {&(var), # var}

Definition at line 246 of file mf_utils.c.

Function Documentation

◆ ff_MFGetAttributeSize()

HRESULT ff_MFGetAttributeSize ( IMFAttributes *  pattr,
REFGUID  guid,
UINT32 *  pw,
UINT32 *  ph 
)

Definition at line 28 of file mf_utils.c.

Referenced by ff_attributes_dump().

◆ ff_MFSetAttributeSize()

HRESULT ff_MFSetAttributeSize ( IMFAttributes *  pattr,
REFGUID  guid,
UINT32  uw,
UINT32  uh 
)

Definition at line 40 of file mf_utils.c.

Referenced by mf_encv_output_adjust().

◆ ff_MFTEnumEx()

HRESULT ff_MFTEnumEx ( GUID  guidCategory,
UINT32  Flags,
const MFT_REGISTER_TYPE_INFO *  pInputType,
const MFT_REGISTER_TYPE_INFO *  pOutputType,
IMFActivate ***  pppMFTActivate,
UINT32 *  pnumMFTActivate 
)

Definition at line 53 of file mf_utils.c.

Referenced by ff_instantiate_mf().

◆ ff_hr_str_buf()

char* ff_hr_str_buf ( char *  buf,
size_t  size,
HRESULT  hr 
)

Definition at line 83 of file mf_utils.c.

◆ ff_create_memory_sample()

IMFSample* ff_create_memory_sample ( void *  fill_data,
size_t  size,
size_t  align 
)

Definition at line 109 of file mf_utils.c.

Referenced by mf_a_avframe_to_sample(), mf_receive_sample(), and mf_v_avframe_to_sample().

◆ ff_media_type_to_sample_fmt()

enum AVSampleFormat ff_media_type_to_sample_fmt ( IMFAttributes *  type)

Definition at line 146 of file mf_utils.c.

Referenced by ff_attributes_dump(), mf_enca_input_adjust(), and mf_enca_input_score().

◆ ff_media_type_to_pix_fmt()

enum AVPixelFormat ff_media_type_to_pix_fmt ( IMFAttributes *  type)

Definition at line 190 of file mf_utils.c.

Referenced by ff_attributes_dump(), mf_encv_input_adjust(), and mf_encv_input_score().

◆ ff_pix_fmt_to_guid()

const GUID* ff_pix_fmt_to_guid ( enum AVPixelFormat  pix_fmt)

Definition at line 208 of file mf_utils.c.

◆ ff_fourcc_from_guid()

int ff_fourcc_from_guid ( const GUID *  guid,
uint32_t *  out_fourcc 
)

Definition at line 222 of file mf_utils.c.

Referenced by ff_guid_str_buf().

◆ ff_guid_str_buf()

char* ff_guid_str_buf ( char *  buf,
size_t  buf_size,
const GUID *  guid 
)

Definition at line 364 of file mf_utils.c.

◆ ff_attributes_dump()

void ff_attributes_dump ( void *  log,
IMFAttributes *  attrs 
)

Definition at line 390 of file mf_utils.c.

Referenced by ff_instantiate_mf(), and ff_media_type_dump().

◆ ff_media_type_dump()

void ff_media_type_dump ( void *  log,
IMFMediaType *  type 
)

Definition at line 534 of file mf_utils.c.

Referenced by mf_choose_input_type(), mf_choose_output_type(), and mf_output_type_get().

◆ ff_codec_to_mf_subtype()

const CLSID* ff_codec_to_mf_subtype ( enum AVCodecID  codec)

Definition at line 539 of file mf_utils.c.

Referenced by mf_create(), and mf_init().

◆ init_com_mf()

static int init_com_mf ( void *  log)
static

Definition at line 551 of file mf_utils.c.

Referenced by ff_instantiate_mf().

◆ uninit_com_mf()

static void uninit_com_mf ( void  )
static

Definition at line 574 of file mf_utils.c.

Referenced by ff_free_mf(), and ff_instantiate_mf().

◆ ff_instantiate_mf()

int ff_instantiate_mf ( void *  log,
GUID  category,
MFT_REGISTER_TYPE_INFO *  in_type,
MFT_REGISTER_TYPE_INFO *  out_type,
int  use_hw,
IMFTransform **  res 
)

Definition at line 582 of file mf_utils.c.

Referenced by mf_create().

◆ ff_free_mf()

void ff_free_mf ( IMFTransform **  mft)

Definition at line 674 of file mf_utils.c.

Referenced by mf_close().

Variable Documentation

◆ mf_pix_fmts

const struct mf_pix_fmt_entry mf_pix_fmts[]
static
Initial value:
= {
{&MFVideoFormat_IYUV, AV_PIX_FMT_YUV420P},
{&MFVideoFormat_I420, AV_PIX_FMT_YUV420P},
{&MFVideoFormat_NV12, AV_PIX_FMT_NV12},
{&MFVideoFormat_P010, AV_PIX_FMT_P010},
{&MFVideoFormat_P016, AV_PIX_FMT_P010},
{&MFVideoFormat_YUY2, AV_PIX_FMT_YUYV422},
}

Definition at line 181 of file mf_utils.c.

Referenced by ff_media_type_to_pix_fmt(), and ff_pix_fmt_to_guid().

◆ guid_names

struct GUID_Entry guid_names[]
static

Definition at line 248 of file mf_utils.c.

Referenced by ff_guid_str_buf().

AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
AV_PIX_FMT_YUYV422
@ AV_PIX_FMT_YUYV422
packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
Definition: pixfmt.h:67
AV_PIX_FMT_NV12
@ 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...
Definition: pixfmt.h:89
AV_PIX_FMT_P010
#define AV_PIX_FMT_P010
Definition: pixfmt.h:438