Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Camera Hals And Dolby support #6

Open
wants to merge 18 commits into
base: 14
Choose a base branch
from

Commits on Oct 7, 2023

  1. Add group audio to vendor.media.omx service

    Resolves Qualcomm libs trying to access e.g. /dev/msm_alac and failing.
    
    Referred from: https://source.codeaurora.org/quic/la/platform/frameworks/av/commit?id=150662d
    
    Test: run vts -m VtsHalMediaOmxV1_0TargetAudioDecTest
    Change-Id: I28dcc07c00f41ab542b24725d767227854f1b7c9
    lweiss-fairphone authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    dbcf285 View commit details
    Browse the repository at this point in the history
  2. audiopolicy: Disable sonification on WFD sink

     * Aligned with CAF as of QSSI12, and removed unnecessary
       devices.isEmpty() check.
    
    Original patch:
    https://source.codeaurora.org/quic/la/platform/frameworks/av/commit/services/audiopolicy?h=LA.BR64.1.1.1-01010-8x16.0&id=9cc970fc512bedfa6a2cf03457d93609adc6eb85
    
    Change-Id: I9bad6a294ddd7aee72f6f6a314666b892b730c8e
    Mingming Yin authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    878b613 View commit details
    Browse the repository at this point in the history
  3. codec2: add smoothfactor when checking n-th work

    pipeline watcher's queued work counter included smoothfactor, if we
    don't add it in elapsed(), it is easy to cause CCodec queue call timeout
    
    CRs-Fixed: 2984012
    Test: Verified on OnePlus 9 that YouTube video does
          not unpause itself.
    Change-Id: Ia2dbf3a7cf0da4805398cf44780ad3dacbaf1a1b
    Jiajia Cong authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    dc4e00b View commit details
    Browse the repository at this point in the history
  4. Revert "stagefright: remove Miracast sender code"

    This reverts commit d0a98fa.
    
    Change-Id: I0554b92c290c1ebbd1a40fc2edb43573a97d4f6a
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    vladimiroltean authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    0ebb716 View commit details
    Browse the repository at this point in the history
  5. Revert "Removed unused class and its test"

    This adds back the SurfaceMediaSource class, needed for WFD.
    
    This reverts commit e885915.
    
    Change-Id: I3f67d01f18441e49205e2e263d20f0fb6fc91fe6
    Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    vladimiroltean authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    e414ac6 View commit details
    Browse the repository at this point in the history
  6. libstagefright: Remove libmediaextractor dependency

    Change-Id: Ifb564aafcf6f9bd45010500a589050b6577c0f7a
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    ghostrider-reborn authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    ee39206 View commit details
    Browse the repository at this point in the history
  7. libstagefright_wfd: compilation fixes

    * Among others, adapt to the ABuffer API changes in
      "f03606d9 Move MediaBufferXXX from foundation to libmediaextractor"
    
    Change-Id: Ie92fc035c6430f1458d45995a5b2627d0bc75122
    Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    
    libstagefright_wfd: Adapt to A11 changes
    
    Change-Id: I69f13c93a68b1ad60e085000361331a3fdc98049
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    
    libstagefright: Remove libmediaextractor dependency
    
    Change-Id: Ifb564aafcf6f9bd45010500a589050b6577c0f7a
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    
    Remove libmediaextractor dependency from libstagefright_wfd
    
    Change-Id: I3d417d2f2ce468eb9d45f55f7818bb9a46348667
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    
    libstagefright_wfd: Log MediaExtractor entry point to MediaMetrics
    
    Change-Id: Ic8fac2cd5ee4d3bb59804e69efc1d5c482aa2417
    
    Change-Id: Ie92fc035c6430f1458d45995a5b2627d0bc75122
    vladimiroltean authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    4db3292 View commit details
    Browse the repository at this point in the history
  8. stagefright: Fix SurfaceMediaSource getting handle from wrong positio…

    …n issue
    
    In function passMetadataBuffer_l, the bufferHandle(ANativeWindowBuffer) is
    saved to data (VideoNativeMetadata) but in function getMediaBufferHandle it
    gets the bufferHandle from (MediaBuffer*)buffer->data() + 4, which is a wrong
    position. To solve this problem, we should get handle from ANativeWindowBuffer,
    not from buffer->data() + 4. (If get bufferHandle from buffer->data() + 4, the
    function signalBufferReturned will print "returned buffer was not found in the
    current list" error.
    
    Test: Running wifi display, we can see the handle could be found in buffer list.
    
    Change-Id: I71ecf9e2bca1db67d8d6e862ac16b07e939bf521
    Signed-off-by: zhangbo_a <zhangbo_a@pinecone.net>
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    zhangbo_a authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    675a214 View commit details
    Browse the repository at this point in the history
  9. stagefright: Fix buffer handle retrieval in signalBufferReturned

    In commit 3e32878 the stagefright code was restructured to fix
    the logic for native handle source, but the change in the
    function SurfaceMediaSource::signalBufferReturned was probably
    missed.
    
    Try to compare the media buffer handle also to the current native
    buffer handle in this function when searching for correspondance.
    
    Change-Id: I352293e525f75dde500ac8e71ee49209710030c3
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    kholk authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    d70578a View commit details
    Browse the repository at this point in the history
  10. libstagefright_wfd: video encoder does not actually release MediaBuff…

    …erBase when done
    
    * This fixes buffer flow SurfaceMediaSource -> MediaPuller -> Converted
      freezing at mMediaBuffersAvailableCondition.wait(), due to this
      condition never being broadcast. This was supposed to happen from within
      SurfaceMediaSource::signalBufferReturned(), but this was never called.
      The Converter class does feedEncoderInputBuffers(), and after the
      encoder does its job, it should return the video buffer to the
      SurfaceMediaSource in ACodec::BaseState::onOMXEmptyBufferDone().
    * There (in ACodec class), the code for doing that used to be:
    
        // We're in "store-metadata-in-buffers" mode, the underlying
        // OMX component had access to data that's implicitly refcounted
        // by this "MediaBuffer" object. Now that the OMX component has
        // told us that it's done with the input buffer, we can decrement
        // the mediaBuffer's reference count.
        info->mData->setMediaBufferBase(NULL);
    
      This means that if there was already a MediaBufferBase assigned to
      this mediaBuffer, then it got released when explicitly setting it to NULL:
    
      void MediaCodecBuffer::setMediaBufferBase(MediaBufferBase *mediaBuffer) {
          if (mMediaBufferBase != NULL) {
              mMediaBufferBase->release();
          }
          mMediaBufferBase = mediaBuffer;
      }
    
      Then in MediaBuffer::release(), which is a subclass of
      MediaBufferBase, there is code that does
    
            mObserver->signalBufferReturned(this);
    
      This should have went on to call SurfaceMediaSource::signalBufferReturned(),
      as it was setting itself as observer on the buffers sent to the video
      encoder. Stay tuned to find out why the call path was broken.
    
    * Now, after Mr. Dongwon Kang's commit
      "f03606d9 Move MediaBufferXXX from foundation to libmediaextractor",
      the setMediaBufferBase and getMediaBufferBase functions no longer
      exist, and reference counting on MediaBuffer's is different.
      The direct replacement of setMediaBufferBase(mbuf) is now
      meta()->setObject("mediaBufferHolder", new MediaBufferHolder(mbuf)).
      The reference counting seems to now be managed through the constructor
      and destructor of this new MediaBufferHolder class (the code for
      release() is now in the holder's destructor). Now the issue seems to
      be that the lifetime of these new MediaBufferHolder's is not quite
      what it should be, because their destructor never gets called, hence
      the buffers never get returned.
    
    * This might be an API problem that Mr. Dongwon Kang himself acknowledged,
      since in the aforementioned patch, he forcefully called mbuf->release()
      right below a comment where it clearly said that "video encoder will
      release MediaBuffer when done with underlying data":
    
      https://android.googlesource.com/platform/frameworks/av/+/f03606d9034730bea1a394e6803f9ebc36f3d2eb%5E%21/#F13
    
    * Without addressing the root cause of the issue, in this commit we are
      simply mirroring a workaround for what appears to be broken media
      buffer reference counting.
    
    Change-Id: Ie540e6dcf5536f93091ced2af2e121b71f70bb83
    Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    vladimiroltean authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    014af94 View commit details
    Browse the repository at this point in the history
  11. audioflinger: Fix audio for WifiDisplay

    AudioFlinger is not able to determine the correct
    pid/tid for WifiDisplay and thus we do not pass checks
    for CAPTURE_AUDIO_OUTPUT and RECORD_AUDIO permissions.
    
    To fix audio for WifiDisplay, it should be safe to
    always allow a trusted calling uid (AID_MEDIA which
    has the same perms as AID_AUDIOSERVER).
    
    Change-Id: Ifa46d8e77a43027645cad02a04263b58e134c3ad
    myfluxi authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    1a800f7 View commit details
    Browse the repository at this point in the history
  12. Partial revert "Move unused classes out of stagefright foundataion"

    This imports the old foundation code in the standard platform stagefright.
    The foundation variant is used in VNDK, we can't change the ABI there.
    
    This reverts commit 5ec3d6a.
    
    Change-Id: Iebcf5d89a768fdb830bea90fbf2c2427a4c3d139
    Signed-off-by: DennySPb <dennyspb@gmail.com>
    Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
    nicorg2515 authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    693e3ac View commit details
    Browse the repository at this point in the history
  13. fixup! Revert "stagefright: remove Miracast sender code"

    * media/libstagefright/mpeg2ts has been moved to media/module/mpeg2ts
    
    * Ref: Miku-UI/platform_frameworks_av@d2843da
    
    Change-Id: Id003b86bf1d75b2b98934816eaf9e329162b7b20
    AmeChanRain authored and NurKeinNeid committed Oct 7, 2023
    Configuration menu
    Copy the full SHA
    6c45508 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2023

  1. cameraservice: fix deadlock in onewayhidl onPhysicalCameraStatusChanged

    oneway hild onPhysicalCameraStatusChanged is blocked while casting listener2.1 from listener2.0. When calling addlistener_2_1 the listener is actually 2.0
    for the H2BConverter template is constructed by listener2.0.
    
    Issue: 243902566
    Change-Id: I9d78c40ad924be9471200d245cdb66d985d017f2
    zhangshiyang authored and seba3567 committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    da8309d View commit details
    Browse the repository at this point in the history
  2. CameraService: Fix deadlock in binder death cleanup

    In the event of a binder death, there is a chance of deadlock
    due to recursive lock acquisition in the death handling sequence.
    Fix:
    Clear evicted client list before acquiring service lock.
    
    Change-Id: I6fc5fa6e01c002bc46be058fcd977be14cae0270
    Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
    Mounika Reddy Tangirala authored and seba3567 committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    1edfe05 View commit details
    Browse the repository at this point in the history
  3. media: OMXStore: Import loading libstagefrightdolby

    - Imported from Xiaomi Android 13 Changes
    
    Change-Id: Ia7da9da19bfa10c64a82eb68eef3857a78e12469
    johnmart19 authored and seba3567 committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    a773e17 View commit details
    Browse the repository at this point in the history
  4. libstagefright: omx: Add support for loading prebuilt ddp and ac4 dec…

    …oder lib
    
    [HELLBOY017]: Also allow to load dolby codec in MediaCodecList
    
    Change-Id: I3b85c15889c9e3aef152e726a83936234103254e
    javelinanddart authored and seba3567 committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    c16e3bf View commit details
    Browse the repository at this point in the history
  5. OMX: Remove support for prebuilt ac4 decoder

    Requires proprietary Dolby changes in libstagefright.
    
    This partially reverts commit 01090fa125c2993654e18e024ddf7cef87bca30e.
    
    Change-Id: Ifdf36ad253155e77ba14d0624612bf6be6711ca6
    ghostrider-reborn authored and seba3567 committed Oct 9, 2023
    Configuration menu
    Copy the full SHA
    d27c1a1 View commit details
    Browse the repository at this point in the history