|
From: Derek S. <de...@in...> - 2003-06-16 02:27:13
|
Hi, The PVideoInputDevice copys data from the camera into a destination buffer. The number of bytes copied is given in the argument: bytesReturned The pointer to the desination buffer is the argument: buffer That you always get a green screen: You can try using a different video input --videoinput X on ohphone. Examine the fake video input devices. These provide a clue as to how the PVideoInputDevice must work. I suggest this class because you do not have the added complexity of making the hardware work. Derek. On Sun, 15 Jun 2003, Nina wrote: > Hi all, > > I'm implementing video communications between WinCE devices. > My platform is Windows CE.NET 4.1 & x86 family processor. > > As you know, there is no common APIs for capturing from camera > device(like VFW stuff) in WinCE so, I made new class from PVideoDevice. > > My camera sdk has only 4-5 for capturing, very simple. Capturing from > camera looks ok, but if this data is processed and sent then this is > displayed to "green still image". I have no idea, what I did wrong. > Receiving & Displaying funtions are no problem with openphone in PC. > > ----------------------------------------------------------------------------------------------- > My questions are these : > 1. void VideoFrame::SetSize(int, int) > -> this functions sets "frameptr" dynamically, but I don't understand why this buffer size should be "(width * height * 3) >>1" > > 2. My grabber gets raw data from camera with YUV422 format. Is this no problem? > > 3. Sender : Grabbing(YUV422) -> Encoding(H.261 QCIF) -> Transmitting > Receiver : Receiving -> Decoding -> Displaying (RGB24, converting from YUV422) > ------------------------- > it displays just green still image, do you have any idea what i did wrong? > Receiver part is no problem with PC. > > 4. I don't use thread(PThread) to run "PVideoInputDeviceInCE", is this no problem? > I know that "PVideoInputDevice" is run from PThread. > ----------------------------------------------------------------------------------------------- > > > Below codes describe "GetFrameData" > ----------------------------------------------------------------------------------------------- > // PVideoInputDevice class for WinCE > class PVideoInputDeviceInCE : public PVideoDevice > > // GetFrameData is called from PVideoChannel::Read Function directly > bool PVideoInputDeviceInCE::GetFrameData (BYTE* buffer, PINDEX* bytesReturned) > { > LPBYTE pOriginalBuffer = buffer; > > < if it is first call, initialise camera device & start it.> > > // Get raw data from camera, YUV422 format > bool bResult = Capture_Frame_from_Camera (pCaptureBuff); > > // if "buffer" pointer has changed from other, don't write captured data in "buffer" > // it will cause problems. > if(pOriginalBuffer != buffer) return TRUE; > buffer = pCaptureBuff; > > return bResult; > } > ----------------------------------------------------------------------------------------------- > > > > > > > -- Derek Smithies Ph.D. IndraNet Technologies Ltd. Email: de...@in... ph +64 3 365 6485 Web: http://www.indranet-technologies.com/ |