This clock runs as quickly as the sinks consume samples. If every media sink in the pipeline is rateless, the Media Session uses a special rateless presentation clock. Typically this flag applies to archive sinks. A rateless media sink returns the MEDIASINK_RATELESS flag from the GetCharacteristics method. For example, it might glitch during playback.Ī rateless sink is a media sink that ignores the time stamps on samples and consumes data as soon as each sample arrives. If this flag is present and the presentation clock uses a different presentation time source, the media sink is likely to perform poorly. If a media sink cannot match rates with a clock other than its own, the GetCharacteristics method returns the MEDIASINK_CANNOT_MATCH_CLOCK flag. It must always use the time from the presentation clock, regardless of whether the presentation clock is driven by the media sink itself, or by some other clock. However, the media sink cannot assume this to be the case. This means that a media sink might schedule samples against a time provided by its own clock. Some media sinks have access to an accurate clock, so they expose this interface. Presentation time sources expose the IMFPresentationTimeSource interface. The presentation clock derives its clock times from another object called the presentation time source. When the media sink receives a new sample, it gets the time stamp from the sample and tries to render the sample at that presentation time. To determine when it should render samples. The media sink receives these notifications through the IMFClockStateSink interface, which all media sinks must implement. To receive notifications when streaming starts or stops. The media sink uses the presentation clock for two purposes: Every media sink requires a presentation clock to run. The presentation clock must be set on the media sink before streaming can begin. The Media Session selects the presentation clock and sets it on the media sink by calling the media sink's IMFMediaSink::SetPresentationClock method. The rate at which a media sink consumes samples is controlled by the Presentation Clock. To get a stream sink by its identifier, call IMFMediaSink::GetStreamSinkById. For example, an archive sink might write the stream identifiers into the file header. Depending on the media sink, the stream identifiers might have some meaning that is related to the content. Stream identifiers are unique within the media sink, but do not have to be consecutive. To enumerate them by index value, call the IMFMediaSink::GetStreamSinkByIndex method. (It might support some other way to configure the number of streams, for example by setting initialization parameters when the sink is created.) The list of stream sinks is ordered. The MEDIASINK_FIXED_STREAMS flag indicates that the media sink does not support these two methods. To remove a stream sink, call IMFMediaSink::RemoveStreamSink. To add a new stream sink, call IMFMediaSink::AddStreamSink. Otherwise, you can add and remove stream sinks. If it has a fixed number of stream sinks, the IMFMediaSink::GetCharacteristics method returns the MEDIASINK_FIXED_STREAMS flag. You should read the remainder of this topic if you are writing a custom media sink, or if you want to use a media sink directly without the Media Session.Ī media sink can have a fixed number of stream sinks, or it can support adding and removing stream sinks. For more information about activation objects, see Activation Objects. All other operations on the sink are handled by the Media Session, and the application does not call any methods on the media sink or any of the stream sinks. Instead, the application creates one or more activation objects, which the Media Session uses to create the sink. Typically an application does not create media sinks directly. Stream sinks expose the IMFStreamSink interface. Each stream sink receives the data from one stream. Each media sink contains one or more stream sinks. Media sinks expose the IMFMediaSink interface. Instead, it writes the data that it receives as quickly as possible. The main difference between them is that an archive sink does not consume the data at a fixed playback rate. The enhanced video renderer (EVR) displays video frames, and the audio renderer plays audio streams through the sound card or other audio device.Īn archive sink is a media sink that writes data to a file or other storage. Media sinks fall into two general categories:Ī renderer is a media sink that presents data for playback. A media sink is the destination for one or more media streams. Media sinks are the pipeline objects that receive media data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |