blob: b4e2975656960aade831d8c88675eb096c2f64da [file] [log] [blame]
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -08001/*
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
Pawin Vongmasaac7d4122017-03-01 05:48:42 -080017#include <media/omx/1.0/WGraphicBufferSource.h>
18#include <media/omx/1.0/WOmxNode.h>
19#include <media/omx/1.0/Conversion.h>
Pawin Vongmasa0d3a5ed2017-02-22 03:19:35 -080020
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080021namespace android {
22namespace hardware {
23namespace media {
24namespace omx {
25namespace V1_0 {
26namespace utils {
27
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080028// LWGraphicBufferSource
29LWGraphicBufferSource::LWGraphicBufferSource(
30 sp<TGraphicBufferSource> const& base) : mBase(base) {
31}
32
Robert Shihd095e652017-03-11 01:20:43 +000033BnStatus LWGraphicBufferSource::configure(
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080034 const sp<IOMXNode>& omxNode, int32_t dataSpace) {
Pawin Vongmasaac7d4122017-03-01 05:48:42 -080035 sp<IOmxNode> hOmxNode = omxNode->getHalInterface();
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080036 return toBinderStatus(mBase->configure(
Pawin Vongmasaac7d4122017-03-01 05:48:42 -080037 hOmxNode == nullptr ? new TWOmxNode(omxNode) : hOmxNode,
38 toHardwareDataspace(dataSpace)));
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080039}
40
Robert Shihd095e652017-03-11 01:20:43 +000041BnStatus LWGraphicBufferSource::setSuspend(
Hangyu Kuang764d9452016-12-13 13:07:45 -080042 bool suspend, int64_t timeUs) {
43 return toBinderStatus(mBase->setSuspend(suspend, timeUs));
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080044}
45
Robert Shihd095e652017-03-11 01:20:43 +000046BnStatus LWGraphicBufferSource::setRepeatPreviousFrameDelayUs(
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080047 int64_t repeatAfterUs) {
48 return toBinderStatus(mBase->setRepeatPreviousFrameDelayUs(repeatAfterUs));
49}
50
Robert Shihd095e652017-03-11 01:20:43 +000051BnStatus LWGraphicBufferSource::setMaxFps(float maxFps) {
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080052 return toBinderStatus(mBase->setMaxFps(maxFps));
53}
54
Robert Shihd095e652017-03-11 01:20:43 +000055BnStatus LWGraphicBufferSource::setTimeLapseConfig(
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080056 int64_t timePerFrameUs, int64_t timePerCaptureUs) {
57 return toBinderStatus(mBase->setTimeLapseConfig(
58 timePerFrameUs, timePerCaptureUs));
59}
60
Robert Shihd095e652017-03-11 01:20:43 +000061BnStatus LWGraphicBufferSource::setStartTimeUs(
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080062 int64_t startTimeUs) {
63 return toBinderStatus(mBase->setStartTimeUs(startTimeUs));
64}
65
Robert Shihd095e652017-03-11 01:20:43 +000066BnStatus LWGraphicBufferSource::setStopTimeUs(
Hangyu Kuang764d9452016-12-13 13:07:45 -080067 int64_t stopTimeUs) {
68 return toBinderStatus(mBase->setStopTimeUs(stopTimeUs));
69}
70
Robert Shihd095e652017-03-11 01:20:43 +000071BnStatus LWGraphicBufferSource::setColorAspects(
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080072 int32_t aspects) {
73 return toBinderStatus(mBase->setColorAspects(
74 toHardwareColorAspects(aspects)));
75}
76
Robert Shihd095e652017-03-11 01:20:43 +000077BnStatus LWGraphicBufferSource::setTimeOffsetUs(
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080078 int64_t timeOffsetsUs) {
79 return toBinderStatus(mBase->setTimeOffsetUs(timeOffsetsUs));
80}
81
Robert Shihd095e652017-03-11 01:20:43 +000082BnStatus LWGraphicBufferSource::signalEndOfInputStream() {
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080083 return toBinderStatus(mBase->signalEndOfInputStream());
84}
85
Pawin Vongmasaeeac97b2017-01-18 05:03:07 -080086} // namespace utils
87} // namespace V1_0
88} // namespace omx
89} // namespace media
90} // namespace hardware
91} // namespace android