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

Function GetColorFormat

Source/Helper.cpp:263–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

261};
262
263ColorFormat_t GetColorFormat(const CMediaType* pmt)
264{
265 if (pmt) {
266 if (pmt->subtype == MEDIASUBTYPE_RGB24) { return CF_RGB24; }
267 if (pmt->subtype == MEDIASUBTYPE_RGB32) { return CF_XRGB32; }
268 if (pmt->subtype == MEDIASUBTYPE_ARGB32) { return CF_ARGB32; }
269
270 if (memcmp(&pmt->subtype.Data2, &MEDIASUBTYPE_YUY2.Data2, sizeof(GUID) - sizeof(GUID::Data1)) == 0) {
271 return fourcc_to_cformat(pmt->subtype.Data1);
272 }
273 else if (pmt->subtype == MEDIASUBTYPE_LAV_RAWVIDEO) {
274 const BITMAPINFOHEADER* pBIH = GetBIHfromVIHs(pmt);
275 if (pBIH) {
276 return fourcc_to_cformat(pBIH->biCompression);
277 }
278 }
279 }
280 return CF_NONE;
281}
282
283static DX9PlaneConfig DX9PlanesNV12 = { D3DFMT_L8, D3DFMT_A8L8, D3DFMT_UNKNOWN, 2, 2 };
284static DX9PlaneConfig DX9PlanesP01x = { D3DFMT_L16, D3DFMT_G16R16, D3DFMT_UNKNOWN, 2, 2 };

Callers 1

Helper.cppFile · 0.85

Calls 2

fourcc_to_cformatFunction · 0.85
GetBIHfromVIHsFunction · 0.85

Tested by

no test coverage detected