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

Method CheckDirectMode

decoder/LAVVideo/LAVVideo.cpp:847–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845}
846
847HRESULT CLAVVideo::CheckDirectMode()
848{
849 LAVPixelFormat pix;
850 int bpp;
851 m_Decoder.GetPixelFormat(&pix, &bpp, nullptr);
852
853 GUID outputSubtype = m_pOutput->CurrentMediaType().subtype;
854
855 BOOL bDirect = (pix == LAVPixFmt_NV12 || pix == LAVPixFmt_P016 || pix == LAVPixFmt_YUY2 || pix == LAVPixFmt_Y216 || pix == LAVPixFmt_AYUV || pix == LAVPixFmt_Y410 || pix == LAVPixFmt_Y416);
856 if (pix == LAVPixFmt_NV12 && m_Decoder.IsInterlaced(FALSE) && m_settings.SWDeintMode != SWDeintMode_None)
857 bDirect = FALSE;
858 else if (pix == LAVPixFmt_NV12 && outputSubtype != MEDIASUBTYPE_NV12 && outputSubtype != MEDIASUBTYPE_YV12)
859 bDirect = FALSE;
860 else if (pix == LAVPixFmt_P016 && outputSubtype != MEDIASUBTYPE_P010 && outputSubtype != MEDIASUBTYPE_P016 &&
861 outputSubtype != MEDIASUBTYPE_NV12)
862 bDirect = FALSE;
863 else if (pix == LAVPixFmt_YUY2 && outputSubtype != MEDIASUBTYPE_YUY2 && outputSubtype != MEDIASUBTYPE_YV16)
864 bDirect = FALSE;
865 else if (pix == LAVPixFmt_Y216 && outputSubtype != MEDIASUBTYPE_P210 && outputSubtype != MEDIASUBTYPE_P216)
866 bDirect = FALSE;
867 else if (pix == LAVPixFmt_AYUV && outputSubtype != MEDIASUBTYPE_AYUV)
868 bDirect = FALSE;
869 else if (pix == LAVPixFmt_Y410 && outputSubtype != MEDIASUBTYPE_Y410)
870 bDirect = FALSE;
871 else if (pix == LAVPixFmt_Y416 && outputSubtype != MEDIASUBTYPE_Y416)
872 bDirect = FALSE;
873 else if (m_SubtitleConsumer && m_SubtitleConsumer->HasProvider())
874 bDirect = FALSE;
875
876 m_Decoder.SetDirectOutput(bDirect);
877
878 return S_OK;
879}
880
881HRESULT CLAVVideo::SetMediaType(PIN_DIRECTION dir, const CMediaType *pmt)
882{

Callers

nothing calls this directly

Calls 4

HasProviderMethod · 0.80
GetPixelFormatMethod · 0.45
IsInterlacedMethod · 0.45
SetDirectOutputMethod · 0.45

Tested by

no test coverage detected