MCPcopy Create free account
hub / github.com/Nevcairiel/LAVFilters / GetFilteredFormat

Method GetFilteredFormat

decoder/LAVVideo/LAVPixFmtConverter.cpp:206–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206LAVOutPixFmts CLAVPixFmtConverter::GetFilteredFormat(int index)
207{
208 LAV_INOUT_PIXFMT_MAP *pixFmtMap = lookupFormatMap(m_InputPixFmt, m_InBpp);
209 int actualIndex = -1;
210 for (int i = 0; i < LAVOutPixFmt_NB; ++i)
211 {
212 if (m_pSettings->GetPixelFormat(pixFmtMap->lav_pix_fmts[i]))
213 actualIndex++;
214 if (index == actualIndex)
215 return pixFmtMap->lav_pix_fmts[i];
216 }
217
218 // If no format is enabled, we use the fallback formats to avoid catastrophic failure
219 if (index >= LAVOutPixFmt_NB)
220 index = 0;
221 return lav_pixfmt_map[0].lav_pix_fmts[index];
222}
223
224LAVOutPixFmts CLAVPixFmtConverter::GetPreferredOutput()
225{

Callers

nothing calls this directly

Calls 2

lookupFormatMapFunction · 0.85
GetPixelFormatMethod · 0.45

Tested by

no test coverage detected