MCPcopy Create free account
hub / github.com/Aleksoid1978/VideoRenderer / MediaType2Str

Function MediaType2Str

Source/Helper.cpp:59–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59std::wstring MediaType2Str(const CMediaType *pmt)
60{
61 if (!pmt) {
62 return L"no media type";
63 }
64
65 const auto& FmtParams = GetFmtConvParams(pmt);
66
67 std::wstring str(L"MajorType : ");
68 str.append((pmt->majortype == MEDIATYPE_Video) ? L"Video" : L"unknown");
69
70 str += std::format(L"\nSubType : {}", FmtParams.str);
71
72 str.append(L"\nFormatType: ");
73 if (pmt->formattype == FORMAT_VideoInfo2) {
74 str.append(L"VideoInfo2");
75 const VIDEOINFOHEADER2* vih2 = (VIDEOINFOHEADER2*)pmt->pbFormat;
76 str += std::format(L"\nBimapSize : {} x {}", vih2->bmiHeader.biWidth, vih2->bmiHeader.biHeight);
77 str += std::format(L"\nSourceRect: ({}, {}, {}, {})", vih2->rcSource.left, vih2->rcSource.top, vih2->rcSource.right, vih2->rcSource.bottom);
78 str += std::format(L"\nSizeImage : {} bytes", vih2->bmiHeader.biSizeImage);
79 }
80 else if (pmt->formattype == FORMAT_VideoInfo) {
81 str.append(L"VideoInfo");
82 const VIDEOINFOHEADER* vih = (VIDEOINFOHEADER*)pmt->pbFormat;
83 str += std::format(L"\nBimapSize : {} x {}", vih->bmiHeader.biWidth, vih->bmiHeader.biHeight);
84 str += std::format(L"\nSourceRect: ({}, {}, {}, {})", vih->rcSource.left, vih->rcSource.top, vih->rcSource.right, vih->rcSource.bottom);
85 str += std::format(L"\nSizeImage : {} bytes", vih->bmiHeader.biSizeImage);
86 }
87 else {
88 str.append(L"unknown");
89 }
90
91 return str;
92}
93
94const wchar_t* D3DFormatToString(const D3DFORMAT format)
95{

Callers 2

SetMediaTypeMethod · 0.85
GetBufferMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected