Home | History | Annotate | Download | only in include
      1 /*
      2  * Copyright (C) 2009 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 SOFTWARE_RENDERER_H_
     18 
     19 #define SOFTWARE_RENDERER_H_
     20 
     21 #include <media/stagefright/ColorConverter.h>
     22 #include <utils/RefBase.h>
     23 #include <system/window.h>
     24 
     25 namespace android {
     26 
     27 struct MetaData;
     28 
     29 class SoftwareRenderer {
     30 public:
     31     SoftwareRenderer(
     32             const sp<ANativeWindow> &nativeWindow, const sp<MetaData> &meta);
     33 
     34     ~SoftwareRenderer();
     35 
     36     void render(
     37             const void *data, size_t size, void *platformPrivate);
     38 
     39 private:
     40     enum YUVMode {
     41         None,
     42     };
     43 
     44     OMX_COLOR_FORMATTYPE mColorFormat;
     45     ColorConverter *mConverter;
     46     YUVMode mYUVMode;
     47     sp<ANativeWindow> mNativeWindow;
     48     int32_t mWidth, mHeight;
     49     int32_t mCropLeft, mCropTop, mCropRight, mCropBottom;
     50     int32_t mCropWidth, mCropHeight;
     51 
     52     SoftwareRenderer(const SoftwareRenderer &);
     53     SoftwareRenderer &operator=(const SoftwareRenderer &);
     54 };
     55 
     56 }  // namespace android
     57 
     58 #endif  // SOFTWARE_RENDERER_H_
     59