diff options
author | Andreas Huber <andih@google.com> | 2012-03-26 11:13:27 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2012-03-26 11:24:04 -0700 |
commit | 9b8e496f4d143280deff137c5f30ca8907bc28db (patch) | |
tree | f6136e4a5bf55c67ac721f1fc94b8d6aadc0fa6f /media/libstagefright/foundation/AString.cpp | |
parent | 7061b5ffb37ea15f235effa1faaf22bb1750c7f5 (diff) | |
download | frameworks_base-9b8e496f4d143280deff137c5f30ca8907bc28db.zip frameworks_base-9b8e496f4d143280deff137c5f30ca8907bc28db.tar.gz frameworks_base-9b8e496f4d143280deff137c5f30ca8907bc28db.tar.bz2 |
Provisional support for secure decryption of media streams.
Change-Id: Ib3982a9c960bfdb0cb7e1b174440b141b194cfbe
Diffstat (limited to 'media/libstagefright/foundation/AString.cpp')
-rw-r--r-- | media/libstagefright/foundation/AString.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/media/libstagefright/foundation/AString.cpp b/media/libstagefright/foundation/AString.cpp index 61b76cf..dee786d 100644 --- a/media/libstagefright/foundation/AString.cpp +++ b/media/libstagefright/foundation/AString.cpp @@ -310,6 +310,16 @@ bool AString::startsWith(const char *prefix) const { return !strncmp(mData, prefix, strlen(prefix)); } +bool AString::endsWith(const char *suffix) const { + size_t suffixLen = strlen(suffix); + + if (mSize < suffixLen) { + return false; + } + + return !strcmp(mData + mSize - suffixLen, suffix); +} + AString StringPrintf(const char *format, ...) { va_list ap; va_start(ap, format); |