Menu

GSSF Question

Drew
2009-08-31
2012-10-29
  • Drew

    Drew - 2009-08-31

    I'm trying to use the GSSF to feed in h264 encoded bytes. I get these bytes from a SampleGrabber with MediaType-Video and SubType-H264. The SampleGrabber sets up OK.

    I'm trying to set up the GSSF MediaType the same way. (have also tried others) including Stream but i can't get anything to connect to it either SmartConnect or manually connecting the pins to a decoder that does connect in GraphEdit.

    Everything connects ok with the sample using an mpeg video MediaType-Stream and SubType MPEG2Program.

    Am i doing something wrong? Is there something else i have to do in order to feed a byte array into the filter?

    Thank you.

     
    • snarfle

      snarfle - 2009-08-31

      I'm guessing, but perhaps the h264 filter requires a pull filter:

      http://msdn.microsoft.com/en-us/library/dd377480%28VS.85%29.aspx

      You can find out what QI calls are made against the GSSF filter. If it looks like you need to support a pull filter, well, I made one a while back. It didn't seem like folks needed it so I didn't put it in the sample download, but it's checked in to CVS at http://directshownet.cvs.sourceforge.net/viewvc/directshownet/directshowlib/Samples/Misc/GSPF/. Make sure you read the readme.

      Once upon a time, I made a version of the

       
    • Drew

      Drew - 2009-08-31

      Thanks Snarfle, i appreciate that.

      Is there anything about DirectShow you don't know :)

      I'm finding that the "hr = ips.SetEmbedded(typeof(AsyncRdr).GUID);" is not returning 0 to set the COM Object and fails here.

      The filter itself has registered OK and i have also incorporated the "Reader.cs" into the project.

      The Project has been downloaded from the CVS. Is there anything else i need to do that i'm missing. I've read the ReadMe and I can't find anything else.

       
      • snarfle

        snarfle - 2009-09-01

        Looking at the code for SetEmbedded in PullSourceFilter.cpp:


        STDMETHODIMP CPullOutputPin::SetEmbedded(REFIID riid)
        {
        CAutoLock cAutoLock(m_pLock);
        HRESULT hr;

        if (m_obj == NULL)
        {
            // Create an instance of the COM class, get the IUnknown.  Note that we MUST
            // use aggregation, otherwise you can't qi from the embedded object back to the IPin,
            // and there are filters that try to do exactly that.
            hr = CoCreateInstance(riid, GetOwner(), CLSCTX_INPROC_SERVER, IID_IUnknown, (LPVOID *)&m_obj);
        }
        else
        {
            hr = MAKE_HRESULT(1, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED);
        }
        
        return hr;
        

        }

        So, I would say there is something wrong with your COM registration for AsyncRdr. The error number returned might give you some thoughts about what the problem is.

         
    • Drew

      Drew - 2009-09-01

      Thanks again,

      It was the COM AsyncRdr not registered. I had used the Reader.cs in my project as opposed to building the Reader solution and importing the rdr.dll into my bin folder.

      No i can see what this can do.

       
    • Drew

      Drew - 2009-09-01

      Sorry to hastle you,

      In the rdr.dll, i have changed the filestream to a memorystream in the "SetFileName" so that i can parse the byte[] i get from the SampleGrabber.

      I can see that it is reading each frame from the output.

      Is this an ok way to feed the SampleGrabber bytes into this filter or is there a better way?

       
      • snarfle

        snarfle - 2009-09-01

        How you satisfy the calls to the IAsyncReader methods is up to you.

         
    • Drew

      Drew - 2009-09-01

      Thanks for everything.

      I believe this will be my last question.

      Do i need to create a new asyncreader for each frame that comes in from the samplegrabber as i'm parsing the byte array of each frame at creation time like the setfilename section?

       
      • snarfle

        snarfle - 2009-09-01

        One of us is really confused.

        Why would you need to create a new asyncreader for each frame? You create the asyncreader, and it provides frames.

        Maybe I've lost track of what you are trying to do?

         
    • Drew

      Drew - 2009-09-01

      Sorry about that my poor explanation. Long day at work.

      In the ConfigureRdr function there is:

      hr = pPin.SetFileName(sFileName); I'm configuring with my frame byte array here.

      I guess i meant, can i just call this on each frame? or is there another way to continually feed frame bytes in.

      Sorry for the confusion.

       

Log in to post a comment.