How to use IMediaSeeking in filter's pin?
-
Hi All.. I use DirectShow to play raw H.264 file with the following graph: [source]--[cyberlink demux]--[cyberlink H.264/AVC decoder]--[vmr9 renderer] My problem is that I can not use IMediaSeeking to set the position. I think it should be possible to seek the video using the demux filter, but I don't know how :confused: (just get into DirectShow a couple weeks ago :-O ). It would be nice if you have the example, or any site that has it. I was looking at MSDN forum and found that we can put IMediaSeeking on the pin. What does it mean? How to do that? Bunch of thanks in advance! :)
-Houari
-
Hi All.. I use DirectShow to play raw H.264 file with the following graph: [source]--[cyberlink demux]--[cyberlink H.264/AVC decoder]--[vmr9 renderer] My problem is that I can not use IMediaSeeking to set the position. I think it should be possible to seek the video using the demux filter, but I don't know how :confused: (just get into DirectShow a couple weeks ago :-O ). It would be nice if you have the example, or any site that has it. I was looking at MSDN forum and found that we can put IMediaSeeking on the pin. What does it mean? How to do that? Bunch of thanks in advance! :)
-Houari
IMediaSeeking is a COM interface. You can query the filter graph manager to obtain a pointer to the interface (saves you the trouble of finding a certain pin to get the interface on!): IMediaSeeking *pSeeking = 0; hr = pGraphMgr->QueryInterface(IID_IMediaSeeking, reinterpret_cast(&pSeeking)); Note that not all filters support seeking. See Seeking the Filter Graph[^]
"If you can dodge a wrench, you can dodge a ball."
-
IMediaSeeking is a COM interface. You can query the filter graph manager to obtain a pointer to the interface (saves you the trouble of finding a certain pin to get the interface on!): IMediaSeeking *pSeeking = 0; hr = pGraphMgr->QueryInterface(IID_IMediaSeeking, reinterpret_cast(&pSeeking)); Note that not all filters support seeking. See Seeking the Filter Graph[^]
"If you can dodge a wrench, you can dodge a ball."
-
Actually I found out that I can not use seeking for the AVC decoder (by using GetCapabilities). So, I think maybe it is possible to use seeking directly to the demux filter. Is it possible?
-Houari
houari_id wrote:
I think maybe it is possible to use seeking directly to the demux filter. Is it possible?
Have you tried to obtain the IMediaSeeking interface from the filter?
"If you can dodge a wrench, you can dodge a ball."