1 /*
2 * Copyright 2016, 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 #include <media/omx/1.0/WGraphicBufferSource.h>
18 #include <media/omx/1.0/WOmxNode.h>
19 #include <media/omx/1.0/Conversion.h>
20
21 namespace android {
22 namespace hardware {
23 namespace media {
24 namespace omx {
25 namespace V1_0 {
26 namespace utils {
27
28 // LWGraphicBufferSource
LWGraphicBufferSource(sp<TGraphicBufferSource> const & base)29 LWGraphicBufferSource::LWGraphicBufferSource(
30 sp<TGraphicBufferSource> const& base) : mBase(base) {
31 }
32
configure(const sp<IOMXNode> & omxNode,int32_t dataSpace)33 BnStatus LWGraphicBufferSource::configure(
34 const sp<IOMXNode>& omxNode, int32_t dataSpace) {
35 sp<IOmxNode> hOmxNode = omxNode->getHalInterface();
36 return toBinderStatus(mBase->configure(
37 hOmxNode == nullptr ? new TWOmxNode(omxNode) : hOmxNode,
38 toHardwareDataspace(dataSpace)));
39 }
40
setSuspend(bool suspend,int64_t timeUs)41 BnStatus LWGraphicBufferSource::setSuspend(
42 bool suspend, int64_t timeUs) {
43 return toBinderStatus(mBase->setSuspend(suspend, timeUs));
44 }
45
setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs)46 BnStatus LWGraphicBufferSource::setRepeatPreviousFrameDelayUs(
47 int64_t repeatAfterUs) {
48 return toBinderStatus(mBase->setRepeatPreviousFrameDelayUs(repeatAfterUs));
49 }
50
setMaxFps(float maxFps)51 BnStatus LWGraphicBufferSource::setMaxFps(float maxFps) {
52 return toBinderStatus(mBase->setMaxFps(maxFps));
53 }
54
setTimeLapseConfig(double fps,double captureFps)55 BnStatus LWGraphicBufferSource::setTimeLapseConfig(
56 double fps, double captureFps) {
57 return toBinderStatus(mBase->setTimeLapseConfig(fps, captureFps));
58 }
59
setStartTimeUs(int64_t startTimeUs)60 BnStatus LWGraphicBufferSource::setStartTimeUs(
61 int64_t startTimeUs) {
62 return toBinderStatus(mBase->setStartTimeUs(startTimeUs));
63 }
64
setStopTimeUs(int64_t stopTimeUs)65 BnStatus LWGraphicBufferSource::setStopTimeUs(
66 int64_t stopTimeUs) {
67 return toBinderStatus(mBase->setStopTimeUs(stopTimeUs));
68 }
69
setColorAspects(int32_t aspects)70 BnStatus LWGraphicBufferSource::setColorAspects(
71 int32_t aspects) {
72 return toBinderStatus(mBase->setColorAspects(
73 toHardwareColorAspects(aspects)));
74 }
75
setTimeOffsetUs(int64_t timeOffsetsUs)76 BnStatus LWGraphicBufferSource::setTimeOffsetUs(
77 int64_t timeOffsetsUs) {
78 return toBinderStatus(mBase->setTimeOffsetUs(timeOffsetsUs));
79 }
80
signalEndOfInputStream()81 BnStatus LWGraphicBufferSource::signalEndOfInputStream() {
82 return toBinderStatus(mBase->signalEndOfInputStream());
83 }
84
85 } // namespace utils
86 } // namespace V1_0
87 } // namespace omx
88 } // namespace media
89 } // namespace hardware
90 } // namespace android
91