• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

frameworks/base


Commit MetaInfo

Revision16e9784f3219cc04a30dc20aab00e64da84a5d61 (tree)
Zeit2010-04-15 15:34:53
AutorWallace Wang <wallace1_wang@gmai...>
CommiterChih-Wei Huang

Log Message

make camera preview ok

Ändern Zusammenfassung

Diff

--- a/libs/surfaceflinger/LayerBuffer.cpp
+++ b/libs/surfaceflinger/LayerBuffer.cpp
@@ -276,17 +276,31 @@ LayerBuffer::Buffer::Buffer(const ISurface::BufferHeap& buffers, ssize_t offset)
276276 src.img.handle = 0;
277277
278278 gralloc_module_t const * module = LayerBuffer::getGrallocModule();
279- if (module && module->perform) {
280- int err = module->perform(module,
281- GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER,
282- buffers.heap->heapID(), buffers.heap->getSize(),
283- offset, buffers.heap->base(),
284- &src.img.handle);
285-
286- LOGE_IF(err, "CREATE_HANDLE_FROM_BUFFER (heapId=%d, size=%d, "
287- "offset=%ld, base=%p) failed (%s)",
288- buffers.heap->heapID(), buffers.heap->getSize(),
289- offset, buffers.heap->base(), strerror(-err));
279+ if (module) {
280+ if (module->perform) {
281+ int err = module->perform(module,
282+ GRALLOC_MODULE_PERFORM_CREATE_HANDLE_FROM_BUFFER,
283+ buffers.heap->heapID(), buffers.heap->getSize(),
284+ offset, buffers.heap->base(),
285+ &src.img.handle);
286+ if (err != NO_ERROR) {
287+ LOGE("CREATE_HANDLE_FROM_BUFFER (heapId=%d, size=%d, "
288+ "offset=%ld, base=%p) failed (%s)",
289+ buffers.heap->heapID(), buffers.heap->getSize(),
290+ offset, buffers.heap->base(), strerror(-err));
291+ return;
292+ }
293+ }
294+
295+ src.crop.l = 0;
296+ src.crop.t = 0;
297+ src.crop.r = buffers.w;
298+ src.crop.b = buffers.h;
299+
300+ src.img.w = buffers.hor_stride ?: buffers.w;
301+ src.img.h = buffers.ver_stride ?: buffers.h;
302+ src.img.format = buffers.format;
303+ src.img.base = (void*)(intptr_t(buffers.heap->base()) + offset);
290304 }
291305 }
292306
--- a/opengl/include/EGL/eglext.h
+++ b/opengl/include/EGL/eglext.h
@@ -133,7 +133,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
133133
134134
135135 #ifndef EGL_ANDROID_image_native_buffer
136-#define EGL_ANDROID_image_native_buffer 1
136+//#define EGL_ANDROID_image_native_buffer 1
137137 struct android_native_buffer_t;
138138 #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
139139 #endif