summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/MediaCodec.cpp
diff options
context:
space:
mode:
authorDavid Smith <davidas@google.com>2014-08-15 16:29:04 -0700
committerDavid Smith <davidas@google.com>2014-08-22 16:55:48 -0700
commit744f5739019d1fd917f981e740b353c3d73fd1a8 (patch)
treebeb8494e67a3b7c2b8f0e0dc67347d3bed10153b /media/libstagefright/MediaCodec.cpp
parent61cdd163e99eda4c8313bf754c1c557f8291aa8d (diff)
downloadframeworks_av-744f5739019d1fd917f981e740b353c3d73fd1a8.zip
frameworks_av-744f5739019d1fd917f981e740b353c3d73fd1a8.tar.gz
frameworks_av-744f5739019d1fd917f981e740b353c3d73fd1a8.tar.bz2
stagefright: MediaFilter and SimpleFilter(s)
MediaFilter implements CodecBase and provides video filtering support via filter modules which extend SimpleFilter. Bug: 17203044 Change-Id: Ifb30c501e2901c44999d95d7d150e863b2bd06c6
Diffstat (limited to 'media/libstagefright/MediaCodec.cpp')
-rw-r--r--media/libstagefright/MediaCodec.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp
index 814adab..cf24f6d 100644
--- a/media/libstagefright/MediaCodec.cpp
+++ b/media/libstagefright/MediaCodec.cpp
@@ -36,6 +36,7 @@
#include <media/stagefright/MediaCodecList.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>
+#include <media/stagefright/MediaFilter.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/NativeWindowWrapper.h>
#include <private/android_filesystem_config.h>
@@ -189,7 +190,16 @@ status_t MediaCodec::init(const char *name, bool nameIsType, bool encoder) {
// quickly, violating the OpenMAX specs, until that is remedied
// we need to invest in an extra looper to free the main event
// queue.
- mCodec = new ACodec;
+
+ if (nameIsType || !strncasecmp(name, "omx.", 4)) {
+ mCodec = new ACodec;
+ } else if (!nameIsType
+ && !strncasecmp(name, "android.filter.", 15)) {
+ mCodec = new MediaFilter;
+ } else {
+ return NAME_NOT_FOUND;
+ }
+
bool needDedicatedLooper = false;
if (nameIsType && !strncasecmp(name, "video/", 6)) {
needDedicatedLooper = true;