[haiku-development] Re: GSoC EHCI

  • From: François Revol <revol@xxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 05 Aug 2011 01:34:22 +0200

Hi,

Le 03/08/2011 01:01, Gabriel Hartmann a écrit :
I've been looking at the Sonix GetFrameBitmap and FillFrameBuffer
code.  Could you give me a little more detail about how deFramers
work.  It looks like a CamDeframer makes reference to a Blist of
Frames.  How is this list populated?  Otherwise the two methods which
need implementing look pretty straight forward.


I think this approach is a good idea, so that if in the future ehci is
fixed at least the payload data can be interpretted easily.  In any
case, my questions about deframers still stands.  I believe I should
be creating a UVCDeframer class which extends CamDeframer.  This
should then implement the virtual functions defined in CamDeframer.
Is there any documentation about what exactly these functions are
supposed to do?  Then I implement FillFrameBuffer or GetFrameBitmap
using the Deframer and we should be pretty close to showing pictures
on screen...at least for 20 seconds right?

Basically CamDeframer is a BDataIO that is written to with every chunk of received data, and needs to detect where a frame starts and ends, then create a new frame to copy the data to, adds it to the list and releases the semaphore to unblock WaitFrame().

See CamBufferingDeframer.cpp & CamStreamingDeframer.cpp
One of those is buggy though (the one that's not currently used, hopefully), I was likely asleep when I wrote this and it's likely suboptimal.

At least for the Sonix it needs to detect specific Start Of Frame markers, since it can't rely on a fixed chunk size (frames can be compressed, and packets can get lost).

I'm trying to figure this out on my own, but I just keep climbing up
the inheritance tree into less and less familiar territory.  I guess
the key questions are what are the overridden functions in the

If you only need to detect specific markers in the streams you can just clone the Sonix code and change the SOF/EOF markers.

Deframer supposed to do, and who populates the BList of frames
(fFrames)?

the Write() hook does it, when a full frame is detected, in Cam[Streaming|Buffering]Deframer. Should likely go into a CamDeframer::PushFrame() or something.

François.

Other related posts: