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

Commit fe0597c0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "NdkMediaCodec: add AMediaCodec_getBufferFormat"

parents a2a8eaf5 2c32f4d2
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
@@ -179,6 +179,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