예제 #1
0
        public HResult PlaceMarker(MFStreamSinkMarkerType eMarkerType, ConstPropVariant pvarMarkerValue, ConstPropVariant pvarContextValue)
        {
            Debug.WriteLine("StreamSink:PlaceMarker");

            HResult hr;

            lock (this)
            {
                hr = CheckShutdown();
                if (Failed(hr))
                {
                    return(hr);
                }

                PropVariant markerValue  = new PropVariant();
                PropVariant contextValue = new PropVariant();
                pvarMarkerValue?.Copy(markerValue);
                pvarContextValue?.Copy(contextValue);
                Marker m = new Marker(eMarkerType, markerValue, contextValue);

                hr = ProcessSampleInternal(m);
                if (Failed(hr))
                {
                    return(hr);
                }
            }
            return(hr);
        }
예제 #2
0
 // IMarker methods
 public void GetMarkerType(out MFStreamSinkMarkerType pType)
 {
     TRACE("CMarker::GetMarkerType");
     pType = m_eMarkerType;
 }
예제 #3
0
        public CMarker(
            MFStreamSinkMarkerType eMarkerType,
            ConstPropVariant pvarMarkerValue,     // Can be null.
            ConstPropVariant pvarContextValue    // Can be null.
            )
        {
            TRACE("CMarker::MFStreamSinkMarkerType");
            m_eMarkerType = eMarkerType;

            // Copy the marker data.
            if (pvarMarkerValue != null)
            {
                m_varMarkerValue = new PropVariant(pvarMarkerValue);
            }
            else
            {
                m_varMarkerValue = new PropVariant();
            }

            if (pvarContextValue != null)
            {
                m_varContextValue = new PropVariant(pvarContextValue);
            }
            else
            {
                m_varContextValue = new PropVariant();
            }
        }
예제 #4
0
        //-------------------------------------------------------------------
        // Name: PlaceMarker
        // Description: Receives a marker. [Asynchronous]
        //
        // Note: The client can call PlaceMarker at any time. In response,
        //       we need to queue an MEStreamSinkMarer event, but not until
        //       *after* we have processed all samples that we have received
        //       up to this point.
        //
        //       Also, in general you might need to handle specific marker
        //       types, although this sink does not.
        //-------------------------------------------------------------------
        public int PlaceMarker(
            MFStreamSinkMarkerType eMarkerType,
            ConstPropVariant pvarMarkerValue,
            ConstPropVariant pvarContextValue)
        {
            TRACE("CWavStream::PlaceMarker");

            lock (this)
            {
                IMarker pMarker = null;

                CheckShutdown();

                ValidateOperation(CAsyncOperation.StreamOperation.OpPlaceMarker);

                // Create a marker object and put it on the sample queue.
                pMarker = new CMarker(
                    eMarkerType,
                    pvarMarkerValue,
                    pvarContextValue);

                m_SampleQueue.Enqueue(pMarker);

                // Unless we are paused, start an async operation to dispatch the next sample/marker.
                if (m_state != State.Paused)
                {
                    // Queue the operation.
                    QueueAsyncOperation(CAsyncOperation.StreamOperation.OpPlaceMarker); // Increments ref count on pOp.
                }
            }
            return S_Ok;
        }
예제 #5
0
 public Marker(MFStreamSinkMarkerType type, PropVariant markerValue, PropVariant contextValue)
 {
     Type         = type;
     MarkerValue  = markerValue;
     ContextValue = contextValue;
 }