Description of PUSH and PULL mode

zhaozj2021-02-11  191

It seems that many people pay attention to the time playback of network data streams. It is required to be delayed. So everyone considers using the PUSH mode. Indeed, the Push mode is for Live Streaming Video. PULL is targeted for file playback. But trouble is, if you want to play with Push and need Splitter Filter, you will have trouble. (If, only playing VIDEO, if you connect to the decoder filter, there should be no such trouble), because it is not all the splitter filter supports the PUSH mode. why? Below will be found below.

PULL Mode: It is required to be an IasyncReader interface. The speed control is that the splitter filter instead of the Source Filter. This is a standard DirectShow mechanism. Outpin must agree to the splitter filter's Allocator Properties. That's why there is no way to change the size of the data block (although you can modify each size, there is no way to change the total size of the data, that is why the required data will be 2, 32768 * 6, 16384 * 12, etc.). During the connection between the splitter, splitter needs to read some data to determine, determine the type, length, and some related information. After the connection, the Filter Graph starts running, and the Splitter Filter will continue to require data from Source Filter, use Is IasyncReader :: syncreadaligned (). Of the render work.

PUSH mode: The flow control is Source Filter. When the connection is started, the splitter does not require data, and all judgment operations are transferred to Decoder. After render, it is the transfer of data. Using CBASEOUTPUTPIN :: getDeliveryBuffer (), in CBaseoutputpin :: Deliver (), it is possible. However, the most important thing is that the Push mode's CBASEOUTPUTPIN requires the IMEMINPUT interface to support! Unfortunately, Not all splitter has this interface. (You can see: "Connects Only to Input Pins That Support The IMEMINPUT INTERFACE.", CsourceStream is inherited from CBASEOUTPUTPIN, so there is the same problem)

Everyone can see that this is two different mechanisms. Therefore, it caused the trouble just now. Not each splitter will support these two modes. Splitter, which does not support the Push mode, will unilaterally request IASYNCREADER support, but your source filter does not support, what should I do? ? ? There is no way ... The result is that there is no way to succeed.

Friends who do MPEG2 have blesses. For MPEG2 playback, Microsoft provides two files to support Source filter.mpeg-2 demultiplexer: This is Filter that supports PUSH mode. You can look at the document: The MPEG -2 Demultiplexer (Demux) operates on MPEG-2 transport and program streams that are delivered in push-mode. (For demultiplexing MPEG-2 program streams that are delivered in pull-mode, such as in file-playback scenarios, use the MPEG -2 splitter filter.) MPEG-2 splitter filter: This is the basic splitter filter. Make MPEG1 friends have to use alternatives: If in PULL mode, the flow length information should be infinite, you can play from play Time is equivalent to Push mode. Although there is no image of Push, the rights of data are not in their own hands, but when there is no better splitter filter, it is still a good alternative, at least I did 1 second delay ( It should not be able to endure :)). If anyone finds the splitter filter that supports Push's MPEG1, I hope to tell everyone ... Thank you :)

Afterainafterain@263.net2001.12.21

转载请注明原文地址:https://www.9cbs.com/read-4301.html

New Post(0)