private void TestRegister() { int hr; IEnumDMO idmo; Guid g = Guid.NewGuid(); Guid g2 = Guid.NewGuid(); Debug.WriteLine(g); Debug.WriteLine(g2); DMOPartialMediatype [] pIn = new DMOPartialMediatype[2]; pIn[0] = new DMOPartialMediatype(); pIn[0].type = g2; pIn[0].subtype = MediaSubType.RGB24; pIn[1] = new DMOPartialMediatype(); pIn[1].type = g2; pIn[1].subtype = MediaSubType.RGB32; DMOPartialMediatype [] pOut = new DMOPartialMediatype[2]; pOut[0] = new DMOPartialMediatype(); pOut[0].type = g2; pOut[0].subtype = MediaSubType.RGB24; pOut[1] = new DMOPartialMediatype(); pOut[1].type = g2; pOut[1].subtype = MediaSubType.RGB32; hr = DMOUtils.DMORegister("asdffdsa", g, DMOCategory.VideoEffect, DMORegisterFlags.None, pIn.Length, pIn, pOut.Length, pOut ); Debug.Assert(hr == 0, "DMORegister"); DMOPartialMediatype [] tIn = new DMOPartialMediatype[1]; tIn[0].type = g2; tIn[0].subtype = MediaSubType.RGB32; hr = DMOUtils.DMOEnum(Guid.Empty, DMOEnumerator.IncludeKeyed, tIn.Length, tIn, 0, null, out idmo); DMOError.ThrowExceptionForHR(hr); int iCnt1 = CountEm(idmo); Debug.Assert(iCnt1 == 1, "DMORegister"); hr = DMOUtils.DMOUnregister(g, DMOCategory.VideoEffect); DMOError.ThrowExceptionForHR(hr); int iCnt2 = CountEm(idmo); Debug.Assert(iCnt2 == 0, "DMOUnregister"); }
static private void UnregisterFunction(Type t) { int hr = DMOUtils.DMOUnregister(typeof(DmoSplit).GUID, DMOCat); }
private static void UnregisterFunction(Type t) { int hr = DMOUtils.DMOUnregister(typeof(DmoOverlay).GUID, DMOCat); DMOError.ThrowExceptionForHR(hr); }