When using Overlay for MediaRecorder
It seems the current has some problem:
framework/camera/libcameraservice/CameraService
346 if (mUseOverlay) {
347 const char *format = params.getPreviewFormat();
348 int fmt;
349 LOGD("Use Overlays");
350 if (!strcmp(format, "yuv422i"))
351 fmt = OVERLAY_FORMAT_YCbCr_422_I;
352 else if (!strcmp(format, "rgb565"))
353 fmt = OVERLAY_FORMAT_RGB_565;
354 else {
355 LOGE("Invalid preview format for overlays");
356 return -EINVAL;
357 }
358 sp<OverlayRef> ref = mSurface->createOverlay(w, h, fmt);
359 ret = mHardware->setOverlay(new Overlay(ref));
360 if (ret != NO_ERROR) {
361 LOGE("mHardware->setOverlay() failed with status %d
\n", ret);
362 return ret;
363 }
364 ret = mHardware->startPreview(NULL, mCameraService.get
());
365 if (ret != NO_ERROR)
366 LOGE("mHardware->startPreview() failed with status %d
\n", ret);
367 } else {
368 LOGD("Don't use Overlays");
369 ret = mHardware->startPreview(previewCallback,
370 mCameraService.get
());
371 if (ret == NO_ERROR) {
372 mSurface->unregisterBuffers();
373 mSurface->registerBuffers(w, h, w, h,
PIXEL_FORMAT_YCbCr_420_SP,
374 mHardware->getPreviewHeap
());
375 }
Please notice line 364 , only pass previewCallback as NULL.
1. It will work well for still capture
2.for MediaRecorder how to get video data
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"android-framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---