Ejemplo n.º 1
0
        // ----- Public Methods -----------------------------------------------
        //////////////////////////////////////////////////////////////////////////
        //  Name: CPlayer
        //  Description: Constructor
        //
        /////////////////////////////////////////////////////////////////////////

        public CPlayer(IntPtr hWnd)
        {
            m_hWnd                   = hWnd;
            m_pMediaSession          = null;
            m_pSequencerSource       = null;
            m_pAudioRendererActivate = null;
            m_pPresentationClock     = null;
            m_PresentationTimeOffset = 0;
            m_phnsTimePairStart      = null;
            m_phnsTimePairEnd        = null;
            m_State                  = PlayerState.PlayerCreated;
            m_ActiveSegment          = -1;
            m_hCloseEvent            = new AutoResetEvent(false);
        }
        private void SetFirstTopology(IMFSequencerSource pSequencerSource, IMFMediaSession pMediaSession)
        {
            IMFMediaSource pMediaSource;
            IMFPresentationDescriptor pPresentationDescriptor;
            IMFMediaSourceTopologyProvider pMediaSourceTopologyProvider;
            IMFTopology pTopology;

            pMediaSource = pSequencerSource as IMFMediaSource;

            // Create the presentation descriptor for the media source.
            int hr = pMediaSource.CreatePresentationDescriptor(out pPresentationDescriptor);
            MFError.ThrowExceptionForHR(hr);

            // Get the topology provider from the sequencer source.
            pMediaSourceTopologyProvider = pSequencerSource as IMFMediaSourceTopologyProvider;
            // Get the first topology from the topology provider.
            hr = pMediaSourceTopologyProvider.GetMediaSourceTopology(pPresentationDescriptor, out pTopology);
            MFError.ThrowExceptionForHR(hr);

            // Set the topology on the media session.
            hr = pMediaSession.SetTopology(0, pTopology);
            MFError.ThrowExceptionForHR(hr);
        }
Ejemplo n.º 3
0
 // ----- Public Methods -----------------------------------------------
 //////////////////////////////////////////////////////////////////////////
 //  Name: CPlayer
 //  Description: Constructor
 //
 /////////////////////////////////////////////////////////////////////////
 public CPlayer(IntPtr hWnd)
 {
     m_hWnd = hWnd;
     m_pMediaSession = null;
     m_pSequencerSource = null;
     m_pAudioRendererActivate = null;
     m_pPresentationClock = null;
     m_PresentationTimeOffset = 0;
     m_phnsTimePairStart = null;
     m_phnsTimePairEnd = null;
     m_State = PlayerState.PlayerCreated;
     m_ActiveSegment = -1;
     m_hCloseEvent = new AutoResetEvent(false);
 }
Ejemplo n.º 4
0
 public static extern void MFCreateSequencerSource(
     [MarshalAs(UnmanagedType.IUnknown)] object pReserved,
     out IMFSequencerSource ppSequencerSource
     );