1/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef RS_FILTER_H_
18#define RS_FILTER_H_
19
20#include <media/stagefright/RenderScriptWrapper.h>
21#include <RenderScript.h>
22
23#include "SimpleFilter.h"
24
25namespace android {
26
27struct AString;
28
29struct RSFilter : public SimpleFilter {
30public:
31    RSFilter();
32
33    virtual status_t configure(const sp<AMessage> &msg);
34    virtual status_t start();
35    virtual void reset();
36    virtual status_t setParameters(const sp<AMessage> &msg);
37    virtual status_t processBuffers(
38            const sp<ABuffer> &srcBuffer, const sp<ABuffer> &outBuffer);
39
40protected:
41    virtual ~RSFilter();
42
43private:
44    AString mCacheDir;
45    sp<RenderScriptWrapper::RSFilterCallback> mCallback;
46    RSC::sp<RSC::RS> mRS;
47    RSC::sp<RSC::Allocation> mAllocIn;
48    RSC::sp<RSC::Allocation> mAllocOut;
49};
50
51}   // namespace android
52
53#endif  // RS_FILTER_H_
54