예제 #1
0
        // Methods tested : GetUTCTime
        public void TestBatch1()
        {
            int hr = 0;

            MpegDateAndTime dateAndTime = new MpegDateAndTime();

            hr = tdt.GetUTCTime(out dateAndTime);
            Debug.Assert((hr == 0 && (dateAndTime.ToDateTime() > DateTime.MinValue)), "IDVB_TDT.GetUTCTime failed");
        }
예제 #2
0
        // Methods tested : GetCountOfRecords, GetRecordDuration, GetRecordEventId
        //                  GetRecordFreeCAMode, GetRecordRunningStatus,
        //                  GetRecordStartTime, GetSegmentLastSectionNumber
        //                  GetRecordCountOfDescriptors, GetRecordDescriptorByIndex
        //                  GetRecordDescriptorByTag
        public void TestBatch2()
        {
            int hr          = 0;
            int recordCount = 0;

            hr = eit.GetCountOfRecords(out recordCount);
            Debug.Assert((hr == 0) && (recordCount != 0), "IDVB_EIT.GetCountOfRecords failed");

            for (int i = 0; i < recordCount; i++)
            {
                // the results are dependent to the multiplex
                MpegDuration duration = new MpegDuration();
                hr = eit.GetRecordDuration(i, out duration);
                Debug.Assert((hr == 0) && (duration.ToTimeSpan() > TimeSpan.Zero), "IDVB_EIT.GetRecordDuration failed");

                short eventId = 0;
                hr = eit.GetRecordEventId(i, out eventId);
                Debug.Assert((hr == 0) && (eventId != 0), "IDVB_EIT.GetRecordEventId failed");

                bool freeCAMode = true;
                hr = eit.GetRecordFreeCAMode(i, out freeCAMode);
                Debug.Assert((hr == 0), "IDVB_EIT.GetRecordFreeCAMode failed");

                RunningStatus runningStatus = 0;
                hr = eit.GetRecordRunningStatus(i, out runningStatus);
                Debug.Assert((hr == 0 && (runningStatus != 0)), "IDVB_EIT.GetRecordRunningStatus failed");

                MpegDateAndTime dateAndTime = new MpegDateAndTime();
                hr = eit.GetRecordStartTime(i, out dateAndTime);
                Debug.Assert((hr == 0) && (dateAndTime.ToDateTime() > DateTime.MinValue), "IDVB_EIT.GetRecordStartTime failed");

                int descriptorCount = 0;
                hr = eit.GetRecordCountOfDescriptors(i, out descriptorCount);
                Debug.Assert((hr == 0 && (descriptorCount != 0)), "IDVB_EIT.GetRecordCountOfDescriptors failed");

                IGenericDescriptor descriptor = null;
                byte tag = 0;

                for (int j = 0; j < descriptorCount; j++)
                {
                    hr = eit.GetRecordDescriptorByIndex(i, j, out descriptor);
                    Debug.Assert((hr == 0 && (descriptor != null)), "IDVB_EIT.GetRecordDescriptorByIndex failed");

                    hr = descriptor.GetTag(out tag);
                    DsError.ThrowExceptionForHR(hr);

                    Marshal.ReleaseComObject(descriptor);
                }

                hr = eit.GetRecordDescriptorByTag(i, tag, null, out descriptor);
                Debug.Assert((hr == 0 && (descriptor != null)), "IDVB_EIT.GetRecordDescriptorByTag failed");

                Marshal.ReleaseComObject(descriptor);
            }
        }
예제 #3
0
        // Methods tested : GetUTCTime
        private void TestBatch1()
        {
            int hr = 0;

            MpegDateAndTime dateAndTime = new MpegDateAndTime();

            hr = tot.GetUTCTime(out dateAndTime);
            Debug.Assert((hr == 0) && (dateAndTime.ToDateTime() > DateTime.MinValue), "IDVB_TOT.GetUTCTime failed");

            Debug.WriteLine("Current UTC time is " + dateAndTime.ToDateTime().ToString());
        }