Skip to content

Instantly share code, notes, and snippets.

@pawitp
Last active Mar 12, 2017
Embed
What would you like to do?
From 6e415ac727a1e323ca430d82e2fb792390c05500 Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Tue, 17 Dec 2013 13:15:52 +0700
Subject: [PATCH 1/2] OMXCodec: set default input buffer size
Broadcom OMX only set the buffer size to 65536 by default which
is not enough for higher bitrate video
Change-Id: I74372f3d821e41feb38b9bc0cca4ef56aa019493
---
media/libstagefright/OMXCodec.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 984b51c..704dd2d 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -918,6 +918,18 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
if (meta->findInt32(kKeyMaxInputSize, &maxInputSize)) {
setMinBufferSize(kPortIndexInput, (OMX_U32)maxInputSize);
}
+// Capri's OMX fail to set a reasonable default size from width and height
+#ifdef CAPRI_HWC
+ else {
+ int32_t width;
+ int32_t height;
+ if (meta->findInt32(kKeyWidth, &width) && meta->findInt32(kKeyHeight, &height)) {
+ setMinBufferSize(kPortIndexInput, (width * height * 3) / 2);
+ } else {
+ ALOGE("Failed to set min buffer size");
+ }
+ }
+#endif
initOutputFormat(meta);
--
1.8.5.2 (Apple Git-48)
From 0d952058939edb62fa6a378b3246ee2fab3c14df Mon Sep 17 00:00:00 2001
From: Pawit Pornkitprasan <p.pawit@gmail.com>
Date: Mon, 23 Dec 2013 18:41:44 +0700
Subject: [PATCH 2/2] OMXCodec: set default input buffer size only for BCM
decoder
Change-Id: Ic554343069b47a4b66ea9e8daee684d4923ecd98
---
media/libstagefright/OMXCodec.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 704dd2d..dec925d 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -920,7 +920,7 @@ status_t OMXCodec::configureCodec(const sp<MetaData> &meta) {
}
// Capri's OMX fail to set a reasonable default size from width and height
#ifdef CAPRI_HWC
- else {
+ else if (!strncmp(mComponentName, "OMX.BRCM.vc4.decoder.", 21)) {
int32_t width;
int32_t height;
if (meta->findInt32(kKeyWidth, &width) && meta->findInt32(kKeyHeight, &height)) {
--
1.8.5.2 (Apple Git-48)
@pawitp

This comment has been minimized.

Copy link
Owner Author

@pawitp pawitp commented Jul 14, 2014

Change log: removed AudioMixer patch as it's already included

@laddycc

This comment has been minimized.

Copy link

@laddycc laddycc commented Feb 21, 2016

how to patch sir need tutorial

@Vladislav4KZ

This comment has been minimized.

Copy link

@Vladislav4KZ Vladislav4KZ commented Mar 12, 2017

How to put patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment