summaryrefslogtreecommitdiffstats
path: root/media/jni
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-05-08 17:16:45 -0700
committerLajos Molnar <lajos@google.com>2014-05-09 20:43:30 +0000
commit7c513b6bef8ed4dfc28e0af6c8594563fdb9f436 (patch)
treea4b946b239e95aa8dc545fc58725f5dcfb54b99e /media/jni
parente1f788b3e216329c570929eb4526332ae0db14d1 (diff)
downloadframeworks_base-7c513b6bef8ed4dfc28e0af6c8594563fdb9f436.zip
frameworks_base-7c513b6bef8ed4dfc28e0af6c8594563fdb9f436.tar.gz
frameworks_base-7c513b6bef8ed4dfc28e0af6c8594563fdb9f436.tar.bz2
Added MediaCodec.releaseOutputBuffer() method with render timestamp
Bug: 11784827 Change-Id: I67097c8e69b40ef3baa436f0e7731d28c696735c
Diffstat (limited to 'media/jni')
-rw-r--r--media/jni/android_media_MediaCodec.cpp13
-rw-r--r--media/jni/android_media_MediaCodec.h3
2 files changed, 11 insertions, 5 deletions
diff --git a/media/jni/android_media_MediaCodec.cpp b/media/jni/android_media_MediaCodec.cpp
index a710c03..4a7c096 100644
--- a/media/jni/android_media_MediaCodec.cpp
+++ b/media/jni/android_media_MediaCodec.cpp
@@ -260,7 +260,11 @@ status_t JMediaCodec::dequeueOutputBuffer(
return OK;
}
-status_t JMediaCodec::releaseOutputBuffer(size_t index, bool render) {
+status_t JMediaCodec::releaseOutputBuffer(
+ size_t index, bool render, bool updatePTS, int64_t timestampNs) {
+ if (updatePTS) {
+ return mCodec->renderOutputBufferAndRelease(index, timestampNs);
+ }
return render
? mCodec->renderOutputBufferAndRelease(index)
: mCodec->releaseOutputBuffer(index);
@@ -873,7 +877,8 @@ static jint android_media_MediaCodec_dequeueOutputBuffer(
}
static void android_media_MediaCodec_releaseOutputBuffer(
- JNIEnv *env, jobject thiz, jint index, jboolean render) {
+ JNIEnv *env, jobject thiz,
+ jint index, jboolean render, jboolean updatePTS, jlong timestampNs) {
ALOGV("android_media_MediaCodec_renderOutputBufferAndRelease");
sp<JMediaCodec> codec = getMediaCodec(env, thiz);
@@ -883,7 +888,7 @@ static void android_media_MediaCodec_releaseOutputBuffer(
return;
}
- status_t err = codec->releaseOutputBuffer(index, render);
+ status_t err = codec->releaseOutputBuffer(index, render, updatePTS, timestampNs);
throwExceptionAsNecessary(env, err);
}
@@ -1138,7 +1143,7 @@ static JNINativeMethod gMethods[] = {
{ "dequeueOutputBuffer", "(Landroid/media/MediaCodec$BufferInfo;J)I",
(void *)android_media_MediaCodec_dequeueOutputBuffer },
- { "releaseOutputBuffer", "(IZ)V",
+ { "releaseOutputBuffer", "(IZZJ)V",
(void *)android_media_MediaCodec_releaseOutputBuffer },
{ "signalEndOfInputStream", "()V",
diff --git a/media/jni/android_media_MediaCodec.h b/media/jni/android_media_MediaCodec.h
index 2f2ea96..bf9f4ea 100644
--- a/media/jni/android_media_MediaCodec.h
+++ b/media/jni/android_media_MediaCodec.h
@@ -79,7 +79,8 @@ struct JMediaCodec : public AHandler {
status_t dequeueOutputBuffer(
JNIEnv *env, jobject bufferInfo, size_t *index, int64_t timeoutUs);
- status_t releaseOutputBuffer(size_t index, bool render);
+ status_t releaseOutputBuffer(
+ size_t index, bool render, bool updatePTS, int64_t timestampNs);
status_t signalEndOfInputStream();