Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c32f4d2 authored by Manikanta Kanamarlapudi's avatar Manikanta Kanamarlapudi Committed by Alexey Polyudov
Browse files

NdkMediaCodec: add AMediaCodec_getBufferFormat

Add new AMediaCodec_getBufferFormat api to get
format of the buffer of specified index.

Change-Id: Ib5d6537b601dc8ce9c5c0096485637e0cf44a16a
parent b45a3c22
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -366,6 +366,13 @@ AMediaFormat* AMediaCodec_getOutputFormat(AMediaCodec *mData) {
    return AMediaFormat_fromMsg(&format);
}

EXPORT
AMediaFormat* AMediaCodec_getBufferFormat(AMediaCodec *mData, size_t index) {
    sp<AMessage> format;
    mData->mCodec->getOutputFormat(index, &format);
    return AMediaFormat_fromMsg(&format);
}

EXPORT
media_status_t AMediaCodec_releaseOutputBuffer(AMediaCodec *mData, size_t idx, bool render) {
    if (render) {
+6 −0
Original line number Diff line number Diff line
@@ -180,6 +180,12 @@ ssize_t AMediaCodec_dequeueOutputBuffer(AMediaCodec*, AMediaCodecBufferInfo *inf
        int64_t timeoutUs);
AMediaFormat* AMediaCodec_getOutputFormat(AMediaCodec*);

/**
 * Get format of the buffer. The specified buffer index must have been previously obtained from
 * dequeueOutputBuffer.
 */
AMediaFormat* AMediaCodec_getBufferFormat(AMediaCodec*, size_t index);

/**
 * If you are done with a buffer, use this call to return the buffer to
 * the codec. If you previously specified a surface when configuring this