VirtualDisplaySurface.cpp revision 99c7dbb24994df2f3e175f7b25dd2c9dd92a72f0
199c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall/*
299c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * Copyright 2013 The Android Open Source Project
399c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall *
499c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * Licensed under the Apache License, Version 2.0 (the "License");
599c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * you may not use this file except in compliance with the License.
699c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * You may obtain a copy of the License at
799c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall *
899c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall *      http://www.apache.org/licenses/LICENSE-2.0
999c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall *
1099c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * Unless required by applicable law or agreed to in writing, software
1199c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * distributed under the License is distributed on an "AS IS" BASIS,
1299c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1399c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * See the License for the specific language governing permissions and
1499c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall * limitations under the License.
1599c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall */
1699c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
1799c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall#include <gui/IGraphicBufferProducer.h>
1899c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall#include "VirtualDisplaySurface.h"
1999c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
2099c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall// ---------------------------------------------------------------------------
2199c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hallnamespace android {
2299c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall// ---------------------------------------------------------------------------
2399c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
2499c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse HallVirtualDisplaySurface::VirtualDisplaySurface(HWComposer& hwc, int disp,
2599c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall        const sp<IGraphicBufferProducer>& sink, const String8& name)
2699c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall:   mHwc(hwc),
2799c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    mDisplayId(disp),
2899c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    mSink(sink),
2999c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    mName(name)
3099c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall{}
3199c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
3299c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse HallVirtualDisplaySurface::~VirtualDisplaySurface() {
3399c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall}
3499c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
3599c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hallsp<IGraphicBufferProducer> VirtualDisplaySurface::getIGraphicBufferProducer() const {
3699c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    return mSink;
3799c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall}
3899c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
3999c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hallstatus_t VirtualDisplaySurface::compositionComplete() {
4099c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    return NO_ERROR;
4199c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall}
4299c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
4399c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hallstatus_t VirtualDisplaySurface::advanceFrame() {
4499c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    return NO_ERROR;
4599c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall}
4699c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
4799c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hallstatus_t VirtualDisplaySurface::setReleaseFenceFd(int fenceFd) {
4899c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    if (fenceFd >= 0) {
4999c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall        ALOGW("[%s] unexpected release fence", mName.string());
5099c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall        close(fenceFd);
5199c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    }
5299c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall    return NO_ERROR;
5399c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall}
5499c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
5599c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hallvoid VirtualDisplaySurface::dump(String8& result) const {
5699c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall}
5799c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall
5899c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall// ---------------------------------------------------------------------------
5999c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall} // namespace android
6099c7dbb24994df2f3e175f7b25dd2c9dd92a72f0Jesse Hall// ---------------------------------------------------------------------------
61