mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-10-04 17:28:12 -07:00
88a210e82e
## Link to GitHub Issue or related Pull Request, if one exists #201 ## Description of change - Adds MJPEG camera support using Media Foundation decoding. - Moves camera capture to asynchronous Source Reader callbacks. - Supports native NV12 and YUY2 capture, preferring target-sized native formats over MJPEG when possible. - Improves capture and rendering performance through callback-paced reads, bulk frame uploads, optimized row-based flips, and lazy allocation of flip textures. - Makes runtime media-type changes interrupt pending reads and safely flush and reconfigure the Source Reader. - Improves automatic mode selection based on aspect ratio, proximity to 1280x720, frame rate, and capture format. - Hardens camera shutdown, flush handling, media-type changes, and repeated capture failures. ## Testing Tested with two cameras in tdj
33 lines
943 B
C++
33 lines
943 B
C++
#include <mfapi.h>
|
|
#include <mfidl.h>
|
|
#include <mfreadwrite.h>
|
|
#include <mfobjects.h>
|
|
|
|
#pragma once
|
|
|
|
namespace games::iidx {
|
|
void init_mf_library();
|
|
|
|
HRESULT WrappedMFCreateAttributes (
|
|
_Out_ IMFAttributes** ppMFAttributes,
|
|
_In_ UINT32 cInitialSize);
|
|
|
|
HRESULT WrappedMFCreateMediaType (
|
|
_Out_ IMFMediaType** ppMFType);
|
|
|
|
HRESULT WrappedMFEnumDeviceSources (
|
|
_In_ IMFAttributes* pAttributes,
|
|
_Outptr_result_buffer_(*pcSourceActivate) IMFActivate*** pppSourceActivate,
|
|
_Out_ UINT32* pcSourceActivate);
|
|
|
|
HRESULT WrappedMFCreateSourceReaderFromMediaSource (
|
|
_In_ IMFMediaSource *pMediaSource,
|
|
_In_opt_ IMFAttributes *pAttributes,
|
|
_Out_ IMFSourceReader **ppSourceReader);
|
|
|
|
HRESULT WrappedMFGetService (
|
|
IUnknown* punkObject,
|
|
REFGUID guidService,
|
|
REFIID riid,
|
|
_Outptr_ LPVOID* ppvObject);
|
|
} |