Home | History | Annotate | Download | only in filters
      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 SIMPLE_FILTER_H_
     18 #define SIMPLE_FILTER_H_
     19 
     20 #include <stdint.h>
     21 #include <utils/Errors.h>
     22 #include <utils/RefBase.h>
     23 
     24 struct ABuffer;
     25 struct AMessage;
     26 
     27 namespace android {
     28 
     29 struct SimpleFilter : public RefBase {
     30 public:
     31     SimpleFilter() : mWidth(0), mHeight(0), mStride(0), mSliceHeight(0),
     32             mColorFormatIn(0), mColorFormatOut(0) {};
     33 
     34     virtual status_t configure(const sp<AMessage> &msg);
     35 
     36     virtual status_t start() = 0;
     37     virtual void reset() = 0;
     38     virtual status_t setParameters(const sp<AMessage> &msg) = 0;
     39     virtual status_t processBuffers(
     40             const sp<ABuffer> &srcBuffer, const sp<ABuffer> &outBuffer) = 0;
     41 
     42 protected:
     43     int32_t mWidth, mHeight;
     44     int32_t mStride, mSliceHeight;
     45     int32_t mColorFormatIn, mColorFormatOut;
     46 
     47     virtual ~SimpleFilter() {};
     48 };
     49 
     50 }   // namespace android
     51 
     52 #endif  // SIMPLE_FILTER_H_
     53