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); }
// IMarker methods public void GetMarkerType(out MFStreamSinkMarkerType pType) { TRACE("CMarker::GetMarkerType"); pType = m_eMarkerType; }
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(); } }
//------------------------------------------------------------------- // 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; }
public Marker(MFStreamSinkMarkerType type, PropVariant markerValue, PropVariant contextValue) { Type = type; MarkerValue = markerValue; ContextValue = contextValue; }