qt_rtmp_demo/utils/utils.cpp

28 lines
629 B
C++
Raw Normal View History

2023-11-12 16:13:24 +00:00
#include "utils.h"
wstring char2wchar(const char* cchar)
{
/*
wchar_t m_wchar[2000];
int len = MultiByteToWideChar(CP_ACP, 0, cchar, strlen(cchar), NULL, 0);
if (len > 0)
{
MultiByteToWideChar(CP_ACP, 0, cchar, strlen(cchar), m_wchar, len);
m_wchar[len] = L'\0';
return std::wstring(m_wchar);
}*/
return wstring(L"");
}
AVPixelFormat GUIDToAvFormat(GUID mediatype){
if(IsEqualIID(MEDIASUBTYPE_RGB32,mediatype)){
return AV_PIX_FMT_BGRA;
}
2023-11-29 16:22:43 +00:00
if(IsEqualIID(MEDIASUBTYPE_ARGB32,mediatype)){
return AV_PIX_FMT_BGRA;
}
2023-11-12 16:13:24 +00:00
return AV_PIX_FMT_NONE;
}