Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8836e29d authored by Jesse Hall's avatar Jesse Hall Committed by android-build-merger
Browse files

Merge "Move AHardwareBuffer_getNativeHandle to VNDK" into oc-dev am: a2d92c56

am: dfa9b6fb

Change-Id: I3b0a4b2243590c5bc41c81495c53bdcc6cdbdbbb
parents c33832c4 dfa9b6fb
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

#define LOG_TAG "AHardwareBuffer"

#include <android/hardware_buffer.h>
#include <vndk/hardware_buffer.h>

#include <errno.h>
#include <sys/socket.h>
@@ -261,7 +261,12 @@ int AHardwareBuffer_recvHandleFromUnixSocket(int socketFd, AHardwareBuffer** out
    return NO_ERROR;
}

const struct native_handle* AHardwareBuffer_getNativeHandle(

// ----------------------------------------------------------------------------
// VNDK functions
// ----------------------------------------------------------------------------

const native_handle_t* AHardwareBuffer_getNativeHandle(
        const AHardwareBuffer* buffer) {
    if (!buffer) return nullptr;
    const GraphicBuffer* gbuffer = AHardwareBuffer_to_GraphicBuffer(buffer);
+0 −6
Original line number Diff line number Diff line
@@ -252,12 +252,6 @@ int AHardwareBuffer_sendHandleToUnixSocket(const AHardwareBuffer* buffer, int so
 */
int AHardwareBuffer_recvHandleFromUnixSocket(int socketFd, AHardwareBuffer** outBuffer);

// ----------------------------------------------------------------------------
// Everything below here is part of the public NDK API, but is intended only
// for use by device-specific graphics drivers.
struct native_handle;
const struct native_handle* AHardwareBuffer_getNativeHandle(const AHardwareBuffer* buffer);

__END_DECLS

#endif // ANDROID_HARDWARE_BUFFER_H
+31 −0
Original line number Diff line number Diff line
/*
 * Copyright 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H
#define ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H

// vndk is a superset of the NDK
#include <android/hardware_buffer.h>

#include <cutils/native_handle.h>

__BEGIN_DECLS

const native_handle_t* AHardwareBuffer_getNativeHandle(const AHardwareBuffer* buffer);

__END_DECLS

#endif /* ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H */
+0 −1
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ LIBNATIVEWINDOW {
    AHardwareBuffer_allocate;
    AHardwareBuffer_describe;
    AHardwareBuffer_fromHardwareBuffer;
    AHardwareBuffer_getNativeHandle;
    AHardwareBuffer_lock;
    AHardwareBuffer_recvHandleFromUnixSocket;
    AHardwareBuffer_release;
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

#include <android/hardware_buffer.h>
#include <android/native_window.h>
#include <vndk/hardware_buffer.h>
#include <vndk/window.h>

// this checks that all these headers are C-compatible