summaryrefslogtreecommitdiffstats
path: root/framesequence/jni/Registry.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@android.com>2015-04-02 22:25:47 (GMT)
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-02 22:25:48 (GMT)
commitd90222baefb107ddc08d024b02d664d18f50f44f (patch)
tree83290b350f7b0e75a256d64d50a331b36b42f991 /framesequence/jni/Registry.cpp
parent46ca918db82c1fca3f370ec6a9b936bf7268aa85 (diff)
parent6a61141137c7a46d747aa611c9caf62436bc119f (diff)
downloadandroid_frameworks_ex-d90222baefb107ddc08d024b02d664d18f50f44f.zip
android_frameworks_ex-d90222baefb107ddc08d024b02d664d18f50f44f.tar.gz
android_frameworks_ex-d90222baefb107ddc08d024b02d664d18f50f44f.tar.bz2
Merge "Adding Bytebuffer support to rastermill library"
Diffstat (limited to 'framesequence/jni/Registry.cpp')
-rw-r--r--framesequence/jni/Registry.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/framesequence/jni/Registry.cpp b/framesequence/jni/Registry.cpp
index 125ac66..e632bb2 100644
--- a/framesequence/jni/Registry.cpp
+++ b/framesequence/jni/Registry.cpp
@@ -34,15 +34,26 @@ Registry::Registry(const RegistryEntry& entry) {
const RegistryEntry* Registry::Find(Stream* stream) {
Registry* registry = gHead;
- int headerSize = gHeaderBytesRequired;
- char header[headerSize];
- headerSize = stream->peek(header, headerSize);
- while (registry) {
- if (headerSize >= registry->mImpl.requiredHeaderBytes
- && registry->mImpl.checkHeader(header, headerSize)) {
- return &(registry->mImpl);
+
+ if (stream->getRawBuffer() != NULL) {
+ while (registry) {
+ if (registry->mImpl.acceptsBuffer()) {
+ return &(registry->mImpl);
+ }
+ registry = registry->mNext;
+ }
+ } else {
+ int headerSize = gHeaderBytesRequired;
+ char header[headerSize];
+ headerSize = stream->peek(header, headerSize);
+ while (registry) {
+ if (headerSize >= registry->mImpl.requiredHeaderBytes
+ && registry->mImpl.checkHeader(header, headerSize)) {
+ return &(registry->mImpl);
+ }
+ registry = registry->mNext;
}
- registry = registry->mNext;
}
return 0;
}
+