Bug 1764855 - link some MF functions from mfplat.dll r=media-playback-reviewers,jolin

Some functions we're going to use in bug 1758789 haven't been linked yet.

Differential Revision: https://phabricator.services.mozilla.com/D143802
This commit is contained in:
alwu 2022-04-30 00:59:05 +00:00
parent 90b9d8fa09
commit eb4bfc22f7
2 changed files with 66 additions and 4 deletions

View File

@ -148,6 +148,24 @@ HRESULT MFTGetInfo(CLSID clsidMFT, LPWSTR* pszName,
MFT_REGISTER_TYPE_INFO** ppOutputTypes,
UINT32* pcOutputTypes, IMFAttributes** ppAttributes);
HRESULT MFCreateAttributes(IMFAttributes** ppMFAttributes, UINT32 cInitialSize);
HRESULT MFCreateEventQueue(IMFMediaEventQueue** ppMediaEventQueue);
HRESULT MFCreateStreamDescriptor(DWORD dwStreamIdentifier, DWORD cMediaTypes,
IMFMediaType** apMediaTypes,
IMFStreamDescriptor** ppDescriptor);
HRESULT MFCreateAsyncResult(IUnknown* punkObject, IMFAsyncCallback* pCallback,
IUnknown* punkState,
IMFAsyncResult** ppAsyncResult);
HRESULT MFCreatePresentationDescriptor(
DWORD cStreamDescriptors, IMFStreamDescriptor** apStreamDescriptors,
IMFPresentationDescriptor** ppPresentationDescriptor);
HRESULT MFCreateMemoryBuffer(DWORD cbMaxLength, IMFMediaBuffer** ppBuffer);
} // end namespace wmf
} // end namespace mozilla

View File

@ -5,6 +5,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WMFUtils.h"
#include <Mfidl.h>
#include <shlobj.h>
#include <shlwapi.h>
#include <initguid.h>
#include <stdint.h>
#include "VideoUtils.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/CheckedInt.h"
@ -14,10 +21,6 @@
#include "nsThreadUtils.h"
#include "nsWindowsHelpers.h"
#include "prenv.h"
#include <shlobj.h>
#include <shlwapi.h>
#include <initguid.h>
#include <stdint.h>
#include "mozilla/mscom/EnsureMTA.h"
#include "mozilla/WindowsVersion.h"
@ -373,5 +376,46 @@ HRESULT MFTGetInfo(CLSID clsidMFT, LPWSTR* pszName,
ppOutputTypes, pcOutputTypes, ppAttributes);
}
HRESULT
MFCreateAttributes(IMFAttributes** ppMFAttributes, UINT32 cInitialSize) {
ENSURE_FUNCTION_PTR(MFCreateAttributes, mfplat.dll)
return (MFCreateAttributesPtr)(ppMFAttributes, cInitialSize);
}
HRESULT MFCreateEventQueue(IMFMediaEventQueue** ppMediaEventQueue) {
ENSURE_FUNCTION_PTR(MFCreateEventQueue, mfplat.dll)
return (MFCreateEventQueuePtr)(ppMediaEventQueue);
}
HRESULT MFCreateStreamDescriptor(DWORD dwStreamIdentifier, DWORD cMediaTypes,
IMFMediaType** apMediaTypes,
IMFStreamDescriptor** ppDescriptor) {
ENSURE_FUNCTION_PTR(MFCreateStreamDescriptor, mfplat.dll)
return (MFCreateStreamDescriptorPtr)(dwStreamIdentifier, cMediaTypes,
apMediaTypes, ppDescriptor);
}
HRESULT MFCreateAsyncResult(IUnknown* punkObject, IMFAsyncCallback* pCallback,
IUnknown* punkState,
IMFAsyncResult** ppAsyncResult) {
ENSURE_FUNCTION_PTR(MFCreateAsyncResult, mfplat.dll)
return (MFCreateAsyncResultPtr)(punkObject, pCallback, punkState,
ppAsyncResult);
}
HRESULT MFCreatePresentationDescriptor(
DWORD cStreamDescriptors, IMFStreamDescriptor** apStreamDescriptors,
IMFPresentationDescriptor** ppPresentationDescriptor) {
ENSURE_FUNCTION_PTR(MFCreatePresentationDescriptor, mfplat.dll)
return (MFCreatePresentationDescriptorPtr)(cStreamDescriptors,
apStreamDescriptors,
ppPresentationDescriptor);
}
HRESULT MFCreateMemoryBuffer(DWORD cbMaxLength, IMFMediaBuffer** ppBuffer) {
ENSURE_FUNCTION_PTR(MFCreateMemoryBuffer, mfplat.dll);
return (MFCreateMemoryBufferPtr)(cbMaxLength, ppBuffer);
}
} // end namespace wmf
} // end namespace mozilla