locked
can't play wma files in WMP using customized Dshow filters? RRS feed

  • Question

  • Hi,

       I have written parser and decoder filters for wma,I use file source async as source filter and default audio renderer.

      I can able to render wma file in graph edit,its automatically detecting my filters,and completing the graph.But WMP is not using my filter.

     I want WMP to use my filters.

     What should i do?

    Regards,

    Vijay P

     

    Friday, February 4, 2011 5:40 AM

Answers

  • If WMP recognizes a file as WindowsMedia, it will always use its own source filter. There is nothing you can do short of heavily hacking the internals of WMP and probably breaking it.
    MVP :: DirectShow / MediaFoundation <http://www.riseoftheants.com/mmx/faq.htm>
    Friday, February 4, 2011 5:11 PM

All replies

  • If WMP recognizes a file as WindowsMedia, it will always use its own source filter. There is nothing you can do short of heavily hacking the internals of WMP and probably breaking it.
    MVP :: DirectShow / MediaFoundation <http://www.riseoftheants.com/mmx/faq.htm>
    Friday, February 4, 2011 5:11 PM
  • thanks for the support.

    Saturday, February 5, 2011 6:31 AM
  • Hi Alessandro,

    I am using wince OS an platfrom builder for building the OS.I can build the OS by disabling the WMA related filters.

    If i do that WMP will take customized filters?

     

    Regards,

    Vijay P

    Monday, February 7, 2011 1:11 PM
  • I never tried doing that.
    MVP :: DirectShow / MediaFoundation <http://www.riseoftheants.com/mmx/faq.htm>
    Monday, February 7, 2011 9:48 PM
  • Hi Alessandro,

    Thanks for the reply.

    I am facing a problem in exiting the ThreadProc function.When pressing stop my Process function is not getting closed ,but continuously it is delivering data to decoder filter .But some time after giving stop if tried to deliver data using the receive function it is giving HRESULT as "VFW_E_WRONG_STATE" at that time its getting closed.

    I want to know how to exit the while loop after pressing the stop?

    Below is my ThreadProc and Process function implementation.

    CPuller::ThreadProc(void) {


        while(1) {


            DWORD cmd = GetRequest();


            switch(cmd) {


                case TM_Exit:
                    Reply(S_OK);
                    return 0;

              

                case TM_Start:
                    Reply(S_OK);
                    Process();
                    break;
            }

        }
    }

     

    void CPuller::Process()
    {
        BOOL bDiscontinuity = TRUE;
       
        DWORD dwRequest;
        bool bContinue(true);
        while (bContinue)
        {
           
            if(CheckRequest(&dwRequest)) {
                return;
            }

            IMediaSample* pSample;

            HRESULT hr = m_pAlloc->GetBuffer(&pSample, NULL, NULL, 0);
            if(FAILED(hr)) {
                OnError(hr);
                return;
            }

            if(bDiscontinuity) {
                pSample->SetDiscontinuity(TRUE);
                bDiscontinuity = FALSE;
            }

            hr = m_parent->Read(m_pReader, pSample);  //to read the data
            if(FAILED(hr)) {
                pSample->Release();
                OnError(hr);
                return;
            }
            if (hr == S_FALSE)
                bContinue = false;

            hr = Receive(pSample);        // to deliver data to decoder filter
            pSample->Release();

            if(hr != S_OK) {
                if(FAILED(hr)) {
                    OnError(hr);
                }
                return;
            }
        }

        EndOfStream();
    }

     

    Tuesday, February 8, 2011 5:57 AM
  • Assuming you are using CAMThread, you need to call CheckRequest() before each iteration of the loop in Process().

    See the source code of CSourceStream::ThreadProc() and CSourceStream::DoBufferProcessingLoop() in "<winsdk>\Samples\multimedia\directshow\baseclasses" (Windows 7.x SDK, not Windows CE SDK).


    MVP :: DirectShow / MediaFoundation <http://www.riseoftheants.com/mmx/faq.htm>
    Tuesday, February 8, 2011 6:21 PM
  • Hi Alessandro,

             Thanks for your support.

             I gave my "m_parent->Read" under critical section ,because of that dead lock happened.

     

     

    Wednesday, February 16, 2011 6:05 AM