If you are producing RGB565 frames in your CameraHardwareInterface implementation, then you will likely need to make a format change in the "framework/base/camera/libcameraservice/CameraService.cpp" file. Specifically, in the "startPreview" function, the preview frame format is hardcoded to "YCbCr_420_SP", as in:
mSurface->registerBuffers(w, h, w, h, PIXEL_FORMAT_YCbCr_420_SP, ... ); You will need to change this hardcoded value to match the pixel format of the frames you are producing. I think in there are only a couple of supported format choices. I believe "RGB_565" is supported. Give it a try. Steve. On May 13, 8:21 am, blindfold <[email protected]> wrote: > Don't know why the Android team dropped color preview from the > emulator with recent SDKs. Color preview was still present and fully > functional in the SDK M5 RC15 emulator, but then it stopped working as > of SDK 0.9 beta even though the color info is still in the preview > callback data[] with the moving checkerboard. See my issue > 822http://code.google.com/p/android/issues/detail?id=822 > > I think you will have to write/adapt your own camera preview branch to > get color, either by fixing the emulator code or by adapting the G1 > hardware code (or better still, submit a patch such that everybody > will benefit). > > On May 13, 3:00 pm, Androidphan <[email protected]> wrote: > > > > > I'm porting Android to a x86 netbook. But why is color ignored? Can't > > I get this working? > > > On May 13, 2:31 pm, blindfold <[email protected]> wrote: > > > > I'm not sure what you are doing: the Android emulator code for > > > previewing for instance simply ignores all color data and displays > > > only the Y component, i.e., the first width * height bytes out of the > > > 2 * width * height bytes in the YUV422 data[] in the preview callback. > > > The G1 hardware code on the other hand does show the color preview, > > > but uses a quite different (YUV420) encoding with 3/2 * width * height > > > bytes per preview frame. > > > > On May 13, 11:43 am, Androidphan <[email protected]> wrote: > > > > > Thanks for the reply. But I already converted my yuyv frame into > > > > yuv420sp yuv422sp yuv422, rgb 565, no luck at all. > > > > > On May 12, 3:44 pm, blindfold <[email protected]> wrote: > > > > > >http://groups.google.com/group/android-developers/browse_thread/threa...- > > > > > Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-porting -~----------~----~----~----~------~----~------~--~---
