コード例 #1
0
        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);
        }