summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-06-01 10:54:31 -0700
committerLajos Molnar <lajos@google.com>2015-06-02 19:04:16 -0700
commit15ab4996019387f27a48b81cb4774c21502bc0e5 (patch)
treecff50b03c2785db5944f0bc310f9c8afaae17b2e /media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
parent40b26470dd29e44f1601ceb6e60948586a4d9f88 (diff)
downloadframeworks_av-15ab4996019387f27a48b81cb4774c21502bc0e5.zip
frameworks_av-15ab4996019387f27a48b81cb4774c21502bc0e5.tar.gz
frameworks_av-15ab4996019387f27a48b81cb4774c21502bc0e5.tar.bz2
stagefright: add support for fences in OMX
Pass Fence between Surface and ACodec, and between ACodec and IOMX. Bug: 12386081 Change-Id: Ifdc566979dec0d91ed8b07c3b69d2cf092accc73
Diffstat (limited to 'media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp')
-rw-r--r--media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
index 5f80cbc..cd1ac36 100644
--- a/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
+++ b/media/libstagefright/omx/SoftVideoEncoderOMXComponent.cpp
@@ -517,6 +517,16 @@ const uint8_t *SoftVideoEncoderOMXComponent::extractGraphicBuffer(
// TODO do we need to support other formats?
srcStride *= 4;
}
+
+ if (nativeMeta.nFenceFd >= 0) {
+ sp<Fence> fence = new Fence(nativeMeta.nFenceFd);
+ nativeMeta.nFenceFd = -1;
+ status_t err = fence->wait(IOMX::kFenceTimeoutMs);
+ if (err != OK) {
+ ALOGE("Timed out waiting on input fence");
+ return NULL;
+ }
+ }
} else {
// TODO: remove this part. Check if anyone uses this.