FreeRDP
h264_mf.c File Reference
#include <freerdp/log.h>
#include <freerdp/codec/h264.h>
#include <ks.h>
#include <codecapi.h>
#include <mfapi.h>
#include <mferror.h>
#include <wmcodecdsp.h>
#include <mftransform.h>
#include "h264.h"

Macros

#define TAG   FREERDP_TAG("codec")
 

Typedefs

typedef HRESULT(__stdcall * pfnMFStartup) (ULONG Version, DWORD dwFlags)
 
typedef HRESULT(__stdcall * pfnMFShutdown) (void)
 
typedef HRESULT(__stdcall * pfnMFCreateSample) (IMFSample **ppIMFSample)
 
typedef HRESULT(__stdcall * pfnMFCreateMemoryBuffer) (DWORD cbMaxLength, IMFMediaBuffer **ppBuffer)
 
typedef HRESULT(__stdcall * pfnMFCreateMediaType) (IMFMediaType **ppMFType)
 

Functions

static HRESULT mf_find_output_type (H264_CONTEXT_MF *sys, const GUID *guid, IMFMediaType **ppMediaType)
 
static HRESULT mf_create_output_sample (H264_CONTEXT *h264, H264_CONTEXT_MF *sys)
 
static int mf_decompress (H264_CONTEXT *h264, const BYTE *pSrcData, UINT32 SrcSize)
 
static int mf_compress (H264_CONTEXT *h264, const BYTE **ppSrcYuv, const UINT32 *pStride, BYTE **ppDstData, UINT32 *pDstSize)
 
static BOOL mf_plat_loaded (H264_CONTEXT_MF *sys)
 
static void mf_uninit (H264_CONTEXT *h264)
 
static BOOL mf_init (H264_CONTEXT *h264)
 

Variables

static const GUID sCLSID_CMSH264DecoderMFT
 
static const GUID sIID_IMFTransform
 
static const GUID sMF_MT_MAJOR_TYPE
 
static const GUID sMF_MT_FRAME_SIZE
 
static const GUID sMF_MT_DEFAULT_STRIDE
 
static const GUID sMF_MT_SUBTYPE
 
static const GUID sMFMediaType_Video
 
static const GUID sMFVideoFormat_H264
 
static const GUID sMFVideoFormat_IYUV
 
static const GUID sIID_ICodecAPI
 
static const GUID sCODECAPI_AVLowLatencyMode
 
H264_CONTEXT_SUBSYSTEM g_Subsystem_MF
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("codec")

FreeRDP: A Remote Desktop Protocol Implementation H.264 Bitmap Compression

Copyright 2014 Mike McDonald Mike..nosp@m.McDo.nosp@m.nald@.nosp@m.soft.nosp@m.ware..nosp@m.dell.nosp@m..com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ pfnMFCreateMediaType

typedef HRESULT(__stdcall* pfnMFCreateMediaType) (IMFMediaType **ppMFType)

◆ pfnMFCreateMemoryBuffer

typedef HRESULT(__stdcall* pfnMFCreateMemoryBuffer) (DWORD cbMaxLength, IMFMediaBuffer **ppBuffer)

◆ pfnMFCreateSample

typedef HRESULT(__stdcall* pfnMFCreateSample) (IMFSample **ppIMFSample)

◆ pfnMFShutdown

typedef HRESULT(__stdcall* pfnMFShutdown) (void)

◆ pfnMFStartup

typedef HRESULT(__stdcall* pfnMFStartup) (ULONG Version, DWORD dwFlags)

Function Documentation

◆ mf_compress()

static int mf_compress ( H264_CONTEXT *  h264,
const BYTE **  ppSrcYuv,
const UINT32 *  pStride,
BYTE **  ppDstData,
UINT32 *  pDstSize 
)
static

◆ mf_create_output_sample()

static HRESULT mf_create_output_sample ( H264_CONTEXT *  h264,
H264_CONTEXT_MF *  sys 
)
static
Here is the caller graph for this function:

◆ mf_decompress()

static int mf_decompress ( H264_CONTEXT *  h264,
const BYTE pSrcData,
UINT32  SrcSize 
)
static
Here is the call graph for this function:

◆ mf_find_output_type()

static HRESULT mf_find_output_type ( H264_CONTEXT_MF *  sys,
const GUID *  guid,
IMFMediaType **  ppMediaType 
)
static
Here is the caller graph for this function:

◆ mf_init()

static BOOL mf_init ( H264_CONTEXT *  h264)
static
Here is the call graph for this function:

◆ mf_plat_loaded()

static BOOL mf_plat_loaded ( H264_CONTEXT_MF *  sys)
static
Here is the caller graph for this function:

◆ mf_uninit()

static void mf_uninit ( H264_CONTEXT *  h264)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ g_Subsystem_MF

H264_CONTEXT_SUBSYSTEM g_Subsystem_MF
Initial value:
= { "MediaFoundation", mf_init, mf_uninit, mf_decompress,

◆ sCLSID_CMSH264DecoderMFT

const GUID sCLSID_CMSH264DecoderMFT
static
Initial value:
= {
0x62CE7E72, 0x4C71, 0x4d20, { 0xB1, 0x5D, 0x45, 0x28, 0x31, 0xA8, 0x7D, 0x9D }
}

◆ sCODECAPI_AVLowLatencyMode

const GUID sCODECAPI_AVLowLatencyMode
static
Initial value:
= {
0x9c27891a, 0xed7a, 0x40e1, { 0x88, 0xe8, 0xb2, 0x27, 0x27, 0xa0, 0x24, 0xee }
}

◆ sIID_ICodecAPI

const GUID sIID_ICodecAPI
static
Initial value:
= {
0x901db4c7, 0x31ce, 0x41a2, { 0x85, 0xdc, 0x8f, 0xa0, 0xbf, 0x41, 0xb8, 0xda }
}

◆ sIID_IMFTransform

const GUID sIID_IMFTransform
static
Initial value:
= {
0xbf94c121, 0x5b05, 0x4e6f, { 0x80, 0x00, 0xba, 0x59, 0x89, 0x61, 0x41, 0x4d }
}

◆ sMF_MT_DEFAULT_STRIDE

const GUID sMF_MT_DEFAULT_STRIDE
static
Initial value:
= {
0x644b4e48, 0x1e02, 0x4516, { 0xb0, 0xeb, 0xc0, 0x1c, 0xa9, 0xd4, 0x9a, 0xc6 }
}

◆ sMF_MT_FRAME_SIZE

const GUID sMF_MT_FRAME_SIZE
static
Initial value:
= {
0x1652c33d, 0xd6b2, 0x4012, { 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d }
}

◆ sMF_MT_MAJOR_TYPE

const GUID sMF_MT_MAJOR_TYPE
static
Initial value:
= {
0x48eba18e, 0xf8c9, 0x4687, { 0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f }
}

◆ sMF_MT_SUBTYPE

const GUID sMF_MT_SUBTYPE
static
Initial value:
= {
0xf7e34c9a, 0x42e8, 0x4714, { 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5 }
}

◆ sMFMediaType_Video

const GUID sMFMediaType_Video
static
Initial value:
= {
0x73646976, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 }
}

◆ sMFVideoFormat_H264

const GUID sMFVideoFormat_H264
static
Initial value:
= {
0x34363248, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }
}

◆ sMFVideoFormat_IYUV

const GUID sMFVideoFormat_IYUV
static
Initial value:
= {
0x56555949, 0x0000, 0x0010, { 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 }
}
mf_compress
static int mf_compress(H264_CONTEXT *h264, const BYTE **ppSrcYuv, const UINT32 *pStride, BYTE **ppDstData, UINT32 *pDstSize)
Definition: h264_mf.c:382
mf_decompress
static int mf_decompress(H264_CONTEXT *h264, const BYTE *pSrcData, UINT32 SrcSize)
Definition: h264_mf.c:173
mf_init
static BOOL mf_init(H264_CONTEXT *h264)
Definition: h264_mf.c:455
mf_uninit
static void mf_uninit(H264_CONTEXT *h264)
Definition: h264_mf.c:395