2014-12-09 02:36:19 +01:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright 2014 Austin English
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
2017-05-09 00:50:50 +02:00
|
|
|
#include <string.h>
|
2014-12-09 02:36:19 +01:00
|
|
|
|
2015-08-07 12:31:03 +02:00
|
|
|
#define COBJMACROS
|
|
|
|
|
2014-12-09 02:36:19 +01:00
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
2017-05-09 00:50:26 +02:00
|
|
|
#include "winuser.h"
|
|
|
|
#include "winreg.h"
|
2015-08-07 12:31:03 +02:00
|
|
|
|
|
|
|
#include "initguid.h"
|
2015-03-30 07:52:47 +02:00
|
|
|
#include "mfapi.h"
|
2017-05-28 13:42:48 +02:00
|
|
|
#include "mfidl.h"
|
2014-12-12 00:56:54 +01:00
|
|
|
#include "mferror.h"
|
|
|
|
|
2018-09-07 02:58:39 +02:00
|
|
|
#include "wine/heap.h"
|
2014-12-12 00:56:54 +01:00
|
|
|
#include "wine/debug.h"
|
2017-05-09 00:50:26 +02:00
|
|
|
#include "wine/unicode.h"
|
2014-12-12 00:56:54 +01:00
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
|
2014-12-09 02:36:19 +01:00
|
|
|
|
2017-05-09 00:50:26 +02:00
|
|
|
static const WCHAR transform_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
|
|
|
|
'T','r','a','n','s','f','o','r','m','s',0};
|
|
|
|
static const WCHAR categories_keyW[] = {'M','e','d','i','a','F','o','u','n','d','a','t','i','o','n','\\',
|
|
|
|
'T','r','a','n','s','f','o','r','m','s','\\',
|
|
|
|
'C','a','t','e','g','o','r','i','e','s',0};
|
|
|
|
static const WCHAR inputtypesW[] = {'I','n','p','u','t','T','y','p','e','s',0};
|
|
|
|
static const WCHAR outputtypesW[] = {'O','u','t','p','u','t','T','y','p','e','s',0};
|
|
|
|
static const WCHAR szGUIDFmt[] =
|
|
|
|
{
|
|
|
|
'%','0','8','x','-','%','0','4','x','-','%','0','4','x','-','%','0',
|
|
|
|
'2','x','%','0','2','x','-','%','0','2','x','%','0','2','x','%','0','2',
|
|
|
|
'x','%','0','2','x','%','0','2','x','%','0','2','x',0
|
|
|
|
};
|
|
|
|
|
2017-05-09 00:50:50 +02:00
|
|
|
static const BYTE guid_conv_table[256] =
|
|
|
|
{
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 */
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 */
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 */
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, /* 0x30 */
|
|
|
|
0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 */
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 */
|
|
|
|
0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf /* 0x60 */
|
|
|
|
};
|
|
|
|
|
2017-05-09 00:50:26 +02:00
|
|
|
static WCHAR* GUIDToString(WCHAR *str, REFGUID guid)
|
|
|
|
{
|
|
|
|
sprintfW(str, szGUIDFmt, guid->Data1, guid->Data2,
|
|
|
|
guid->Data3, guid->Data4[0], guid->Data4[1],
|
|
|
|
guid->Data4[2], guid->Data4[3], guid->Data4[4],
|
|
|
|
guid->Data4[5], guid->Data4[6], guid->Data4[7]);
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2017-05-09 00:50:50 +02:00
|
|
|
static inline BOOL is_valid_hex(WCHAR c)
|
|
|
|
{
|
|
|
|
if (!(((c >= '0') && (c <= '9')) ||
|
|
|
|
((c >= 'a') && (c <= 'f')) ||
|
|
|
|
((c >= 'A') && (c <= 'F'))))
|
|
|
|
return FALSE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static BOOL GUIDFromString(LPCWSTR s, GUID *id)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
/* in form XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */
|
|
|
|
|
|
|
|
id->Data1 = 0;
|
|
|
|
for (i = 0; i < 8; i++)
|
|
|
|
{
|
|
|
|
if (!is_valid_hex(s[i])) return FALSE;
|
|
|
|
id->Data1 = (id->Data1 << 4) | guid_conv_table[s[i]];
|
|
|
|
}
|
|
|
|
if (s[8]!='-') return FALSE;
|
|
|
|
|
|
|
|
id->Data2 = 0;
|
|
|
|
for (i = 9; i < 13; i++)
|
|
|
|
{
|
|
|
|
if (!is_valid_hex(s[i])) return FALSE;
|
|
|
|
id->Data2 = (id->Data2 << 4) | guid_conv_table[s[i]];
|
|
|
|
}
|
|
|
|
if (s[13]!='-') return FALSE;
|
|
|
|
|
|
|
|
id->Data3 = 0;
|
|
|
|
for (i = 14; i < 18; i++)
|
|
|
|
{
|
|
|
|
if (!is_valid_hex(s[i])) return FALSE;
|
|
|
|
id->Data3 = (id->Data3 << 4) | guid_conv_table[s[i]];
|
|
|
|
}
|
|
|
|
if (s[18]!='-') return FALSE;
|
|
|
|
|
|
|
|
for (i = 19; i < 36; i+=2)
|
|
|
|
{
|
|
|
|
if (i == 23)
|
|
|
|
{
|
|
|
|
if (s[i]!='-') return FALSE;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
if (!is_valid_hex(s[i]) || !is_valid_hex(s[i+1])) return FALSE;
|
|
|
|
id->Data4[(i-19)/2] = guid_conv_table[s[i]] << 4 | guid_conv_table[s[i+1]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!s[37]) return TRUE;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2014-12-09 02:36:19 +01:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
|
|
|
|
{
|
|
|
|
switch (reason)
|
|
|
|
{
|
|
|
|
case DLL_WINE_PREATTACH:
|
|
|
|
return FALSE; /* prefer native version */
|
|
|
|
case DLL_PROCESS_ATTACH:
|
|
|
|
DisableThreadLibraryCalls(instance);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2014-12-12 00:56:54 +01:00
|
|
|
|
2017-05-09 00:50:26 +02:00
|
|
|
static HRESULT register_transform(CLSID *clsid, WCHAR *name,
|
|
|
|
UINT32 cinput, MFT_REGISTER_TYPE_INFO *input_types,
|
|
|
|
UINT32 coutput, MFT_REGISTER_TYPE_INFO *output_types)
|
|
|
|
{
|
|
|
|
static const WCHAR reg_format[] = {'%','s','\\','%','s',0};
|
|
|
|
HKEY hclsid = 0;
|
|
|
|
WCHAR buffer[64];
|
|
|
|
DWORD size;
|
|
|
|
WCHAR str[250];
|
|
|
|
|
|
|
|
GUIDToString(buffer, clsid);
|
|
|
|
sprintfW(str, reg_format, transform_keyW, buffer);
|
|
|
|
|
|
|
|
if (RegCreateKeyW(HKEY_CLASSES_ROOT, str, &hclsid))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
size = (strlenW(name) + 1) * sizeof(WCHAR);
|
|
|
|
if (RegSetValueExW(hclsid, NULL, 0, REG_SZ, (BYTE *)name, size))
|
|
|
|
goto err;
|
|
|
|
|
|
|
|
if (cinput && input_types)
|
|
|
|
{
|
|
|
|
size = cinput * sizeof(MFT_REGISTER_TYPE_INFO);
|
|
|
|
if (RegSetValueExW(hclsid, inputtypesW, 0, REG_BINARY, (BYTE *)input_types, size))
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (coutput && output_types)
|
|
|
|
{
|
|
|
|
size = coutput * sizeof(MFT_REGISTER_TYPE_INFO);
|
|
|
|
if (RegSetValueExW(hclsid, outputtypesW, 0, REG_BINARY, (BYTE *)output_types, size))
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
|
|
|
RegCloseKey(hclsid);
|
|
|
|
return S_OK;
|
|
|
|
|
|
|
|
err:
|
|
|
|
RegCloseKey(hclsid);
|
|
|
|
return E_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT register_category(CLSID *clsid, GUID *category)
|
|
|
|
{
|
|
|
|
static const WCHAR reg_format[] = {'%','s','\\','%','s','\\','%','s',0};
|
|
|
|
HKEY htmp1;
|
|
|
|
WCHAR guid1[64], guid2[64];
|
|
|
|
WCHAR str[350];
|
|
|
|
|
|
|
|
GUIDToString(guid1, category);
|
|
|
|
GUIDToString(guid2, clsid);
|
|
|
|
|
|
|
|
sprintfW(str, reg_format, categories_keyW, guid1, guid2);
|
|
|
|
|
|
|
|
if (RegCreateKeyW(HKEY_CLASSES_ROOT, str, &htmp1))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
RegCloseKey(htmp1);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MFTRegister (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFTRegister(CLSID clsid, GUID category, LPWSTR name, UINT32 flags, UINT32 cinput,
|
|
|
|
MFT_REGISTER_TYPE_INFO *input_types, UINT32 coutput,
|
|
|
|
MFT_REGISTER_TYPE_INFO *output_types, IMFAttributes *attributes)
|
|
|
|
{
|
|
|
|
HRESULT hr;
|
|
|
|
|
|
|
|
TRACE("(%s, %s, %s, %x, %u, %p, %u, %p, %p)\n", debugstr_guid(&clsid), debugstr_guid(&category),
|
|
|
|
debugstr_w(name), flags, cinput, input_types,
|
|
|
|
coutput, output_types, attributes);
|
|
|
|
|
|
|
|
if (attributes)
|
|
|
|
FIXME("attributes not yet supported.\n");
|
|
|
|
|
|
|
|
if (flags)
|
|
|
|
FIXME("flags not yet supported.\n");
|
|
|
|
|
|
|
|
hr = register_transform(&clsid, name, cinput, input_types, coutput, output_types);
|
|
|
|
if(FAILED(hr))
|
|
|
|
ERR("Failed to write register transform\n");
|
|
|
|
|
|
|
|
if (SUCCEEDED(hr))
|
|
|
|
hr = register_category(&clsid, &category);
|
|
|
|
|
|
|
|
return hr;
|
|
|
|
}
|
|
|
|
|
2018-09-07 02:58:37 +02:00
|
|
|
HRESULT WINAPI MFTRegisterLocal(IClassFactory *factory, REFGUID category, LPCWSTR name,
|
|
|
|
UINT32 flags, UINT32 cinput, const MFT_REGISTER_TYPE_INFO *input_types,
|
|
|
|
UINT32 coutput, const MFT_REGISTER_TYPE_INFO* output_types)
|
|
|
|
{
|
|
|
|
FIXME("(%p, %s, %s, %x, %u, %p, %u, %p)\n", factory, debugstr_guid(category), debugstr_w(name),
|
|
|
|
flags, cinput, input_types, coutput, output_types);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2018-09-07 02:58:38 +02:00
|
|
|
HRESULT WINAPI MFTUnregisterLocal(IClassFactory *factory)
|
|
|
|
{
|
|
|
|
FIXME("(%p)\n", factory);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2017-05-09 00:50:50 +02:00
|
|
|
static BOOL match_type(const WCHAR *clsid_str, const WCHAR *type_str, MFT_REGISTER_TYPE_INFO *type)
|
|
|
|
{
|
|
|
|
HKEY htransform, hfilter;
|
|
|
|
DWORD reg_type, size;
|
|
|
|
LONG ret = FALSE;
|
|
|
|
MFT_REGISTER_TYPE_INFO *info = NULL;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
if (RegOpenKeyW(HKEY_CLASSES_ROOT, transform_keyW, &htransform))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (RegOpenKeyW(htransform, clsid_str, &hfilter))
|
|
|
|
{
|
|
|
|
RegCloseKey(htransform);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (RegQueryValueExW(hfilter, type_str, NULL, ®_type, NULL, &size) != ERROR_SUCCESS)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
if (reg_type != REG_BINARY)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
if (!size || size % (sizeof(MFT_REGISTER_TYPE_INFO)) != 0)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
info = HeapAlloc(GetProcessHeap(), 0, size);
|
|
|
|
if (!info)
|
|
|
|
goto out;
|
|
|
|
|
|
|
|
if (RegQueryValueExW(hfilter, type_str, NULL, ®_type, (LPBYTE)info, &size) != ERROR_SUCCESS)
|
|
|
|
goto out;
|
|
|
|
|
2017-05-10 17:45:20 +02:00
|
|
|
for (i = 0; i < size / sizeof(MFT_REGISTER_TYPE_INFO); i++)
|
2017-05-09 00:50:50 +02:00
|
|
|
{
|
|
|
|
if (IsEqualGUID(&info[i].guidMajorType, &type->guidMajorType) &&
|
|
|
|
IsEqualGUID(&info[i].guidSubtype, &type->guidSubtype))
|
|
|
|
{
|
|
|
|
ret = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
out:
|
|
|
|
HeapFree(GetProcessHeap(), 0, info);
|
|
|
|
RegCloseKey(hfilter);
|
|
|
|
RegCloseKey(htransform);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MFTEnum (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFTEnum(GUID category, UINT32 flags, MFT_REGISTER_TYPE_INFO *input_type,
|
|
|
|
MFT_REGISTER_TYPE_INFO *output_type, IMFAttributes *attributes,
|
|
|
|
CLSID **pclsids, UINT32 *pcount)
|
|
|
|
{
|
|
|
|
WCHAR buffer[64], clsid_str[MAX_PATH] = {0};
|
|
|
|
HKEY hcategory, hlist;
|
|
|
|
DWORD index = 0;
|
|
|
|
DWORD size = MAX_PATH;
|
|
|
|
CLSID *clsids = NULL;
|
|
|
|
UINT32 count = 0;
|
|
|
|
LONG ret;
|
|
|
|
|
|
|
|
TRACE("(%s, %x, %p, %p, %p, %p, %p)\n", debugstr_guid(&category), flags, input_type,
|
|
|
|
output_type, attributes, pclsids, pcount);
|
|
|
|
|
|
|
|
if (!pclsids || !pcount)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
if (RegOpenKeyW(HKEY_CLASSES_ROOT, categories_keyW, &hcategory))
|
|
|
|
return E_FAIL;
|
|
|
|
|
|
|
|
GUIDToString(buffer, &category);
|
|
|
|
|
|
|
|
ret = RegOpenKeyW(hcategory, buffer, &hlist);
|
|
|
|
RegCloseKey(hcategory);
|
|
|
|
if (ret) return E_FAIL;
|
|
|
|
|
|
|
|
while (RegEnumKeyExW(hlist, index, clsid_str, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
GUID clsid;
|
|
|
|
void *tmp;
|
|
|
|
|
|
|
|
if (!GUIDFromString(clsid_str, &clsid))
|
|
|
|
goto next;
|
|
|
|
|
|
|
|
if (output_type && !match_type(clsid_str, outputtypesW, output_type))
|
|
|
|
goto next;
|
|
|
|
|
|
|
|
if (input_type && !match_type(clsid_str, inputtypesW, input_type))
|
|
|
|
goto next;
|
|
|
|
|
|
|
|
tmp = CoTaskMemRealloc(clsids, (count + 1) * sizeof(GUID));
|
|
|
|
if (!tmp)
|
|
|
|
{
|
|
|
|
CoTaskMemFree(clsids);
|
|
|
|
RegCloseKey(hlist);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
clsids = tmp;
|
|
|
|
clsids[count++] = clsid;
|
|
|
|
|
|
|
|
next:
|
|
|
|
size = MAX_PATH;
|
|
|
|
index++;
|
|
|
|
}
|
|
|
|
|
|
|
|
*pclsids = clsids;
|
|
|
|
*pcount = count;
|
|
|
|
|
|
|
|
RegCloseKey(hlist);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2017-08-14 14:12:23 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* MFTEnumEx (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFTEnumEx(GUID category, UINT32 flags, const MFT_REGISTER_TYPE_INFO *input_type,
|
|
|
|
const MFT_REGISTER_TYPE_INFO *output_type, IMFActivate ***activate,
|
|
|
|
UINT32 *pcount)
|
|
|
|
{
|
|
|
|
FIXME("(%s, %x, %p, %p, %p, %p): stub\n", debugstr_guid(&category), flags, input_type,
|
|
|
|
output_type, activate, pcount);
|
|
|
|
|
|
|
|
*pcount = 0;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2017-05-09 00:50:38 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* MFTUnregister (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFTUnregister(CLSID clsid)
|
|
|
|
{
|
|
|
|
WCHAR buffer[64], category[MAX_PATH];
|
|
|
|
HKEY htransform, hcategory, htmp;
|
|
|
|
DWORD size = MAX_PATH;
|
|
|
|
DWORD index = 0;
|
|
|
|
|
|
|
|
TRACE("(%s)\n", debugstr_guid(&clsid));
|
|
|
|
|
|
|
|
GUIDToString(buffer, &clsid);
|
|
|
|
|
|
|
|
if (!RegOpenKeyW(HKEY_CLASSES_ROOT, transform_keyW, &htransform))
|
|
|
|
{
|
|
|
|
RegDeleteKeyW(htransform, buffer);
|
|
|
|
RegCloseKey(htransform);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!RegOpenKeyW(HKEY_CLASSES_ROOT, categories_keyW, &hcategory))
|
|
|
|
{
|
|
|
|
while (RegEnumKeyExW(hcategory, index, category, &size, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
|
|
|
|
{
|
|
|
|
if (!RegOpenKeyW(hcategory, category, &htmp))
|
|
|
|
{
|
|
|
|
RegDeleteKeyW(htmp, buffer);
|
|
|
|
RegCloseKey(htmp);
|
|
|
|
}
|
|
|
|
size = MAX_PATH;
|
|
|
|
index++;
|
|
|
|
}
|
|
|
|
RegCloseKey(hcategory);
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2014-12-12 00:56:54 +01:00
|
|
|
/***********************************************************************
|
|
|
|
* MFStartup (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFStartup(ULONG version, DWORD flags)
|
|
|
|
{
|
2018-04-30 02:47:18 +02:00
|
|
|
#define MF_VERSION_XP MAKELONG( MF_API_VERSION, 1 )
|
|
|
|
#define MF_VERSION_WIN7 MAKELONG( MF_API_VERSION, 2 )
|
|
|
|
|
2014-12-12 00:56:54 +01:00
|
|
|
FIXME("(%u, %u): stub\n", version, flags);
|
2018-04-30 02:47:18 +02:00
|
|
|
|
|
|
|
if(version != MF_VERSION_XP && version != MF_VERSION_WIN7)
|
|
|
|
return MF_E_BAD_STARTUP_VERSION;
|
|
|
|
|
|
|
|
return S_OK;
|
2014-12-12 00:56:54 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MFShutdown (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFShutdown(void)
|
|
|
|
{
|
|
|
|
FIXME("(): stub\n");
|
|
|
|
return S_OK;
|
|
|
|
}
|
2015-08-07 12:31:03 +02:00
|
|
|
|
2018-09-17 02:50:05 +02:00
|
|
|
HRESULT WINAPI MFCopyImage(BYTE *dest, LONG deststride, const BYTE *src, LONG srcstride, DWORD width, DWORD lines)
|
|
|
|
{
|
|
|
|
FIXME("(%p, %d, %p, %d, %d, %d) stub\n", dest, deststride, src, srcstride, width, lines);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
typedef struct _mfattributes
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
IMFAttributes IMFAttributes_iface;
|
2018-09-07 02:58:39 +02:00
|
|
|
LONG ref;
|
2018-11-03 22:25:06 +01:00
|
|
|
} mfattributes;
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static inline mfattributes *impl_from_IMFAttributes(IMFAttributes *iface)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
return CONTAINING_RECORD(iface, mfattributes, IMFAttributes_iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_QueryInterface(IMFAttributes *iface, REFIID riid, void **out)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
2018-11-03 22:25:06 +01:00
|
|
|
IsEqualGUID(riid, &IID_IMFAttributes))
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
*out = &This->IMFAttributes_iface;
|
2018-09-07 02:58:39 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
|
|
|
|
*out = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*out);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static ULONG WINAPI mfattributes_AddRef(IMFAttributes *iface)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static ULONG WINAPI mfattributes_Release(IMFAttributes *iface)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetItem(IMFAttributes *iface, REFGUID key, PROPVARIANT *value)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetItemType(IMFAttributes *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), type);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_CompareItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, result);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_Compare(IMFAttributes *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type,
|
|
|
|
BOOL *result)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p, %d, %p\n", This, theirs, type, result);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetUINT32(IMFAttributes *iface, REFGUID key, UINT32 *value)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetUINT64(IMFAttributes *iface, REFGUID key, UINT64 *value)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
return E_NOTIMPL;
|
2018-09-07 02:58:39 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetDouble(IMFAttributes *iface, REFGUID key, double *value)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetGUID(IMFAttributes *iface, REFGUID key, GUID *value)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), value);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetStringLength(IMFAttributes *iface, REFGUID key, UINT32 *length)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), length);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetString(IMFAttributes *iface, REFGUID key, WCHAR *value,
|
|
|
|
UINT32 size, UINT32 *length)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), value, size, length);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetAllocatedString(IMFAttributes *iface, REFGUID key,
|
|
|
|
WCHAR **value, UINT32 *length)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), value, length);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetBlobSize(IMFAttributes *iface, REFGUID key, UINT32 *size)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), size);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetBlob(IMFAttributes *iface, REFGUID key, UINT8 *buf,
|
|
|
|
UINT32 bufsize, UINT32 *blobsize)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p, %d, %p\n", This, debugstr_guid(key), buf, bufsize, blobsize);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetAllocatedBlob(IMFAttributes *iface, REFGUID key, UINT8 **buf, UINT32 *size)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p, %p\n", This, debugstr_guid(key), buf, size);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_GetUnknown(IMFAttributes *iface, REFGUID key, REFIID riid, void **ppv)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %s, %p\n", This, debugstr_guid(key), debugstr_guid(riid), ppv);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetItem(IMFAttributes *iface, REFGUID key, REFPROPVARIANT Value)
|
2018-09-07 02:58:39 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), Value);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_DeleteItem(IMFAttributes *iface, REFGUID key)
|
|
|
|
{
|
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s\n", This, debugstr_guid(key));
|
2018-09-07 02:58:39 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
return E_NOTIMPL;
|
2018-09-07 02:58:39 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_DeleteAllItems(IMFAttributes *iface)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
2015-08-07 12:31:03 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
2015-08-07 12:31:03 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetUINT32(IMFAttributes *iface, REFGUID key, UINT32 value)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %d\n", This, debugstr_guid(key), value);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
2015-08-07 12:31:03 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetUINT64(IMFAttributes *iface, REFGUID key, UINT64 value)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %s\n", This, debugstr_guid(key), wine_dbgstr_longlong(value));
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
2015-08-07 12:31:03 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetDouble(IMFAttributes *iface, REFGUID key, double value)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %f\n", This, debugstr_guid(key), value);
|
|
|
|
|
2015-08-07 12:31:03 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetGUID(IMFAttributes *iface, REFGUID key, REFGUID value)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_guid(value));
|
|
|
|
|
2015-08-07 12:31:03 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetString(IMFAttributes *iface, REFGUID key, const WCHAR *value)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %s\n", This, debugstr_guid(key), debugstr_w(value));
|
|
|
|
|
2015-08-07 12:31:03 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetBlob(IMFAttributes *iface, REFGUID key, const UINT8 *buf, UINT32 size)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %p, %d\n", This, debugstr_guid(key), buf, size);
|
|
|
|
|
2015-08-07 12:31:03 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_SetUnknown(IMFAttributes *iface, REFGUID key, IUnknown *unknown)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(key), unknown);
|
|
|
|
|
2015-08-07 12:31:03 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_LockStore(IMFAttributes *iface)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p\n", This);
|
|
|
|
|
2015-08-07 12:31:03 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfattributes_UnlockStore(IMFAttributes *iface)
|
|
|
|
{
|
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfattributes_GetCount(IMFAttributes *iface, UINT32 *items)
|
|
|
|
{
|
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, items);
|
|
|
|
|
|
|
|
if(items)
|
|
|
|
*items = 0;
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfattributes_GetItemByIndex(IMFAttributes *iface, UINT32 index, GUID *key, PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %d, %p, %p\n", This, index, key, value);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfattributes_CopyAllItems(IMFAttributes *iface, IMFAttributes *dest)
|
|
|
|
{
|
|
|
|
mfattributes *This = impl_from_IMFAttributes(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, dest);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFAttributesVtbl mfattributes_vtbl =
|
|
|
|
{
|
|
|
|
mfattributes_QueryInterface,
|
|
|
|
mfattributes_AddRef,
|
|
|
|
mfattributes_Release,
|
|
|
|
mfattributes_GetItem,
|
|
|
|
mfattributes_GetItemType,
|
|
|
|
mfattributes_CompareItem,
|
|
|
|
mfattributes_Compare,
|
|
|
|
mfattributes_GetUINT32,
|
|
|
|
mfattributes_GetUINT64,
|
|
|
|
mfattributes_GetDouble,
|
|
|
|
mfattributes_GetGUID,
|
|
|
|
mfattributes_GetStringLength,
|
|
|
|
mfattributes_GetString,
|
|
|
|
mfattributes_GetAllocatedString,
|
|
|
|
mfattributes_GetBlobSize,
|
|
|
|
mfattributes_GetBlob,
|
|
|
|
mfattributes_GetAllocatedBlob,
|
|
|
|
mfattributes_GetUnknown,
|
|
|
|
mfattributes_SetItem,
|
|
|
|
mfattributes_DeleteItem,
|
|
|
|
mfattributes_DeleteAllItems,
|
|
|
|
mfattributes_SetUINT32,
|
|
|
|
mfattributes_SetUINT64,
|
|
|
|
mfattributes_SetDouble,
|
|
|
|
mfattributes_SetGUID,
|
|
|
|
mfattributes_SetString,
|
|
|
|
mfattributes_SetBlob,
|
|
|
|
mfattributes_SetUnknown,
|
|
|
|
mfattributes_LockStore,
|
|
|
|
mfattributes_UnlockStore,
|
|
|
|
mfattributes_GetCount,
|
|
|
|
mfattributes_GetItemByIndex,
|
|
|
|
mfattributes_CopyAllItems
|
2015-08-07 12:31:03 +02:00
|
|
|
};
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static void init_attribute_object(mfattributes *object, UINT32 size)
|
|
|
|
{
|
|
|
|
object->ref = 1;
|
|
|
|
object->IMFAttributes_iface.lpVtbl = &mfattributes_vtbl;
|
|
|
|
}
|
2015-08-07 12:31:03 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
2018-11-03 22:25:06 +01:00
|
|
|
* MFCreateAttributes (mfplat.@)
|
2015-08-07 12:31:03 +02:00
|
|
|
*/
|
2018-11-03 22:25:06 +01:00
|
|
|
HRESULT WINAPI MFCreateAttributes(IMFAttributes **attributes, UINT32 size)
|
2015-08-07 12:31:03 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfattributes *object;
|
|
|
|
|
|
|
|
TRACE("%p, %d\n", attributes, size);
|
|
|
|
|
|
|
|
object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
|
|
|
|
if(!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
init_attribute_object(object, size);
|
|
|
|
*attributes = &object->IMFAttributes_iface;
|
2015-08-07 12:31:03 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
typedef struct _mfbytestream
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:07 +01:00
|
|
|
mfattributes attributes;
|
2018-11-03 22:25:06 +01:00
|
|
|
IMFByteStream IMFByteStream_iface;
|
|
|
|
} mfbytestream;
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static inline mfbytestream *impl_from_IMFByteStream(IMFByteStream *iface)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
return CONTAINING_RECORD(iface, mfbytestream, IMFByteStream_iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_QueryInterface(IMFByteStream *iface, REFIID riid, void **out)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
2018-11-03 22:25:06 +01:00
|
|
|
IsEqualGUID(riid, &IID_IMFByteStream))
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
*out = &This->IMFByteStream_iface;
|
2017-04-21 03:48:12 +02:00
|
|
|
}
|
2018-11-03 22:25:07 +01:00
|
|
|
else if(IsEqualGUID(riid, &IID_IMFAttributes))
|
|
|
|
{
|
|
|
|
*out = &This->attributes.IMFAttributes_iface;
|
|
|
|
}
|
2017-04-21 03:48:12 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
|
|
|
|
*out = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*out);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static ULONG WINAPI mfbytestream_AddRef(IMFByteStream *iface)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2018-11-03 22:25:07 +01:00
|
|
|
ULONG ref = InterlockedIncrement(&This->attributes.ref);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:07 +01:00
|
|
|
static ULONG WINAPI mfbytestream_Release(IMFByteStream *iface)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2018-11-03 22:25:07 +01:00
|
|
|
ULONG ref = InterlockedDecrement(&This->attributes.ref);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_GetCapabilities(IMFByteStream *iface, DWORD *capabilities)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p\n", This, capabilities);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_GetLength(IMFByteStream *iface, QWORD *length)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p\n", This, length);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_SetLength(IMFByteStream *iface, QWORD length)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s\n", This, wine_dbgstr_longlong(length));
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_GetCurrentPosition(IMFByteStream *iface, QWORD *position)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p\n", This, position);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_SetCurrentPosition(IMFByteStream *iface, QWORD position)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %s\n", This, wine_dbgstr_longlong(position));
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_IsEndOfStream(IMFByteStream *iface, BOOL *endstream)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p\n", This, endstream);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
if(endstream)
|
|
|
|
*endstream = TRUE;
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
return S_OK;
|
2017-04-21 03:48:12 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_Read(IMFByteStream *iface, BYTE *data, ULONG count, ULONG *byte_read)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p, %u, %p\n", This, data, count, byte_read);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_BeginRead(IMFByteStream *iface, BYTE *data, ULONG count,
|
|
|
|
IMFAsyncCallback *callback, IUnknown *state)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p, %u, %p, %p\n", This, data, count, callback, state);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_EndRead(IMFByteStream *iface, IMFAsyncResult *result, ULONG *byte_read)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p, %p\n", This, result, byte_read);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_Write(IMFByteStream *iface, const BYTE *data, ULONG count, ULONG *written)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p, %u, %p\n", This, data, count, written);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_BeginWrite(IMFByteStream *iface, const BYTE *data, ULONG count,
|
|
|
|
IMFAsyncCallback *callback, IUnknown *state)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p, %u, %p, %p\n", This, data, count, callback, state);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_EndWrite(IMFByteStream *iface, IMFAsyncResult *result, ULONG *written)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %p, %p\n", This, result, written);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_Seek(IMFByteStream *iface, MFBYTESTREAM_SEEK_ORIGIN seek, LONGLONG offset,
|
|
|
|
DWORD flags, QWORD *current)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p, %u, %s, 0x%08x, %p\n", This, seek, wine_dbgstr_longlong(offset), flags, current);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_Flush(IMFByteStream *iface)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("%p\n", This);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI mfbytestream_Close(IMFByteStream *iface)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *This = impl_from_IMFByteStream(iface);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
|
|
|
FIXME("%p\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:07 +01:00
|
|
|
static const IMFByteStreamVtbl mfbytestream_vtbl =
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream_QueryInterface,
|
|
|
|
mfbytestream_AddRef,
|
|
|
|
mfbytestream_Release,
|
|
|
|
mfbytestream_GetCapabilities,
|
|
|
|
mfbytestream_GetLength,
|
|
|
|
mfbytestream_SetLength,
|
|
|
|
mfbytestream_GetCurrentPosition,
|
|
|
|
mfbytestream_SetCurrentPosition,
|
|
|
|
mfbytestream_IsEndOfStream,
|
|
|
|
mfbytestream_Read,
|
|
|
|
mfbytestream_BeginRead,
|
|
|
|
mfbytestream_EndRead,
|
|
|
|
mfbytestream_Write,
|
|
|
|
mfbytestream_BeginWrite,
|
|
|
|
mfbytestream_EndWrite,
|
|
|
|
mfbytestream_Seek,
|
|
|
|
mfbytestream_Flush,
|
|
|
|
mfbytestream_Close
|
|
|
|
};
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:07 +01:00
|
|
|
static inline mfbytestream *impl_from_IMFByteStream_IMFAttributes(IMFAttributes *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, mfbytestream, attributes.IMFAttributes_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfbytestream_attributes_QueryInterface(
|
|
|
|
IMFAttributes *iface, REFIID riid, void **out)
|
|
|
|
{
|
|
|
|
mfbytestream *This = impl_from_IMFByteStream_IMFAttributes(iface);
|
|
|
|
return IMFByteStream_QueryInterface(&This->IMFByteStream_iface, riid, out);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfbytestream_attributes_AddRef(IMFAttributes *iface)
|
|
|
|
{
|
|
|
|
mfbytestream *This = impl_from_IMFByteStream_IMFAttributes(iface);
|
|
|
|
return IMFByteStream_AddRef(&This->IMFByteStream_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfbytestream_attributes_Release(IMFAttributes *iface)
|
|
|
|
{
|
|
|
|
mfbytestream *This = impl_from_IMFByteStream_IMFAttributes(iface);
|
|
|
|
return IMFByteStream_Release(&This->IMFByteStream_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFAttributesVtbl mfbytestream_attributes_vtbl =
|
|
|
|
{
|
|
|
|
mfbytestream_attributes_QueryInterface,
|
|
|
|
mfbytestream_attributes_AddRef,
|
|
|
|
mfbytestream_attributes_Release,
|
|
|
|
mfattributes_GetItem,
|
|
|
|
mfattributes_GetItemType,
|
|
|
|
mfattributes_CompareItem,
|
|
|
|
mfattributes_Compare,
|
|
|
|
mfattributes_GetUINT32,
|
|
|
|
mfattributes_GetUINT64,
|
|
|
|
mfattributes_GetDouble,
|
|
|
|
mfattributes_GetGUID,
|
|
|
|
mfattributes_GetStringLength,
|
|
|
|
mfattributes_GetString,
|
|
|
|
mfattributes_GetAllocatedString,
|
|
|
|
mfattributes_GetBlobSize,
|
|
|
|
mfattributes_GetBlob,
|
|
|
|
mfattributes_GetAllocatedBlob,
|
|
|
|
mfattributes_GetUnknown,
|
|
|
|
mfattributes_SetItem,
|
|
|
|
mfattributes_DeleteItem,
|
|
|
|
mfattributes_DeleteAllItems,
|
|
|
|
mfattributes_SetUINT32,
|
|
|
|
mfattributes_SetUINT64,
|
|
|
|
mfattributes_SetDouble,
|
|
|
|
mfattributes_SetGUID,
|
|
|
|
mfattributes_SetString,
|
|
|
|
mfattributes_SetBlob,
|
|
|
|
mfattributes_SetUnknown,
|
|
|
|
mfattributes_LockStore,
|
|
|
|
mfattributes_UnlockStore,
|
|
|
|
mfattributes_GetCount,
|
|
|
|
mfattributes_GetItemByIndex,
|
|
|
|
mfattributes_CopyAllItems
|
|
|
|
};
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **bytestream)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
mfbytestream *object;
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
TRACE("(%p, %p): stub\n", stream, bytestream);
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
object = heap_alloc( sizeof(*object) );
|
|
|
|
if(!object)
|
|
|
|
return E_OUTOFMEMORY;
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:07 +01:00
|
|
|
init_attribute_object(&object->attributes, 0);
|
|
|
|
object->IMFByteStream_iface.lpVtbl = &mfbytestream_vtbl;
|
|
|
|
object->attributes.IMFAttributes_iface.lpVtbl = &mfbytestream_attributes_vtbl;
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
*bytestream = &object->IMFByteStream_iface;
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
return S_OK;
|
2017-04-21 03:48:12 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI MFPluginControl_QueryInterface(IMFPluginControl *iface, REFIID riid, void **ppv)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown)) {
|
|
|
|
TRACE("(IID_IUnknown %p)\n", ppv);
|
|
|
|
*ppv = iface;
|
|
|
|
}else if(IsEqualGUID(riid, &IID_IMFPluginControl)) {
|
|
|
|
TRACE("(IID_IMFPluginControl %p)\n", ppv);
|
|
|
|
*ppv = iface;
|
|
|
|
}else {
|
|
|
|
FIXME("(%s %p)\n", debugstr_guid(riid), ppv);
|
|
|
|
*ppv = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
2017-04-21 03:48:12 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
IUnknown_AddRef((IUnknown*)*ppv);
|
|
|
|
return S_OK;
|
2017-04-21 03:48:12 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static ULONG WINAPI MFPluginControl_AddRef(IMFPluginControl *iface)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
TRACE("\n");
|
|
|
|
return 2;
|
2017-04-21 03:48:12 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static ULONG WINAPI MFPluginControl_Release(IMFPluginControl *iface)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
TRACE("\n");
|
|
|
|
return 1;
|
2017-04-21 03:48:12 +02:00
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI MFPluginControl_GetPreferredClsid(IMFPluginControl *iface, DWORD plugin_type,
|
|
|
|
const WCHAR *selector, CLSID *clsid)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("(%d %s %p)\n", plugin_type, debugstr_w(selector), clsid);
|
2017-04-21 03:48:12 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI MFPluginControl_GetPreferredClsidByIndex(IMFPluginControl *iface, DWORD plugin_type,
|
|
|
|
DWORD index, WCHAR **selector, CLSID *clsid)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("(%d %d %p %p)\n", plugin_type, index, selector, clsid);
|
2017-04-21 03:48:12 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI MFPluginControl_SetPreferredClsid(IMFPluginControl *iface, DWORD plugin_type,
|
|
|
|
const WCHAR *selector, const CLSID *clsid)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("(%d %s %s)\n", plugin_type, debugstr_w(selector), debugstr_guid(clsid));
|
2017-04-21 03:48:12 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI MFPluginControl_IsDisabled(IMFPluginControl *iface, DWORD plugin_type, REFCLSID clsid)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("(%d %s)\n", plugin_type, debugstr_guid(clsid));
|
2017-04-21 03:48:12 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI MFPluginControl_GetDisabledByIndex(IMFPluginControl *iface, DWORD plugin_type, DWORD index, CLSID *clsid)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("(%d %d %p)\n", plugin_type, index, clsid);
|
2017-04-21 03:48:12 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static HRESULT WINAPI MFPluginControl_SetDisabled(IMFPluginControl *iface, DWORD plugin_type, REFCLSID clsid, BOOL disabled)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
FIXME("(%d %s %x)\n", plugin_type, debugstr_guid(clsid), disabled);
|
2017-04-21 03:48:12 +02:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static const IMFPluginControlVtbl MFPluginControlVtbl = {
|
|
|
|
MFPluginControl_QueryInterface,
|
|
|
|
MFPluginControl_AddRef,
|
|
|
|
MFPluginControl_Release,
|
|
|
|
MFPluginControl_GetPreferredClsid,
|
|
|
|
MFPluginControl_GetPreferredClsidByIndex,
|
|
|
|
MFPluginControl_SetPreferredClsid,
|
|
|
|
MFPluginControl_IsDisabled,
|
|
|
|
MFPluginControl_GetDisabledByIndex,
|
|
|
|
MFPluginControl_SetDisabled
|
2017-04-21 03:48:12 +02:00
|
|
|
};
|
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
static IMFPluginControl plugin_control = { &MFPluginControlVtbl };
|
2018-09-12 02:19:07 +02:00
|
|
|
|
2017-04-21 03:48:12 +02:00
|
|
|
/***********************************************************************
|
2018-11-03 22:25:06 +01:00
|
|
|
* MFGetPluginControl (mfplat.@)
|
2017-04-21 03:48:12 +02:00
|
|
|
*/
|
2018-11-03 22:25:06 +01:00
|
|
|
HRESULT WINAPI MFGetPluginControl(IMFPluginControl **ret)
|
2017-04-21 03:48:12 +02:00
|
|
|
{
|
2018-11-03 22:25:06 +01:00
|
|
|
TRACE("(%p)\n", ret);
|
2018-09-12 02:19:07 +02:00
|
|
|
|
2018-11-03 22:25:06 +01:00
|
|
|
*ret = &plugin_control;
|
2017-04-21 03:48:12 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
2017-05-28 13:42:48 +02:00
|
|
|
|
|
|
|
typedef struct _mfsourceresolver
|
|
|
|
{
|
|
|
|
IMFSourceResolver IMFSourceResolver_iface;
|
|
|
|
LONG ref;
|
|
|
|
} mfsourceresolver;
|
|
|
|
|
|
|
|
static inline mfsourceresolver *impl_from_IMFSourceResolver(IMFSourceResolver *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, mfsourceresolver, IMFSourceResolver_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_QueryInterface(IMFSourceResolver *iface, REFIID riid, void **obj)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
TRACE("(%p->(%s, %p)\n", This, debugstr_guid(riid), obj);
|
|
|
|
|
|
|
|
if (IsEqualIID(riid, &IID_IMFSourceResolver) ||
|
|
|
|
IsEqualIID(riid, &IID_IUnknown))
|
|
|
|
{
|
|
|
|
*obj = &This->IMFSourceResolver_iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
*obj = NULL;
|
|
|
|
FIXME("unsupported interface %s\n", debugstr_guid(riid));
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown *)*obj);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfsourceresolver_AddRef(IMFSourceResolver *iface)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u)\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfsourceresolver_Release(IMFSourceResolver *iface)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%u)\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_CreateObjectFromURL(IMFSourceResolver *iface, const WCHAR *url,
|
|
|
|
DWORD flags, IPropertyStore *props, MF_OBJECT_TYPE *obj_type, IUnknown **object)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s, %#x, %p, %p, %p): stub\n", This, debugstr_w(url), flags, props, obj_type, object);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_CreateObjectFromByteStream(IMFSourceResolver *iface, IMFByteStream *stream,
|
|
|
|
const WCHAR *url, DWORD flags, IPropertyStore *props, MF_OBJECT_TYPE *obj_type, IUnknown **object)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %s, %#x, %p, %p, %p): stub\n", This, stream, debugstr_w(url), flags, props, obj_type, object);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_BeginCreateObjectFromURL(IMFSourceResolver *iface, const WCHAR *url,
|
|
|
|
DWORD flags, IPropertyStore *props, IUnknown **cancel_cookie, IMFAsyncCallback *callback, IUnknown *unk_state)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s, %#x, %p, %p, %p, %p): stub\n", This, debugstr_w(url), flags, props, cancel_cookie,
|
|
|
|
callback, unk_state);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_EndCreateObjectFromURL(IMFSourceResolver *iface, IMFAsyncResult *result,
|
|
|
|
MF_OBJECT_TYPE *obj_type, IUnknown **object)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %p, %p): stub\n", This, result, obj_type, object);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_BeginCreateObjectFromByteStream(IMFSourceResolver *iface, IMFByteStream *stream,
|
|
|
|
const WCHAR *url, DWORD flags, IPropertyStore *props, IUnknown **cancel_cookie, IMFAsyncCallback *callback,
|
|
|
|
IUnknown *unk_state)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %s, %#x, %p, %p, %p, %p): stub\n", This, stream, debugstr_w(url), flags, props, cancel_cookie,
|
|
|
|
callback, unk_state);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_EndCreateObjectFromByteStream(IMFSourceResolver *iface, IMFAsyncResult *result,
|
|
|
|
MF_OBJECT_TYPE *obj_type, IUnknown **object)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p, %p, %p): stub\n", This, result, obj_type, object);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsourceresolver_CancelObjectCreation(IMFSourceResolver *iface, IUnknown *cancel_cookie)
|
|
|
|
{
|
|
|
|
mfsourceresolver *This = impl_from_IMFSourceResolver(iface);
|
|
|
|
|
|
|
|
FIXME("(%p)->(%p): stub\n", This, cancel_cookie);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFSourceResolverVtbl mfsourceresolvervtbl =
|
|
|
|
{
|
|
|
|
mfsourceresolver_QueryInterface,
|
|
|
|
mfsourceresolver_AddRef,
|
|
|
|
mfsourceresolver_Release,
|
|
|
|
mfsourceresolver_CreateObjectFromURL,
|
|
|
|
mfsourceresolver_CreateObjectFromByteStream,
|
|
|
|
mfsourceresolver_BeginCreateObjectFromURL,
|
|
|
|
mfsourceresolver_EndCreateObjectFromURL,
|
|
|
|
mfsourceresolver_BeginCreateObjectFromByteStream,
|
|
|
|
mfsourceresolver_EndCreateObjectFromByteStream,
|
|
|
|
mfsourceresolver_CancelObjectCreation,
|
|
|
|
};
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MFCreateSourceResolver (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFCreateSourceResolver(IMFSourceResolver **resolver)
|
|
|
|
{
|
|
|
|
mfsourceresolver *object;
|
|
|
|
|
|
|
|
TRACE("%p\n", resolver);
|
|
|
|
|
|
|
|
if (!resolver)
|
|
|
|
return E_POINTER;
|
|
|
|
|
|
|
|
object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
|
|
|
|
if (!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
object->IMFSourceResolver_iface.lpVtbl = &mfsourceresolvervtbl;
|
|
|
|
object->ref = 1;
|
|
|
|
|
|
|
|
*resolver = &object->IMFSourceResolver_iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
2017-06-27 03:46:28 +02:00
|
|
|
|
|
|
|
typedef struct _mfmediatype
|
|
|
|
{
|
2018-09-12 02:19:07 +02:00
|
|
|
mfattributes attributes;
|
2017-06-27 03:46:28 +02:00
|
|
|
IMFMediaType IMFMediaType_iface;
|
|
|
|
} mfmediatype;
|
|
|
|
|
|
|
|
static inline mfmediatype *impl_from_IMFMediaType(IMFMediaType *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, mfmediatype, IMFMediaType_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_QueryInterface(IMFMediaType *iface, REFIID riid, void **object)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), object);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFAttributes) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFMediaType))
|
|
|
|
{
|
|
|
|
*object = &This->IMFMediaType_iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p)\n", debugstr_guid(riid), object);
|
|
|
|
*object = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*object);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mediatype_AddRef(IMFMediaType *iface)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
ULONG ref = InterlockedIncrement(&This->attributes.ref);
|
2017-06-27 03:46:28 +02:00
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mediatype_Release(IMFMediaType *iface)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
ULONG ref = InterlockedDecrement(&This->attributes.ref);
|
2017-06-27 03:46:28 +02:00
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetItem(IMFMediaType *iface, REFGUID key, PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetItem(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetItemType(IMFMediaType *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetItemType(&This->attributes.IMFAttributes_iface, key, type);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_CompareItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_CompareItem(&This->attributes.IMFAttributes_iface, key, value, result);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_Compare(IMFMediaType *iface, IMFAttributes *attrs, MF_ATTRIBUTES_MATCH_TYPE type,
|
|
|
|
BOOL *result)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_Compare(&This->attributes.IMFAttributes_iface, attrs, type, result);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetUINT32(IMFMediaType *iface, REFGUID key, UINT32 *value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetUINT32(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetUINT64(IMFMediaType *iface, REFGUID key, UINT64 *value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetUINT64(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetDouble(IMFMediaType *iface, REFGUID key, double *value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetDouble(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetGUID(IMFMediaType *iface, REFGUID key, GUID *value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetGUID(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetStringLength(IMFMediaType *iface, REFGUID key, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetStringLength(&This->attributes.IMFAttributes_iface, key, length);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetString(IMFMediaType *iface, REFGUID key, WCHAR *value,
|
|
|
|
UINT32 size, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetString(&This->attributes.IMFAttributes_iface, key, value, size, length);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetAllocatedString(IMFMediaType *iface, REFGUID key,
|
|
|
|
WCHAR **value, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetAllocatedString(&This->attributes.IMFAttributes_iface, key, value, length);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetBlobSize(IMFMediaType *iface, REFGUID key, UINT32 *size)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetBlobSize(&This->attributes.IMFAttributes_iface, key, size);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetBlob(IMFMediaType *iface, REFGUID key, UINT8 *buf,
|
|
|
|
UINT32 bufsize, UINT32 *blobsize)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetBlob(&This->attributes.IMFAttributes_iface, key, buf, bufsize, blobsize);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetAllocatedBlob(IMFMediaType *iface, REFGUID key, UINT8 **buf, UINT32 *size)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetAllocatedBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetUnknown(IMFMediaType *iface, REFGUID key, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetUnknown(&This->attributes.IMFAttributes_iface, key, riid, ppv);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetItem(IMFMediaType *iface, REFGUID key, REFPROPVARIANT value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetItem(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_DeleteItem(IMFMediaType *iface, REFGUID key)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_DeleteItem(&This->attributes.IMFAttributes_iface, key);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_DeleteAllItems(IMFMediaType *iface)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_DeleteAllItems(&This->attributes.IMFAttributes_iface);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetUINT32(IMFMediaType *iface, REFGUID key, UINT32 value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetUINT32(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetUINT64(IMFMediaType *iface, REFGUID key, UINT64 value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetUINT64(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetDouble(IMFMediaType *iface, REFGUID key, double value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetDouble(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetGUID(IMFMediaType *iface, REFGUID key, REFGUID value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetGUID(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetString(IMFMediaType *iface, REFGUID key, const WCHAR *value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetString(&This->attributes.IMFAttributes_iface, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetBlob(IMFMediaType *iface, REFGUID key, const UINT8 *buf, UINT32 size)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_SetUnknown(IMFMediaType *iface, REFGUID key, IUnknown *unknown)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_SetUnknown(&This->attributes.IMFAttributes_iface, key, unknown);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_LockStore(IMFMediaType *iface)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_LockStore(&This->attributes.IMFAttributes_iface);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_UnlockStore(IMFMediaType *iface)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_UnlockStore(&This->attributes.IMFAttributes_iface);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetCount(IMFMediaType *iface, UINT32 *items)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetCount(&This->attributes.IMFAttributes_iface, items);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetItemByIndex(IMFMediaType *iface, UINT32 index, GUID *key, PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
2018-09-12 02:19:07 +02:00
|
|
|
return IMFAttributes_GetItemByIndex(&This->attributes.IMFAttributes_iface, index, key, value);
|
2017-06-27 03:46:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes *dest)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, dest);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetMajorType(IMFMediaType *iface, GUID *guid)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, guid);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_IsCompressedFormat(IMFMediaType *iface, BOOL *compressed)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, compressed);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_IsEqual(IMFMediaType *iface, IMFMediaType *type, DWORD *flags)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p, %p\n", This, type, flags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_GetRepresentation(IMFMediaType *iface, GUID guid, void **representation)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(&guid), representation);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mediatype_FreeRepresentation(IMFMediaType *iface, GUID guid, void *representation)
|
|
|
|
{
|
|
|
|
mfmediatype *This = impl_from_IMFMediaType(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s, %p\n", This, debugstr_guid(&guid), representation);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFMediaTypeVtbl mediatype_vtbl =
|
|
|
|
{
|
|
|
|
mediatype_QueryInterface,
|
|
|
|
mediatype_AddRef,
|
|
|
|
mediatype_Release,
|
|
|
|
mediatype_GetItem,
|
|
|
|
mediatype_GetItemType,
|
|
|
|
mediatype_CompareItem,
|
|
|
|
mediatype_Compare,
|
|
|
|
mediatype_GetUINT32,
|
|
|
|
mediatype_GetUINT64,
|
|
|
|
mediatype_GetDouble,
|
|
|
|
mediatype_GetGUID,
|
|
|
|
mediatype_GetStringLength,
|
|
|
|
mediatype_GetString,
|
|
|
|
mediatype_GetAllocatedString,
|
|
|
|
mediatype_GetBlobSize,
|
|
|
|
mediatype_GetBlob,
|
|
|
|
mediatype_GetAllocatedBlob,
|
|
|
|
mediatype_GetUnknown,
|
|
|
|
mediatype_SetItem,
|
|
|
|
mediatype_DeleteItem,
|
|
|
|
mediatype_DeleteAllItems,
|
|
|
|
mediatype_SetUINT32,
|
|
|
|
mediatype_SetUINT64,
|
|
|
|
mediatype_SetDouble,
|
|
|
|
mediatype_SetGUID,
|
|
|
|
mediatype_SetString,
|
|
|
|
mediatype_SetBlob,
|
|
|
|
mediatype_SetUnknown,
|
|
|
|
mediatype_LockStore,
|
|
|
|
mediatype_UnlockStore,
|
|
|
|
mediatype_GetCount,
|
|
|
|
mediatype_GetItemByIndex,
|
|
|
|
mediatype_CopyAllItems,
|
|
|
|
mediatype_GetMajorType,
|
|
|
|
mediatype_IsCompressedFormat,
|
|
|
|
mediatype_IsEqual,
|
|
|
|
mediatype_GetRepresentation,
|
|
|
|
mediatype_FreeRepresentation
|
|
|
|
};
|
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* MFCreateMediaType (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFCreateMediaType(IMFMediaType **type)
|
|
|
|
{
|
|
|
|
mfmediatype *object;
|
|
|
|
|
|
|
|
TRACE("%p\n", type);
|
|
|
|
|
|
|
|
if(!type)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
2018-09-12 02:19:07 +02:00
|
|
|
object = heap_alloc( sizeof(*object) );
|
2017-06-27 03:46:28 +02:00
|
|
|
if(!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2018-09-12 02:19:07 +02:00
|
|
|
init_attribute_object(&object->attributes, 0);
|
2017-06-27 03:46:28 +02:00
|
|
|
object->IMFMediaType_iface.lpVtbl = &mediatype_vtbl;
|
|
|
|
|
|
|
|
*type = &object->IMFMediaType_iface;
|
2018-09-12 02:19:07 +02:00
|
|
|
|
2017-06-27 03:46:28 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
2017-09-06 09:38:58 +02:00
|
|
|
|
2017-09-08 13:00:20 +02:00
|
|
|
typedef struct _mfeventqueue
|
|
|
|
{
|
|
|
|
IMFMediaEventQueue IMFMediaEventQueue_iface;
|
|
|
|
LONG ref;
|
|
|
|
} mfeventqueue;
|
|
|
|
|
|
|
|
static inline mfeventqueue *impl_from_IMFMediaEventQueue(IMFMediaEventQueue *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, mfeventqueue, IMFMediaEventQueue_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_QueryInterface(IMFMediaEventQueue *iface, REFIID riid, void **out)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFMediaEventQueue))
|
|
|
|
{
|
|
|
|
*out = &This->IMFMediaEventQueue_iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
|
|
|
|
*out = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*out);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfeventqueue_AddRef(IMFMediaEventQueue *iface)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfeventqueue_Release(IMFMediaEventQueue *iface)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
HeapFree(GetProcessHeap(), 0, This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_GetEvent(IMFMediaEventQueue *iface, DWORD flags, IMFMediaEvent **event)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, event);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_BeginGetEvent(IMFMediaEventQueue *iface, IMFAsyncCallback *callback, IUnknown *state)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p, %p\n", This, callback, state);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_EndGetEvent(IMFMediaEventQueue *iface, IMFAsyncResult *result, IMFMediaEvent **event)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p, %p\n", This, result, event);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_QueueEvent(IMFMediaEventQueue *iface, IMFMediaEvent *event)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, event);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_QueueEventParamVar(IMFMediaEventQueue *iface, MediaEventType met,
|
|
|
|
REFGUID type, HRESULT status, const PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %d, %s, 0x%08x, %p\n", This, met, debugstr_guid(type), status, value);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_QueueEventParamUnk(IMFMediaEventQueue *iface, MediaEventType met, REFGUID type,
|
|
|
|
HRESULT status, IUnknown *unk)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %d, %s, 0x%08x, %p\n", This, met, debugstr_guid(type), status, unk);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfeventqueue_Shutdown(IMFMediaEventQueue *iface)
|
|
|
|
{
|
|
|
|
mfeventqueue *This = impl_from_IMFMediaEventQueue(iface);
|
|
|
|
|
|
|
|
FIXME("%p\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFMediaEventQueueVtbl mfeventqueue_vtbl =
|
|
|
|
{
|
|
|
|
mfeventqueue_QueryInterface,
|
|
|
|
mfeventqueue_AddRef,
|
|
|
|
mfeventqueue_Release,
|
|
|
|
mfeventqueue_GetEvent,
|
|
|
|
mfeventqueue_BeginGetEvent,
|
|
|
|
mfeventqueue_EndGetEvent,
|
|
|
|
mfeventqueue_QueueEvent,
|
|
|
|
mfeventqueue_QueueEventParamVar,
|
|
|
|
mfeventqueue_QueueEventParamUnk,
|
|
|
|
mfeventqueue_Shutdown
|
|
|
|
};
|
|
|
|
|
2017-09-06 09:38:58 +02:00
|
|
|
/***********************************************************************
|
|
|
|
* MFCreateEventQueue (mfplat.@)
|
|
|
|
*/
|
|
|
|
HRESULT WINAPI MFCreateEventQueue(IMFMediaEventQueue **queue)
|
|
|
|
{
|
2017-09-08 13:00:20 +02:00
|
|
|
mfeventqueue *object;
|
2017-09-06 09:38:58 +02:00
|
|
|
|
2017-09-08 13:00:20 +02:00
|
|
|
TRACE("%p\n", queue);
|
2017-09-06 09:38:58 +02:00
|
|
|
|
2017-09-08 13:00:20 +02:00
|
|
|
object = HeapAlloc( GetProcessHeap(), 0, sizeof(*object) );
|
|
|
|
if(!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
object->ref = 1;
|
|
|
|
object->IMFMediaEventQueue_iface.lpVtbl = &mfeventqueue_vtbl;
|
|
|
|
|
|
|
|
*queue = &object->IMFMediaEventQueue_iface;
|
|
|
|
|
|
|
|
return S_OK;
|
2017-09-06 09:38:58 +02:00
|
|
|
}
|
2017-09-08 13:00:12 +02:00
|
|
|
|
|
|
|
typedef struct _mfdescriptor
|
|
|
|
{
|
2018-09-13 01:52:09 +02:00
|
|
|
mfattributes attributes;
|
2017-09-08 13:00:12 +02:00
|
|
|
IMFStreamDescriptor IMFStreamDescriptor_iface;
|
|
|
|
} mfdescriptor;
|
|
|
|
|
|
|
|
static inline mfdescriptor *impl_from_IMFStreamDescriptor(IMFStreamDescriptor *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, mfdescriptor, IMFStreamDescriptor_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_QueryInterface(IMFStreamDescriptor *iface, REFIID riid, void **out)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFAttributes) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFStreamDescriptor))
|
|
|
|
{
|
|
|
|
*out = &This->IMFStreamDescriptor_iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
|
|
|
|
*out = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*out);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfdescriptor_AddRef(IMFStreamDescriptor *iface)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
ULONG ref = InterlockedIncrement(&This->attributes.ref);
|
2017-09-08 13:00:12 +02:00
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfdescriptor_Release(IMFStreamDescriptor *iface)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
ULONG ref = InterlockedDecrement(&This->attributes.ref);
|
2017-09-08 13:00:12 +02:00
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
2018-09-13 01:52:09 +02:00
|
|
|
heap_free(This);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetItem(IMFStreamDescriptor *iface, REFGUID key, PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetItem(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetItemType(IMFStreamDescriptor *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetItemType(&This->attributes.IMFAttributes_iface, key, type);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_CompareItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_CompareItem(&This->attributes.IMFAttributes_iface, key, value, result);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_Compare(IMFStreamDescriptor *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type,
|
|
|
|
BOOL *result)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_Compare(&This->attributes.IMFAttributes_iface, theirs, type, result);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 *value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetUINT32(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 *value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetUINT64(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetDouble(IMFStreamDescriptor *iface, REFGUID key, double *value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetDouble(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetGUID(IMFStreamDescriptor *iface, REFGUID key, GUID *value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetGUID(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetStringLength(IMFStreamDescriptor *iface, REFGUID key, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetStringLength(&This->attributes.IMFAttributes_iface, key, length);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetString(IMFStreamDescriptor *iface, REFGUID key, WCHAR *value,
|
|
|
|
UINT32 size, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetString(&This->attributes.IMFAttributes_iface, key, value, size, length);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetAllocatedString(IMFStreamDescriptor *iface, REFGUID key,
|
|
|
|
WCHAR **value, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetAllocatedString(&This->attributes.IMFAttributes_iface, key, value, length);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetBlobSize(IMFStreamDescriptor *iface, REFGUID key, UINT32 *size)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetBlobSize(&This->attributes.IMFAttributes_iface, key, size);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 *buf,
|
|
|
|
UINT32 bufsize, UINT32 *blobsize)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetBlob(&This->attributes.IMFAttributes_iface, key, buf, bufsize, blobsize);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetAllocatedBlob(IMFStreamDescriptor *iface, REFGUID key, UINT8 **buf, UINT32 *size)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetAllocatedBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetUnknown(IMFStreamDescriptor *iface, REFGUID key, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetUnknown(&This->attributes.IMFAttributes_iface, key, riid, ppv);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
2018-09-13 01:52:09 +02:00
|
|
|
static HRESULT WINAPI mfdescriptor_SetItem(IMFStreamDescriptor *iface, REFGUID key, REFPROPVARIANT value)
|
2017-09-08 13:00:12 +02:00
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetItem(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_DeleteItem(IMFStreamDescriptor *iface, REFGUID key)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_DeleteItem(&This->attributes.IMFAttributes_iface, key);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_DeleteAllItems(IMFStreamDescriptor *iface)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_DeleteAllItems(&This->attributes.IMFAttributes_iface);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_SetUINT32(IMFStreamDescriptor *iface, REFGUID key, UINT32 value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetUINT32(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_SetUINT64(IMFStreamDescriptor *iface, REFGUID key, UINT64 value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetUINT64(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_SetDouble(IMFStreamDescriptor *iface, REFGUID key, double value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetDouble(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_SetGUID(IMFStreamDescriptor *iface, REFGUID key, REFGUID value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetGUID(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_SetString(IMFStreamDescriptor *iface, REFGUID key, const WCHAR *value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetString(&This->attributes.IMFAttributes_iface, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_SetBlob(IMFStreamDescriptor *iface, REFGUID key, const UINT8 *buf, UINT32 size)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_SetUnknown(IMFStreamDescriptor *iface, REFGUID key, IUnknown *unknown)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_SetUnknown(&This->attributes.IMFAttributes_iface, key, unknown);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_LockStore(IMFStreamDescriptor *iface)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_LockStore(&This->attributes.IMFAttributes_iface);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_UnlockStore(IMFStreamDescriptor *iface)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_UnlockStore(&This->attributes.IMFAttributes_iface);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetCount(IMFStreamDescriptor *iface, UINT32 *items)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetCount(&This->attributes.IMFAttributes_iface, items);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetItemByIndex(IMFStreamDescriptor *iface, UINT32 index, GUID *key, PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
2018-09-13 01:52:09 +02:00
|
|
|
return IMFAttributes_GetItemByIndex(&This->attributes.IMFAttributes_iface, index, key, value);
|
2017-09-08 13:00:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_CopyAllItems(IMFStreamDescriptor *iface, IMFAttributes *dest)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, dest);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetStreamIdentifier(IMFStreamDescriptor *iface, DWORD *identifier)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, identifier);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfdescriptor_GetMediaTypeHandler(IMFStreamDescriptor *iface, IMFMediaTypeHandler **handler)
|
|
|
|
{
|
|
|
|
mfdescriptor *This = impl_from_IMFStreamDescriptor(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, handler);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFStreamDescriptorVtbl mfdescriptor_vtbl =
|
|
|
|
{
|
|
|
|
mfdescriptor_QueryInterface,
|
|
|
|
mfdescriptor_AddRef,
|
|
|
|
mfdescriptor_Release,
|
|
|
|
mfdescriptor_GetItem,
|
|
|
|
mfdescriptor_GetItemType,
|
|
|
|
mfdescriptor_CompareItem,
|
|
|
|
mfdescriptor_Compare,
|
|
|
|
mfdescriptor_GetUINT32,
|
|
|
|
mfdescriptor_GetUINT64,
|
|
|
|
mfdescriptor_GetDouble,
|
|
|
|
mfdescriptor_GetGUID,
|
|
|
|
mfdescriptor_GetStringLength,
|
|
|
|
mfdescriptor_GetString,
|
|
|
|
mfdescriptor_GetAllocatedString,
|
|
|
|
mfdescriptor_GetBlobSize,
|
|
|
|
mfdescriptor_GetBlob,
|
|
|
|
mfdescriptor_GetAllocatedBlob,
|
|
|
|
mfdescriptor_GetUnknown,
|
|
|
|
mfdescriptor_SetItem,
|
|
|
|
mfdescriptor_DeleteItem,
|
|
|
|
mfdescriptor_DeleteAllItems,
|
|
|
|
mfdescriptor_SetUINT32,
|
|
|
|
mfdescriptor_SetUINT64,
|
|
|
|
mfdescriptor_SetDouble,
|
|
|
|
mfdescriptor_SetGUID,
|
|
|
|
mfdescriptor_SetString,
|
|
|
|
mfdescriptor_SetBlob,
|
|
|
|
mfdescriptor_SetUnknown,
|
|
|
|
mfdescriptor_LockStore,
|
|
|
|
mfdescriptor_UnlockStore,
|
|
|
|
mfdescriptor_GetCount,
|
|
|
|
mfdescriptor_GetItemByIndex,
|
|
|
|
mfdescriptor_CopyAllItems,
|
|
|
|
mfdescriptor_GetStreamIdentifier,
|
|
|
|
mfdescriptor_GetMediaTypeHandler
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI MFCreateStreamDescriptor(DWORD identifier, DWORD count,
|
|
|
|
IMFMediaType **types, IMFStreamDescriptor **descriptor)
|
|
|
|
{
|
|
|
|
mfdescriptor *object;
|
|
|
|
|
|
|
|
TRACE("%d, %d, %p, %p\n", identifier, count, types, descriptor);
|
|
|
|
|
2018-09-13 01:52:09 +02:00
|
|
|
object = heap_alloc(sizeof(*object));
|
2017-09-08 13:00:12 +02:00
|
|
|
if(!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
2018-09-13 01:52:09 +02:00
|
|
|
init_attribute_object(&object->attributes, 0);
|
2017-09-08 13:00:12 +02:00
|
|
|
object->IMFStreamDescriptor_iface.lpVtbl = &mfdescriptor_vtbl;
|
|
|
|
*descriptor = &object->IMFStreamDescriptor_iface;
|
2018-09-13 01:52:09 +02:00
|
|
|
|
2017-09-08 13:00:12 +02:00
|
|
|
return S_OK;
|
|
|
|
}
|
2018-09-07 02:58:41 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct _mfbuffer
|
|
|
|
{
|
|
|
|
IMFMediaBuffer IMFMediaBuffer_iface;
|
|
|
|
LONG ref;
|
|
|
|
|
|
|
|
BYTE *buffer;
|
|
|
|
DWORD max_length;
|
|
|
|
DWORD current;
|
|
|
|
} mfbuffer;
|
|
|
|
|
|
|
|
static inline mfbuffer *impl_from_IMFMediaBuffer(IMFMediaBuffer *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, mfbuffer, IMFMediaBuffer_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfbuffer_QueryInterface(IMFMediaBuffer *iface, REFIID riid, void **out)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFMediaBuffer))
|
|
|
|
{
|
|
|
|
*out = &This->IMFMediaBuffer_iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
|
|
|
|
*out = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*out);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfbuffer_AddRef(IMFMediaBuffer *iface)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfbuffer_Release(IMFMediaBuffer *iface)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
heap_free(This->buffer);
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfbuffer_Lock(IMFMediaBuffer *iface, BYTE **buffer, DWORD *max, DWORD *current)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
|
|
|
|
TRACE("%p, %p %p, %p\n", This, buffer, max, current);
|
|
|
|
|
|
|
|
if(!buffer)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*buffer = This->buffer;
|
|
|
|
if(max)
|
|
|
|
*max = This->max_length;
|
|
|
|
if(current)
|
|
|
|
*current = This->current;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfbuffer_Unlock(IMFMediaBuffer *iface)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
|
|
|
|
TRACE("%p\n", This);
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfbuffer_GetCurrentLength(IMFMediaBuffer *iface, DWORD *current)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
|
|
|
|
TRACE("%p\n", This);
|
|
|
|
|
|
|
|
if(!current)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*current = This->current;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfbuffer_SetCurrentLength(IMFMediaBuffer *iface, DWORD current)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
|
|
|
|
TRACE("%p, %u\n", This, current);
|
|
|
|
|
|
|
|
if(current > This->max_length)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
This->current = current;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfbuffer_GetMaxLength(IMFMediaBuffer *iface, DWORD *max)
|
|
|
|
{
|
|
|
|
mfbuffer *This = impl_from_IMFMediaBuffer(iface);
|
|
|
|
|
|
|
|
TRACE("%p, %p\n", This, max);
|
|
|
|
|
|
|
|
if(!max)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
*max = This->max_length;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFMediaBufferVtbl mfbuffer_vtbl =
|
|
|
|
{
|
|
|
|
mfbuffer_QueryInterface,
|
|
|
|
mfbuffer_AddRef,
|
|
|
|
mfbuffer_Release,
|
|
|
|
mfbuffer_Lock,
|
|
|
|
mfbuffer_Unlock,
|
|
|
|
mfbuffer_GetCurrentLength,
|
|
|
|
mfbuffer_SetCurrentLength,
|
|
|
|
mfbuffer_GetMaxLength
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI MFCreateMemoryBuffer(DWORD max_length, IMFMediaBuffer **buffer)
|
|
|
|
{
|
|
|
|
mfbuffer *object;
|
|
|
|
BYTE *bytes;
|
|
|
|
|
|
|
|
TRACE("%u, %p\n", max_length, buffer);
|
|
|
|
|
|
|
|
if(!buffer)
|
|
|
|
return E_INVALIDARG;
|
|
|
|
|
|
|
|
object = heap_alloc( sizeof(*object) );
|
|
|
|
if(!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
bytes = heap_alloc( max_length );
|
|
|
|
if(!bytes)
|
|
|
|
{
|
|
|
|
heap_free(object);
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
object->ref = 1;
|
|
|
|
object->max_length = max_length;
|
|
|
|
object->current = 0;
|
|
|
|
object->buffer = bytes;
|
|
|
|
object->IMFMediaBuffer_iface.lpVtbl = &mfbuffer_vtbl;
|
|
|
|
*buffer = &object->IMFMediaBuffer_iface;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
2018-09-13 01:52:11 +02:00
|
|
|
|
|
|
|
typedef struct _mfsample
|
|
|
|
{
|
|
|
|
mfattributes attributes;
|
|
|
|
IMFSample IMFSample_iface;
|
|
|
|
} mfsample;
|
|
|
|
|
|
|
|
static inline mfsample *impl_from_IMFSample(IMFSample *iface)
|
|
|
|
{
|
|
|
|
return CONTAINING_RECORD(iface, mfsample, IMFSample_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_QueryInterface(IMFSample *iface, REFIID riid, void **out)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), out);
|
|
|
|
|
|
|
|
if(IsEqualGUID(riid, &IID_IUnknown) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFAttributes) ||
|
|
|
|
IsEqualGUID(riid, &IID_IMFSample))
|
|
|
|
{
|
|
|
|
*out = &This->IMFSample_iface;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FIXME("(%s, %p)\n", debugstr_guid(riid), out);
|
|
|
|
*out = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
IUnknown_AddRef((IUnknown*)*out);
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfsample_AddRef(IMFSample *iface)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
ULONG ref = InterlockedIncrement(&This->attributes.ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI mfsample_Release(IMFSample *iface)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
ULONG ref = InterlockedDecrement(&This->attributes.ref);
|
|
|
|
|
|
|
|
TRACE("(%p) ref=%u\n", This, ref);
|
|
|
|
|
|
|
|
if (!ref)
|
|
|
|
{
|
|
|
|
heap_free(This);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ref;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetItem(IMFSample *iface, REFGUID key, PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetItem(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetItemType(IMFSample *iface, REFGUID key, MF_ATTRIBUTE_TYPE *type)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetItemType(&This->attributes.IMFAttributes_iface, key, type);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_CompareItem(IMFSample *iface, REFGUID key, REFPROPVARIANT value, BOOL *result)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_CompareItem(&This->attributes.IMFAttributes_iface, key, value, result);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_Compare(IMFSample *iface, IMFAttributes *theirs, MF_ATTRIBUTES_MATCH_TYPE type,
|
|
|
|
BOOL *result)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_Compare(&This->attributes.IMFAttributes_iface, theirs, type, result);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetUINT32(IMFSample *iface, REFGUID key, UINT32 *value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetUINT32(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetUINT64(IMFSample *iface, REFGUID key, UINT64 *value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetUINT64(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetDouble(IMFSample *iface, REFGUID key, double *value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetDouble(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetGUID(IMFSample *iface, REFGUID key, GUID *value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetGUID(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetStringLength(IMFSample *iface, REFGUID key, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetStringLength(&This->attributes.IMFAttributes_iface, key, length);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetString(IMFSample *iface, REFGUID key, WCHAR *value,
|
|
|
|
UINT32 size, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetString(&This->attributes.IMFAttributes_iface, key, value, size, length);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetAllocatedString(IMFSample *iface, REFGUID key,
|
|
|
|
WCHAR **value, UINT32 *length)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetAllocatedString(&This->attributes.IMFAttributes_iface, key, value, length);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetBlobSize(IMFSample *iface, REFGUID key, UINT32 *size)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetBlobSize(&This->attributes.IMFAttributes_iface, key, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetBlob(IMFSample *iface, REFGUID key, UINT8 *buf,
|
|
|
|
UINT32 bufsize, UINT32 *blobsize)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetBlob(&This->attributes.IMFAttributes_iface, key, buf, bufsize, blobsize);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetAllocatedBlob(IMFSample *iface, REFGUID key, UINT8 **buf, UINT32 *size)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetAllocatedBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetUnknown(IMFSample *iface, REFGUID key, REFIID riid, void **ppv)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetUnknown(&This->attributes.IMFAttributes_iface, key, riid, ppv);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetItem(IMFSample *iface, REFGUID key, REFPROPVARIANT value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetItem(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_DeleteItem(IMFSample *iface, REFGUID key)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_DeleteItem(&This->attributes.IMFAttributes_iface, key);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_DeleteAllItems(IMFSample *iface)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_DeleteAllItems(&This->attributes.IMFAttributes_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetUINT32(IMFSample *iface, REFGUID key, UINT32 value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetUINT32(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetUINT64(IMFSample *iface, REFGUID key, UINT64 value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetUINT64(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetDouble(IMFSample *iface, REFGUID key, double value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetDouble(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetGUID(IMFSample *iface, REFGUID key, REFGUID value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetGUID(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetString(IMFSample *iface, REFGUID key, const WCHAR *value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetString(&This->attributes.IMFAttributes_iface, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetBlob(IMFSample *iface, REFGUID key, const UINT8 *buf, UINT32 size)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetBlob(&This->attributes.IMFAttributes_iface, key, buf, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetUnknown(IMFSample *iface, REFGUID key, IUnknown *unknown)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_SetUnknown(&This->attributes.IMFAttributes_iface, key, unknown);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_LockStore(IMFSample *iface)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_LockStore(&This->attributes.IMFAttributes_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_UnlockStore(IMFSample *iface)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_UnlockStore(&This->attributes.IMFAttributes_iface);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetCount(IMFSample *iface, UINT32 *items)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetCount(&This->attributes.IMFAttributes_iface, items);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetItemByIndex(IMFSample *iface, UINT32 index, GUID *key, PROPVARIANT *value)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
return IMFAttributes_GetItemByIndex(&This->attributes.IMFAttributes_iface, index, key, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_CopyAllItems(IMFSample *iface, IMFAttributes *dest)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, dest);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetSampleFlags(IMFSample *iface, DWORD *flags)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, flags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetSampleFlags(IMFSample *iface, DWORD flags)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %x\n", This, flags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetSampleTime(IMFSample *iface, LONGLONG *sampletime)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, sampletime);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetSampleTime(IMFSample *iface, LONGLONG sampletime)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s\n", This, wine_dbgstr_longlong(sampletime));
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetSampleDuration(IMFSample *iface, LONGLONG *duration)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, duration);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_SetSampleDuration(IMFSample *iface, LONGLONG duration)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %s\n", This, wine_dbgstr_longlong(duration));
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetBufferCount(IMFSample *iface, DWORD *count)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, count);
|
|
|
|
|
|
|
|
if(*count)
|
|
|
|
*count = 0;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetBufferByIndex(IMFSample *iface, DWORD index, IMFMediaBuffer **buffer)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %u, %p\n", This, index, buffer);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_ConvertToContiguousBuffer(IMFSample *iface, IMFMediaBuffer **buffer)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, buffer);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_AddBuffer(IMFSample *iface, IMFMediaBuffer *buffer)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, buffer);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_RemoveBufferByIndex(IMFSample *iface, DWORD index)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %u\n", This, index);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_RemoveAllBuffers(IMFSample *iface)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p\n", This);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_GetTotalLength(IMFSample *iface, DWORD *length)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, length);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI mfsample_CopyToBuffer(IMFSample *iface, IMFMediaBuffer *buffer)
|
|
|
|
{
|
|
|
|
mfsample *This = impl_from_IMFSample(iface);
|
|
|
|
|
|
|
|
FIXME("%p, %p\n", This, buffer);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IMFSampleVtbl mfsample_vtbl =
|
|
|
|
{
|
|
|
|
mfsample_QueryInterface,
|
|
|
|
mfsample_AddRef,
|
|
|
|
mfsample_Release,
|
|
|
|
mfsample_GetItem,
|
|
|
|
mfsample_GetItemType,
|
|
|
|
mfsample_CompareItem,
|
|
|
|
mfsample_Compare,
|
|
|
|
mfsample_GetUINT32,
|
|
|
|
mfsample_GetUINT64,
|
|
|
|
mfsample_GetDouble,
|
|
|
|
mfsample_GetGUID,
|
|
|
|
mfsample_GetStringLength,
|
|
|
|
mfsample_GetString,
|
|
|
|
mfsample_GetAllocatedString,
|
|
|
|
mfsample_GetBlobSize,
|
|
|
|
mfsample_GetBlob,
|
|
|
|
mfsample_GetAllocatedBlob,
|
|
|
|
mfsample_GetUnknown,
|
|
|
|
mfsample_SetItem,
|
|
|
|
mfsample_DeleteItem,
|
|
|
|
mfsample_DeleteAllItems,
|
|
|
|
mfsample_SetUINT32,
|
|
|
|
mfsample_SetUINT64,
|
|
|
|
mfsample_SetDouble,
|
|
|
|
mfsample_SetGUID,
|
|
|
|
mfsample_SetString,
|
|
|
|
mfsample_SetBlob,
|
|
|
|
mfsample_SetUnknown,
|
|
|
|
mfsample_LockStore,
|
|
|
|
mfsample_UnlockStore,
|
|
|
|
mfsample_GetCount,
|
|
|
|
mfsample_GetItemByIndex,
|
|
|
|
mfsample_CopyAllItems,
|
|
|
|
mfsample_GetSampleFlags,
|
|
|
|
mfsample_SetSampleFlags,
|
|
|
|
mfsample_GetSampleTime,
|
|
|
|
mfsample_SetSampleTime,
|
|
|
|
mfsample_GetSampleDuration,
|
|
|
|
mfsample_SetSampleDuration,
|
|
|
|
mfsample_GetBufferCount,
|
|
|
|
mfsample_GetBufferByIndex,
|
|
|
|
mfsample_ConvertToContiguousBuffer,
|
|
|
|
mfsample_AddBuffer,
|
|
|
|
mfsample_RemoveBufferByIndex,
|
|
|
|
mfsample_RemoveAllBuffers,
|
|
|
|
mfsample_GetTotalLength,
|
|
|
|
mfsample_CopyToBuffer
|
|
|
|
};
|
|
|
|
|
|
|
|
HRESULT WINAPI MFCreateSample(IMFSample **sample)
|
|
|
|
{
|
|
|
|
mfsample *object;
|
|
|
|
|
|
|
|
TRACE("%p\n", sample);
|
|
|
|
|
|
|
|
object = heap_alloc(sizeof(*object));
|
|
|
|
if(!object)
|
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
|
|
|
|
init_attribute_object(&object->attributes, 0);
|
|
|
|
object->IMFSample_iface.lpVtbl = &mfsample_vtbl;
|
|
|
|
*sample = &object->IMFSample_iface;
|
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|