Coder Social home page Coder Social logo

Comments (8)

diepquynh avatar diepquynh commented on August 22, 2024

Camera recording never work on O with prebuilt HAL. The reason was we need to switch to native handle implementation rather than getting buffers from gralloc HAL

from android_hardware_sprd.

enriquezmark36 avatar enriquezmark36 commented on August 22, 2024

How about playing a video, it seems that it also uses gralloc to fetch buffers, doesn't it?

from android_hardware_sprd.

diepquynh avatar diepquynh commented on August 22, 2024

Playing videos is ok. 1080p30 is fine

from android_hardware_sprd.

diepquynh avatar diepquynh commented on August 22, 2024

Other resolutions too

from android_hardware_sprd.

enriquezmark36 avatar enriquezmark36 commented on August 22, 2024

TL;DR; It's okay now. I can now play videos up to 1080p30. So, I'll be closing this. :)

It seems that a patch libstagefright: Make it possible to skip OMX buffer reallocation didn't make it to LineageOS 15. Though this made me ask:
What does BOARD_CANT_REALLOCATE_OMX_BUFFERS := true in scx35-common/BoardConfigCommon.mk even do?

Unfortunately, it doesn't fix the camera recording. It hangs after the 00:01 time. AFAIK, LineageOS devs are working on the "legacy" HAL1 camera recording issue.

Anyways, here's the patch I used on frameworks/av that just tests this idea.

diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index def8ada3c..47d622bfa 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -1182,6 +1182,12 @@ status_t ACodec::configureOutputBuffersFromNativeWindow(
     // 2. try to allocate two (2) additional buffers to reduce starvation from
     //    the consumer
     //    plus an extra buffer to account for incorrect minUndequeuedBufs
+#if 1
+    // Some devices don't like to set OMX_IndexParamPortDefinition at this
+    // point (even with an unmodified def), so skip it if possible.
+    // This check was present in KitKat.
+    if (def.nBufferCountActual < def.nBufferCountMin + *minUndequeuedBuffers) {
+#endif
     for (OMX_U32 extraBuffers = 2 + 1; /* condition inside loop */; extraBuffers--) {
         OMX_U32 newBufferCount =
             def.nBufferCountMin + *minUndequeuedBuffers + extraBuffers;
@@ -1201,7 +1207,9 @@ status_t ACodec::configureOutputBuffersFromNativeWindow(
             return err;
         }
     }
-
+#if 1
+    }
+#endif

from android_hardware_sprd.

diepquynh avatar diepquynh commented on August 22, 2024

The flag is removed in LOS 15.1
However, you can bring it back via patching method

from android_hardware_sprd.

enriquezmark36 avatar enriquezmark36 commented on August 22, 2024

Oh, that's why. Does the camera recording work by now for HAL1? I don't think I have done much researches.

from android_hardware_sprd.

diepquynh avatar diepquynh commented on August 22, 2024

It will never work with prebuilt camera blobs, because O won't use gralloc source for camera, instead using native handle struct for it

from android_hardware_sprd.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.