CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2007
    Posts
    9

    [RESOLVED] DirectShow filters synchronization

    Hi,

    I am trying to implement a filter graph consisting only of a source
    filter and renderer. This is based on a code base with 3 filters
    impementation - source, transform and renderer.

    The transform filter was doing the decompression of the video stream
    and passing the samples downstream to the renderer. I moved the
    decompressor functionality into the source filter and reconciled the
    media types and transport b/w the source filter and renderer.

    The problem is that the stream stops after decompressing a single
    frame because the second time around the allocator does not return (I
    think because of a deadlock).
    The input pin and output pin of the transform filter were synched
    using the m_csReceive lock. With the transform filter gone, how do I
    go about synchronizing the media stream b/w source and renderer? Do I
    need to override the Receive() method on the renderer input pin?

    The second call (after rendering the first and only frame) IMemAllocator::GetBuffer returns only after I stop the graph and the result is VFW_E_NOT_COMMITTED , although Decommit
    () never gets hit an the m_pAllocator is still a valid pointer.

    Thank you very much in advance.
    Last edited by r_gueorg; September 10th, 2008 at 01:04 PM.

  2. #2
    Join Date
    Dec 2007
    Posts
    9

    Re: [RESOLVED] DirectShow filters synchronization

    The ref count on the IMediaSample* pSample interface ptr was incorrect. So when the input pin tries to allocate a buffer the pSample is not yet available in the pool. A detailed look at "Samples and Allocators" in MSDN DirectShow help was all that was needed. Remember that if the sampe is processed on a worker thread its ref count is increased.

    Hope this helps somebody else developing for DirectShow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured