// pch.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #pragma once // Windows Header Files: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define RESULT_DIAGNOSTICS_LEVEL 4 // include function name #include // must be before the first C++ WinRT header, ref:https://github.com/Microsoft/wil/wiki/Error-handling-helpers #include #include #include "SimpleFrameGenerator.h" #include "SimpleMediaStream.h" #include "SimpleMediaSource.h" #include "SimpleMediaSourceActivate.h" inline void DebugPrint(LPCWSTR szFormat, ...) { WCHAR szBuffer[MAX_PATH] = { 0 }; va_list pArgs; va_start(pArgs, szFormat); StringCbVPrintf(szBuffer, sizeof(szBuffer), szFormat, pArgs); va_end(pArgs); OutputDebugStringW(szBuffer); } #define DEBUG_MSG(msg,...) \ {\ DebugPrint(L"[%s@%d] ", TEXT(__FUNCTION__), __LINE__);\ DebugPrint(msg, __VA_ARGS__);\ DebugPrint(L"\n");\ }\ namespace wilEx { //template //using make_unique_cotaskmem_array = unique_any_array_ptr::type>; template wil::unique_cotaskmem_array_ptr make_unique_cotaskmem_array(size_t numOfElements) { wil::unique_cotaskmem_array_ptr arr; size_t cb = sizeof(wil::details::element_traits::type) * numOfElements; void* ptr = ::CoTaskMemAlloc(cb); if (ptr != nullptr) { ZeroMemory(ptr, cb); arr.reset(reinterpret_cast::type*>(ptr), numOfElements); } return arr; } }; namespace winrt { template<> bool is_guid_of(guid const& id) noexcept; template<> bool is_guid_of(guid const& id) noexcept; template<> bool is_guid_of(guid const& id) noexcept; };