-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENH] MediaFoundation: Add VirtualCamera support (mfvirtualcamera.h)
- Loading branch information
1 parent
cc2dda5
commit cfe0eb7
Showing
8 changed files
with
144 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) Amer Koleci and Contributors. | ||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. | ||
|
||
using SharpGen.Runtime; | ||
using Vortice.Mathematics; | ||
using Vortice.Win32; | ||
|
||
namespace Vortice.MediaFoundation; | ||
|
||
public unsafe partial class IMFVirtualCamera | ||
{ | ||
public Result AddProperty(DevPropertyKey key, DevPropertyType type, byte[] data) | ||
{ | ||
fixed (byte* pbData = data) | ||
return AddProperty(ref key, (uint)type, pbData, (uint)data.Length); | ||
} | ||
|
||
public Result AddProperty(DevPropertyKey key, DevPropertyType type, Span<byte> data) | ||
{ | ||
fixed (byte* pbData = data) | ||
return AddProperty(ref key, (uint)type, pbData, (uint)data.Length); | ||
} | ||
|
||
public Result AddProperty<T>(DevPropertyKey key, DevPropertyType type, Span<T> data) | ||
where T : unmanaged | ||
{ | ||
fixed (T* pbData = data) | ||
return AddProperty(ref key, (uint)type, pbData, (uint)(sizeof(T) * data.Length)); | ||
} | ||
|
||
public Result AddRegistryEntry(string entryName, string subkeyPath, int regType, byte[] data) | ||
{ | ||
fixed (byte* pbData = data) | ||
return AddRegistryEntry(entryName, subkeyPath, regType, pbData, (uint)data.Length); | ||
} | ||
|
||
public Result AddRegistryEntry(string entryName, string subkeyPath, int regType, Span<byte> data) | ||
{ | ||
fixed (byte* pbData = data) | ||
return AddRegistryEntry(entryName, subkeyPath, regType, pbData, (uint)data.Length); | ||
} | ||
|
||
public Result AddRegistryEntry<T>(string entryName, string subkeyPath, int regType, Span<T> data) | ||
where T : unmanaged | ||
{ | ||
fixed (T* pbData = data) | ||
return AddRegistryEntry(entryName, subkeyPath, regType, pbData, (uint)(sizeof(T) * data.Length)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters