void TestDiskInfo() { int hr; int pulNumOfVolumes; int pulVolume; DvdDiscSide pSide; int pulNumOfTitles; int pulDActualSize; hr = m_idi2.GetDVDVolumeInfo(out pulNumOfVolumes, out pulVolume, out pSide, out pulNumOfTitles); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulNumOfTitles == 2, "TestDiskInfo"); StringBuilder sb = new StringBuilder(255, 255); hr = m_idi2.GetDVDDirectory(sb, sb.Capacity, out pulDActualSize); DsError.ThrowExceptionForHR(hr); Debug.Assert(sb.ToString() == MyDisk, "TestDiskInfo2"); long l1; hr = m_idi2.GetDiscID(sb.ToString(), out l1); DsError.ThrowExceptionForHR(hr); Debug.Assert(l1 == 6633412489990086489, "TestDiskInfo3"); DvdMenuAttributes pMATR = new DvdMenuAttributes(); hr = m_idi2.GetVMGAttributes(out pMATR); DsError.ThrowExceptionForHR(hr); Debug.Assert(pMATR.VideoAttributes.sourceResolutionX == 720, "TestDiskInfo4"); }
void TestTitle() { int hr; DvdParentalLevel pulTParentalLevels; int pulNumOfChapters; hr = m_idi2.GetNumberOfChapters(1, out pulNumOfChapters); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulNumOfChapters == 2, "TestTitle"); hr = m_idi2.GetTitleParentalLevels(1, out pulTParentalLevels); DsError.ThrowExceptionForHR(hr); Debug.Assert(pulTParentalLevels == (DvdParentalLevel.Level1 | DvdParentalLevel.Level2 | DvdParentalLevel.Level3 | DvdParentalLevel.Level4 | DvdParentalLevel.Level5 | DvdParentalLevel.Level6 | DvdParentalLevel.Level7 | DvdParentalLevel.Level8), "TestTitle2"); DvdDecoderCaps pCaps = new DvdDecoderCaps(); pCaps.dwSize = Marshal.SizeOf(pCaps); hr = m_idi2.GetDecoderCaps(ref pCaps); DsError.ThrowExceptionForHR(hr); Debug.Assert(pCaps.dwAudioCaps == (DvdAudioCaps.AC3 | DvdAudioCaps.MPEG2 | DvdAudioCaps.DTS | DvdAudioCaps.SDDS), "TestTitle3"); DvdMenuAttributes pMenu = new DvdMenuAttributes(); DvdTitleAttributes pTitle = new DvdTitleAttributes(); hr = m_idi2.GetTitleAttributes(1, out pMenu, pTitle); DsError.ThrowExceptionForHR(hr); Debug.Assert(pMenu.VideoAttributes.sourceResolutionX == 720, "TestDiskInfo4"); Debug.Assert(pTitle.ulNumberOfAudioStreams == 1, "TestTitle5"); }