Harlinn.Windows 0.1
|
#include <HWStreamingMediaSink.h>
Public Member Functions | |
virtual HRESULT STDMETHODCALLTYPE | GetEvent (DWORD dwFlags, __RPC__deref_out_opt IMFMediaEvent **ppEvent) override |
Retrieves the next event in the queue. This method is synchronous. | |
virtual HRESULT STDMETHODCALLTYPE | BeginGetEvent (IMFAsyncCallback *pCallback, IUnknown *punkState) override |
Begins an asynchronous request for the next event in the queue. | |
virtual HRESULT STDMETHODCALLTYPE | EndGetEvent (IMFAsyncResult *pResult, _Out_ IMFMediaEvent **ppEvent) override |
Completes an asynchronous request for the next event in the queue. | |
virtual HRESULT STDMETHODCALLTYPE | QueueEvent (MediaEventType met, __RPC__in REFGUID guidExtendedType, HRESULT hrStatus, __RPC__in_opt const PROPVARIANT *pvValue) override |
Puts a new event in the object's queue. | |
virtual HRESULT STDMETHODCALLTYPE | GetMediaSink (__RPC__deref_out_opt IMFMediaSink **ppMediaSink) override |
Retrieves the media sink that owns this stream sink. | |
virtual HRESULT STDMETHODCALLTYPE | GetIdentifier (__RPC__out DWORD *pdwIdentifier) override |
Retrieves the stream identifier for this stream sink. | |
virtual HRESULT STDMETHODCALLTYPE | GetMediaTypeHandler (__RPC__deref_out_opt IMFMediaTypeHandler **ppHandler) override |
Retrieves the media type handler for the stream sink. You can use the media type handler to find which formats the stream supports, and to set the media type on the stream. | |
virtual HRESULT STDMETHODCALLTYPE | ProcessSample (__RPC__in_opt IMFSample *pSample) override |
Delivers a sample to the stream. The media sink processes the sample. | |
virtual HRESULT STDMETHODCALLTYPE | PlaceMarker (MFSTREAMSINK_MARKER_TYPE eMarkerType, __RPC__in const PROPVARIANT *pvarMarkerValue, __RPC__in const PROPVARIANT *pvarContextValue) override |
Places a marker in the stream. | |
virtual HRESULT STDMETHODCALLTYPE | Flush () override |
Causes the stream sink to drop any samples that it has received and has not rendered yet. | |
virtual HRESULT STDMETHODCALLTYPE | IsMediaTypeSupported (IMFMediaType *pMediaType, _Outptr_opt_result_maybenull_ IMFMediaType **ppMediaType) override |
Queries whether the object supports a specified media type. | |
virtual HRESULT STDMETHODCALLTYPE | GetMediaTypeCount (__RPC__out DWORD *pdwTypeCount) override |
Retrieves the number of media types in the object's list of supported media types. | |
virtual HRESULT STDMETHODCALLTYPE | GetMediaTypeByIndex (DWORD dwIndex, _Outptr_ IMFMediaType **ppType) override |
Retrieves a media type from the object's list of supported media types. | |
virtual HRESULT STDMETHODCALLTYPE | SetCurrentMediaType (IMFMediaType *pMediaType) override |
Sets the object's media type. | |
virtual HRESULT STDMETHODCALLTYPE | GetCurrentMediaType (_Outptr_ IMFMediaType **ppMediaType) override |
Retrieves the current media type of the object. | |
virtual HRESULT STDMETHODCALLTYPE | GetMajorType (__RPC__out GUID *pguidMajorType) override |
Gets the major media type of the object. | |
Private Attributes | |
DWORD | streamId_ = 0 |
|
inlineoverridevirtual |
Begins an asynchronous request for the next event in the queue.
pCallback | Pointer to the IMFAsyncCallback interface of a callback object. The client must implement this interface. |
punkState | Pointer to the IUnknown interface of a state object, defined by the caller. This parameter can be NULL. You can use this object to hold state information. The object is returned to the caller when the callback is invoked. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
When a new event is available, the event generator calls the IMFAsyncCallback::Invoke method. The Invoke method should call IMFMediaEventGenerator::EndGetEvent to get a pointer to the IMFMediaEvent interface, and use that interface to examine the event.
Do not call BeginGetEvent a second time before calling EndGetEvent. While the first call is still pending, additional calls to the same object will fail. Also, the IMFMediaEventGenerator::GetEvent method fails if an asynchronous request is still pending.
|
inlineoverridevirtual |
Completes an asynchronous request for the next event in the queue.
pResult | Pointer to the IMFAsyncResult interface. Pass in the same pointer that your callback object received in the Invoke method. |
ppEvent | Receives a pointer to the IMFMediaEvent interface. The caller must release the interface. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
Call this method from inside your application's IMFAsyncCallback::Invoke method.
|
inlineoverridevirtual |
Causes the stream sink to drop any samples that it has received and has not rendered yet.
The method returns an HRESULT. Possible values include, but are not limited to, the following:
If any samples are still queued from previous calls to the IMFStreamSink::ProcessSample method, the media sink immediately discards them, without processing them. This can cause a glitch in the rendered output. The running state of the sink (running, paused, or stopped) does not change.
Any pending marker events from the IMFStreamSink::PlaceMarker method are dispatched immediately, with the status code E_ABORT.
This method is synchronous. It does not return until the sink has discarded all pending samples.
|
inlineoverridevirtual |
Retrieves the current media type of the object.
ppMediaType | Receives a pointer to the IMFMediaType interface. The caller must release the interface. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
|
inlineoverridevirtual |
Retrieves the next event in the queue. This method is synchronous.
dwFlags |
Specifies one of the following values:
ppEvent | Receives a pointer to the IMFMediaEvent interface. The caller must release the interface. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
This method executes synchronously.
If the queue already contains an event, the method returns S_OK immediately. If the queue does not contain an event, the behavior depends on the value of dwFlags:
This method returns MF_E_MULTIPLE_SUBSCRIBERS if you previously called IMFMediaEventGenerator::BeginGetEvent and have not yet called IMFMediaEventGenerator::EndGetEvent.
|
inlineoverridevirtual |
Retrieves the stream identifier for this stream sink.
pdwIdentifier | Receives the stream identifier. If this stream sink was added by calling IMFMediaSink::AddStreamSink, the stream identifier is in the dwStreamSinkIdentifier parameter of that method. Otherwise, the media sink defines the identifier. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
|
inlineoverridevirtual |
Gets the major media type of the object.
pguidMajorType | Receives a GUID that identifies the major type. For a list of possible values, see Major Media Types. |
The major type identifies what kind of data is in the stream, such as audio or video. To get the specific details of the format, call IMFMediaTypeHandler::GetCurrentMediaType.
|
inlineoverridevirtual |
Retrieves the media sink that owns this stream sink.
ppMediaSink | Receives a pointer to the media sink's IMFMediaSink interface. The caller must release the interface. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
|
inlineoverridevirtual |
Retrieves a media type from the object's list of supported media types.
dwIndex | Zero-based index of the media type to retrieve. To get the number of media types in the list, call IMFMediaTypeHandler::GetMediaTypeCount. |
ppType | Receives a pointer to the IMFMediaType interface. The caller must release the interface. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
Media types are returned in the approximate order of preference. The list of supported types is not guaranteed to be complete. To test whether a particular media type is supported, call IMFMediaTypeHandler::IsMediaTypeSupported.
|
inlineoverridevirtual |
Retrieves the number of media types in the object's list of supported media types.
pdwTypeCount | Receives the number of media types in the list. |
To get the supported media types, call IMFMediaTypeHandler::GetMediaTypeByIndex.
For a media source, the media type handler for each stream must contain at least one supported media type. For media sinks, the media type handler for each stream might contain zero media types. In that case, the application must provide the media type. To test whether a particular media type is supported, call IMFMediaTypeHandler::IsMediaTypeSupported.
|
inlineoverridevirtual |
Retrieves the media type handler for the stream sink. You can use the media type handler to find which formats the stream supports, and to set the media type on the stream.
ppHandler | Receives a pointer to the IMFMediaTypeHandler interface. The caller must release the interface. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
If the stream sink currently does not support any media types, this method returns a media type handler that fails any calls to IMFMediaTypeHandler::GetCurrentMediaType and IMFMediaTypeHandler::IsMediaTypeSupported.
|
inlineoverridevirtual |
Queries whether the object supports a specified media type.
pMediaType | Pointer to the IMFMediaType interface of the media type to check. |
ppMediaType | Receives a pointer to the IMFMediaType interface of the closest matching media type, or receives the value NULL. If non-NULL, the caller must release the interface. This parameter can be NULL. See Remarks. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
If the object supports the media type given in pMediaType, the method returns S_OK. For a media source, it means the source can generate data that conforms to that media type. For a media sink, it means the sink can receive data that conforms to that media type. If the object does not support the media type, the method fails.
The ppMediaType parameter is optional. If the method fails, the object might use ppMediaType to return a media type that the object does support, and which closely matches the one given in pMediaType. The method is not guaranteed to return a media type in ppMediaType. If no type is returned, this parameter receives a NULL pointer. If the method succeeds, this parameter receives a NULL pointer. If the caller sets ppMediaType to NULL, this parameter is ignored.
|
inlineoverridevirtual |
Places a marker in the stream.
eMarkerType | Specifies the marker type, as a member of the MFSTREAMSINK_MARKER_TYPE enumeration. |
pvarMarkerValue | Optional pointer to a PROPVARIANT that contains additional information related to the marker. The meaning of this value depends on the marker type. This parameter can be NULL. |
pvarContextValue | Optional pointer to a PROPVARIANT that is attached to the MEStreamSinkMarker event. Call IMFMediaEvent::GetValue to get this value from the event. The caller can use this information for any purpose. This parameter can be NULL. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
This method causes the stream sink to send an MEStreamSinkMarker event after the stream sink consumes all of the samples that were delivered up to this point (before the call to PlaceMarker).
|
inlineoverridevirtual |
Delivers a sample to the stream. The media sink processes the sample.
pSample | Pointer to the IMFSample interface of a sample that contains valid data for the stream. |
Call this method when the stream sink sends an MEStreamSinkRequestSample event.
This method can return MF_E_INVALID_TIMESTAMP for various reasons, depending on the implementation of the media sink:
Not every media sink returns an error code in these situations.
|
inlineoverridevirtual |
Puts a new event in the object's queue.
met | Specifies the event type. The event type is returned by the event's IMFMediaEvent::GetType method. For a list of event types, see Media Foundation Events. The extended type. If the event does not have an extended type, use the value GUID_NULL. The extended type is returned by the event's IMFMediaEvent::GetExtendedType method. A success or failure code indicating the status of the event. This value is returned by the event's IMFMediaEvent::GetStatus method. Pointer to a PROPVARIANT that contains the event value. This parameter can be NULL. This value is returned by the event's IMFMediaEvent::GetValue method. |
|
inlineoverridevirtual |
Sets the object's media type.
pMediaType | Pointer to the IMFMediaType interface of the new media type. |
The method returns an HRESULT. Possible values include, but are not limited to, the following:
For media sources, setting the media type means the source will generate data that conforms to that media type. For media sinks, setting the media type means the sink can receive data that conforms to that media type.
Any implementation of this method should check whether pMediaType differs from the object's current media type. If the types are identical, the method should return S_OK but avoid releasing and recreating resources unnecessarily. If the types are not identical, the method should validate the new type.
</remakrs>
|
private |