summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/Utils.cpp
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2015-11-19 00:33:58 -0800
committerSteve Kondik <steve@cyngn.com>2015-11-24 04:02:48 -0800
commit3a0bcf107182665d5b8628245750f1e210ef0936 (patch)
tree5e530ee0e0da1b786466dcbf8362d671c6ea6057 /media/libstagefright/Utils.cpp
parent29c75250c58bdcc3b38513813ba521cba82d5c61 (diff)
downloadframeworks_av-3a0bcf107182665d5b8628245750f1e210ef0936.zip
frameworks_av-3a0bcf107182665d5b8628245750f1e210ef0936.tar.gz
frameworks_av-3a0bcf107182665d5b8628245750f1e210ef0936.tar.bz2
stagefright: Act V: I am become death, the destroyer of worlds
* In which our hero unites the legions of distant worlds together as one at last to fight anew until the segfaults boil the lands and the New Version cometh. Change-Id: I869b2ab254968ed7a133827ea9e5ba6056f68a5c
Diffstat (limited to 'media/libstagefright/Utils.cpp')
-rw-r--r--media/libstagefright/Utils.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp
index 0cf76a3..6d62e03 100644
--- a/media/libstagefright/Utils.cpp
+++ b/media/libstagefright/Utils.cpp
@@ -1044,5 +1044,18 @@ void readFromAMessage(
*sync = settings;
}
+audio_format_t getPCMFormat(const sp<AMessage> &format) {
+ int32_t bits = 16;
+ if (format->findInt32("bits-per-sample", &bits)) {
+ if (bits == 8)
+ return AUDIO_FORMAT_PCM_8_BIT;
+ if (bits == 24)
+ return AUDIO_FORMAT_PCM_32_BIT;
+ if (bits == 32)
+ return AUDIO_FORMAT_PCM_FLOAT;
+ }
+ return AUDIO_FORMAT_PCM_16_BIT;
+}
+
} // namespace android