private void TestGetNextSrc() { long start = 0; IAMTimelineObj tlobj; int hr = m_pTrack.GetNextSrc(out tlobj, ref start); DESError.ThrowExceptionForHR(hr); Debug.Assert(tlobj == m_pSourceObj1, "GetNextSrc"); Marshal.ReleaseComObject(tlobj); tlobj = null; start = 100000000; hr = m_pTrack.GetNextSrc(out tlobj, ref start); DESError.ThrowExceptionForHR(hr); Debug.Assert(tlobj == m_pSourceObj2, "GetNextSrc second source"); Marshal.ReleaseComObject(tlobj); tlobj = null; }
private void TestSplice() { int hr; IAMTimelineSplittable ps; IAMTimelineObj pFirst, pSecond; hr = m_pTimeline.CreateEmptyNode(out pFirst, TimelineMajorType.Source); DESError.ThrowExceptionForHR(hr); hr = pFirst.SetStartStop(0, 10000000000); DESError.ThrowExceptionForHR(hr); IAMTimelineSrc pFirstSrc = (IAMTimelineSrc)pFirst; hr = pFirstSrc.SetMediaTimes(0, 10000000000); // Put in the file name hr = pFirstSrc.SetMediaName("foo.avi"); DESError.ThrowExceptionForHR(hr); // Connect the track to the source hr = m_VideoTrack.SrcAdd(pFirst); DESError.ThrowExceptionForHR(hr); // Split the source ps = pFirst as IAMTimelineSplittable; long l = 500000000; hr = ps.SplitAt(l); DESError.ThrowExceptionForHR(hr); // Get the new chunk hr = m_VideoTrack.GetNextSrc(out pSecond, ref l); DESError.ThrowExceptionForHR(hr); // Re-join the two hr = pFirstSrc.SpliceWithNext(pSecond); DESError.ThrowExceptionForHR(hr); }