Home | History | Annotate | Download | only in omx
      1 /*
      2  * Copyright 2017, 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 BWGRAPHIC_BUFFER_SOURCE_H_
     18 #define BWGRAPHIC_BUFFER_SOURCE_H_
     19 
     20 #include <binder/Binder.h>
     21 #include <binder/Status.h>
     22 #include <android/BnGraphicBufferSource.h>
     23 #include <android/BnOMXBufferSource.h>
     24 #include <media/IOMX.h>
     25 
     26 #include "GraphicBufferSource.h"
     27 #include "IOmxNodeWrapper.h"
     28 
     29 namespace android {
     30 
     31 using ::android::binder::Status;
     32 using ::android::BnGraphicBufferSource;
     33 using ::android::GraphicBufferSource;
     34 using ::android::IOMXNode;
     35 using ::android::sp;
     36 
     37 struct BWGraphicBufferSource : public BnGraphicBufferSource {
     38     struct BWOMXBufferSource;
     39     struct BWOmxNodeWrapper;
     40 
     41     sp<GraphicBufferSource> mBase;
     42     sp<IOMXBufferSource> mOMXBufferSource;
     43 
     44     BWGraphicBufferSource(sp<GraphicBufferSource> const &base);
     45 
     46     Status configure(
     47             const sp<IOMXNode>& omxNode, int32_t dataSpace) override;
     48     Status setSuspend(bool suspend, int64_t timeUs) override;
     49     Status setRepeatPreviousFrameDelayUs(
     50             int64_t repeatAfterUs) override;
     51     Status setMaxFps(float maxFps) override;
     52     Status setTimeLapseConfig(
     53             double fps, double captureFps) override;
     54     Status setStartTimeUs(int64_t startTimeUs) override;
     55     Status setStopTimeUs(int64_t stopTimeUs) override;
     56     Status getStopTimeOffsetUs(int64_t* stopTimeOffsetUs) override;
     57     Status setColorAspects(int32_t aspects) override;
     58     Status setTimeOffsetUs(int64_t timeOffsetsUs) override;
     59     Status signalEndOfInputStream() override;
     60 };
     61 
     62 }  // namespace android
     63 
     64 #endif  // ANDROID_HARDWARE_MEDIA_OMX_V1_0_WGRAPHICBUFFERSOURCE_H
     65