qt_rtmp_demo/utils/utils.cpp

28 lines
629 B
C++

#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;
}
if(IsEqualIID(MEDIASUBTYPE_ARGB32,mediatype)){
return AV_PIX_FMT_BGRA;
}
return AV_PIX_FMT_NONE;
}