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

merge #1

Merged
merged 3 commits into from Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions media/ndk/NdkMediaCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions media/ndk/include/media/NdkMediaCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,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
Expand Down