[-]
[+]
|
Changed |
_service:tar_git:libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/camera/Android.mk
^
|
@@ -52,9 +52,8 @@
LOCAL_C_INCLUDES := \
$(HYBRIS_PATH)/include \
bionic \
- bionic/libstdc++/include \
+ external/libcxx/include \
external/gtest/include \
- external/stlport/stlport \
external/skia/include/core \
LOCAL_SHARED_LIBRARIES := \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/camera/camera_compatibility_layer.cpp
^
|
@@ -50,8 +50,9 @@
#include <utils/KeyedVector.h>
#include <utils/Log.h>
#include <utils/String16.h>
-
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
#include <gui/NativeBufferAlloc.h>
+#endif
#include <cstring>
@@ -140,6 +141,12 @@
(void) data;
}
+void CameraControl::postRecordingFrameHandleTimestamp(nsecs_t /*timestamp*/, native_handle_t* /*handle*/)
+{
+ REPORT_FUNCTION();
+}
+
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
namespace android
{
NativeBufferAlloc::NativeBufferAlloc() {
@@ -165,6 +172,7 @@
return graphicBuffer;
}
}
+#endif
int android_camera_get_number_of_devices()
{
@@ -220,7 +228,9 @@
android::sp<CameraControl> cc = new CameraControl();
cc->listener = listener;
-#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR>=3 || ANDROID_VERSION_MAJOR==5 || ANDROID_VERSION_MAJOR>=6
+#if ANDROID_VERSION_MAJOR>=7
+ cc->camera = android::Camera::connect(camera_id, android::String16("hybris"), android::Camera::USE_CALLING_UID, android::Camera::USE_CALLING_PID);
+#elif ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR>=3 || ANDROID_VERSION_MAJOR>=5
cc->camera = android::Camera::connect(camera_id, android::String16("hybris"), android::Camera::USE_CALLING_UID);
#else
cc->camera = android::Camera::connect(camera_id);
@@ -315,10 +325,13 @@
assert(control);
android::Mutex::Autolock al(control->guard);
- android::String8 raw_modes;
- raw_modes = android::String8(
+ const char* raw_modes_cstr =
control->camera_parameters.get(
- android::CameraParameters::KEY_SUPPORTED_FLASH_MODES));
+ android::CameraParameters::KEY_SUPPORTED_FLASH_MODES);
+ if (!raw_modes_cstr)
+ return;
+
+ android::String8 raw_modes = android::String8(raw_modes_cstr);
const char delimiter[2] = ",";
char *token;
@@ -685,9 +698,11 @@
static const bool allow_synchronous_mode = false;
static const bool is_controlled_by_app = true;
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
android::sp<android::NativeBufferAlloc> native_alloc(
new android::NativeBufferAlloc()
);
+#endif
#if ANDROID_VERSION_MAJOR>=5
android::sp<android::IGraphicBufferProducer> producer;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/camera/direct_camera_test.cpp
^
|
@@ -675,6 +675,7 @@
while (1) {
usleep(50);
+ preview_texture_needs_update_cb(0);
}
stop_video_recording(recorder);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/hwc2/Android.mk
^
|
@@ -12,8 +12,15 @@
LOCAL_C_INCLUDES := ../hybris/include
+ifeq ($(strip $(ANDROID_VERSION_MAJOR)),9)
+LOCAL_C_INCLUDES += \
+ hardware/interfaces/graphics/composer/2.1/utils/command-buffer/include
+LOCAL_HEADER_LIBRARIES : \
+ android.hardware.graphics.composer@2.1-command-buffer
+else
LOCAL_STATIC_LIBRARIES := \
libhwcomposer-command-buffer
+endif
LOCAL_SHARED_LIBRARIES := \
android.frameworks.vr.composer@1.0 \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/hwc2/ComposerHal.h
^
|
@@ -26,7 +26,11 @@
#include <android/frameworks/vr/composer/1.0/IVrComposerClient.h>
#include <android/hardware/graphics/composer/2.1/IComposer.h>
#include <utils/StrongPointer.h>
+#if ANDROID_VERSION_MAJOR >= 9
+#include <composer-command-buffer/2.1/ComposerCommandBuffer.h>
+#else
#include <IComposerCommandBuffer.h>
+#endif
namespace android {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/hwc2/HWC2.cpp
^
|
@@ -26,6 +26,9 @@
#include <ui/Fence.h>
#include <ui/FloatRect.h>
#include <ui/GraphicBuffer.h>
+#if ANDROID_VERSION_MAJOR >= 9
+#include <ui/GraphicTypes.h>
+#endif
#include <ui/Region.h>
#include <android/configuration.h>
@@ -471,10 +474,17 @@
&maxLuminance, &maxAverageLuminance, &minLuminance);
auto error = static_cast<HWC2::Error>(intError);
+#if ANDROID_VERSION_MAJOR >= 9
+ std::vector<android::ui::Hdr> types;
+ for (auto type : intTypes) {
+ types.push_back(static_cast<android::ui::Hdr>(type));
+ }
+#else
std::vector<int32_t> types;
for (auto type : intTypes) {
types.push_back(static_cast<int32_t>(type));
}
+#endif
numTypes = types.size();
if (error != Error::None) {
return error;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/hwc2/hwc2_compatibility_layer.cpp
^
|
@@ -178,7 +178,8 @@
if (!layer)
return nullptr;
- display->self->createLayer(&layer->self);
+ if (display->self->createLayer(&layer->self) != HWC2::Error::None)
+ return nullptr;
return layer;
}
@@ -186,9 +187,9 @@
void hwc2_compat_display_destroy_layer(hwc2_compat_display_t* display,
hwc2_compat_layer_t* layer)
{
- display->self->destroyLayer(layer->self);
+ if (display->self->destroyLayer(layer->self) != HWC2::Error::None)
+ delete layer->self;
- delete layer->self;
free(layer);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/input/Android.mk
^
|
@@ -62,9 +62,8 @@
LOCAL_C_INCLUDES := \
$(HYBRIS_PATH)/include \
bionic \
- bionic/libstdc++/include \
+ external/libcxx/include \
external/gtest/include \
- external/stlport/stlport \
external/skia/include/core
LOCAL_SHARED_LIBRARIES := \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/input/input_compatibility_layer.cpp
^
|
@@ -67,13 +67,13 @@
ct,
SkAlphaType::kPremul_SkAlphaType),
0);
-#elif ANDROID_VERSION_MAJOR==6
-bitmap.setInfo(
- SkImageInfo::Make(bitmap_width,
- bitmap_height,
- kRGBA_8888_SkColorType,
- SkAlphaType::kPremul_SkAlphaType),
- 0);
+#elif ANDROID_VERSION_MAJOR>=6
+ bitmap.setInfo(
+ SkImageInfo::Make(bitmap_width,
+ bitmap_height,
+ kRGBA_8888_SkColorType,
+ SkAlphaType::kPremul_SkAlphaType),
+ 0);
#endif
bitmap.allocPixels();
@@ -107,6 +107,17 @@
outResources->spotAnchor = spotAnchorIcon.copy();
}
+#if ANDROID_VERSION_MAJOR >= 7
+ void loadPointerIcon(android::SpriteIcon*)
+ {
+ }
+
+ void loadAdditionalMouseResources(std::map<int32_t, android::SpriteIcon>* /*coutResources*/,
+ std::map<int32_t, android::PointerAnimation>* /*outAnimationResources*/) {}
+ int32_t getDefaultPointerIconId() { return 0; }
+ int32_t getCustomPointerIconId() { return 0; }
+#endif
+
android::SpriteIcon spotHoverIcon;
android::SpriteIcon spotTouchIcon;
android::SpriteIcon spotAnchorIcon;
@@ -365,14 +376,24 @@
void android_input_stack_start()
{
+#if ANDROID_VERSION_MAJOR >= 7
+ global_state->input_reader_thread->run("input");
+ global_state->looper_thread->run("loop");
+#else
global_state->input_reader_thread->run();
global_state->looper_thread->run();
+#endif
}
void android_input_stack_start_waiting_for_flag(bool* flag)
{
+#if ANDROID_VERSION_MAJOR >= 7
+ global_state->input_reader_thread->run("input");
+ global_state->looper_thread->run("loop");
+#else
global_state->input_reader_thread->run();
global_state->looper_thread->run();
+#endif
while (!*flag) {
global_state->wait_condition.waitRelative(
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/Android.mk
^
|
@@ -9,11 +9,16 @@
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../Android.common.mk
+ifeq ($(CAMERA_SERVICE_WANT_UBUNTU_HEADERS),1)
+ LOCAL_CPPFLAGS += -DWANT_UBUNTU_CAMERA_HEADERS
+endif
+
LOCAL_SRC_FILES := \
camera_service.cpp
LOCAL_SHARED_LIBRARIES := \
libcameraservice \
+ libcamera_client \
libmedialogservice \
libcutils \
libmedia \
@@ -120,6 +125,7 @@
frameworks/av/media/libstagefright/include \
frameworks/av/include \
frameworks/native/include \
+ frameworks/native/include/media/hardware \
system/media/audio_utils/include \
frameworks/av/services/camera/libcameraservice
@@ -162,9 +168,8 @@
LOCAL_C_INCLUDES := \
$(HYBRIS_PATH)/include \
bionic \
- bionic/libstdc++/include \
+ external/libcxx/include \
external/gtest/include \
- external/stlport/stlport \
external/skia/include/core \
frameworks/base/include
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/camera_service.cpp
^
|
@@ -23,7 +23,10 @@
#include "media_recorder_factory.h"
#include "media_recorder.h"
+#if ANDROID_VERSION_MAJOR==5 && WANT_UBUNTU_CAMERA_HEADERS
#include <media/camera_record_service.h>
+#endif
+
#include <CameraService.h>
#include <signal.h>
@@ -45,7 +48,9 @@
// for creating a new IMediaRecorder (MediaRecorder) instance over Binder
MediaRecorderFactory::instantiate();
// Enable audio recording for camera recording
+#if ANDROID_VERSION_MAJOR==5 && WANT_UBUNTU_CAMERA_HEADERS
CameraRecordService::instantiate();
+#endif
CameraService::instantiate();
ProcessState::self()->startThreadPool();
IPCThreadState::self()->joinThreadPool();
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/decoding_service.cpp
^
|
@@ -38,7 +38,9 @@
#include <gui/IGraphicBufferProducer.h>
#include <gui/IGraphicBufferConsumer.h>
#include <gui/Surface.h>
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
#include <gui/NativeBufferAlloc.h>
+#endif
namespace android {
@@ -290,7 +292,9 @@
buffer_queue = new BufferQueue(NULL);
ALOGD("buffer_queue: %p", (void*)buffer_queue.get());
#endif
-#if ANDROID_VERSION_MAJOR>=5
+#if ANDROID_VERSION_MAJOR>=7
+ producer->setMaxDequeuedBufferCount(5);
+#elif ANDROID_VERSION_MAJOR>=5
producer->setBufferCount(5);
#else
buffer_queue->setBufferCount(5);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/media_codec_source_layer.cpp
^
|
@@ -351,11 +351,16 @@
bool media_codec_source_request_idr_frame(MediaCodecSourceWrapper *source)
{
+#if ANDROID_VERSION_MAJOR < 7
MediaCodecSourcePrivate *d = MediaCodecSourcePrivate::toPrivate(source);
if (!d || !d->codec.get())
return false;
android::status_t err = d->codec->requestIDRFrame();
+#else
+ // requestIDRFrame is done in start
+ android::status_t err = android::OK;
+#endif
if (err != android::OK)
return false;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/media_compatibility_layer.cpp
^
|
@@ -44,10 +44,13 @@
#include <utils/Log.h>
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
#include <gui/NativeBufferAlloc.h>
+#endif
#define REPORT_FUNCTION() ALOGV("%s \n", __PRETTY_FUNCTION__)
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
namespace android
{
NativeBufferAlloc::NativeBufferAlloc() {
@@ -73,6 +76,8 @@
return graphicBuffer;
}
}
+#endif
+
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=2
struct FrameAvailableListener : public android::SurfaceTexture::FrameAvailableListener
#else
@@ -254,8 +259,10 @@
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=2
surfaceTexture->getBufferQueue()->setBufferCount(5);
-#else
+#elif ANDROID_VERSION_MAJOR<7
bq->setBufferCount(5);
+#else
+ bq->setMaxDequeuedBufferCount(5);
#endif
texture = surfaceTexture;
texture->setFrameAvailableListener(frame_listener);
@@ -488,15 +495,16 @@
return BAD_VALUE;
}
- android::sp<android::NativeBufferAlloc> native_alloc(
- new android::NativeBufferAlloc()
- );
-
#if ANDROID_VERSION_MAJOR>=5
android::sp<IGraphicBufferProducer> producer;
android::sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
#else
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
+ android::sp<android::NativeBufferAlloc> native_alloc(
+ new android::NativeBufferAlloc()
+ );
+#endif
android::sp<android::BufferQueue> buffer_queue(
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
new android::BufferQueue(false, NULL, native_alloc)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/media_recorder.cpp
^
|
@@ -24,16 +24,23 @@
#include "media_recorder_factory.h"
#include <utils/Log.h>
+#if ANDROID_VERSION_MAJOR >= 7
+#include <camera/android/hardware/ICamera.h>
+#endif
#include <binder/IServiceManager.h>
#include <utils/String8.h>
#include <media/IMediaPlayerService.h>
#include <media/IMediaRecorder.h>
#include <media/mediaplayer.h> // for MEDIA_ERROR_SERVER_DIED
#include <gui/IGraphicBufferProducer.h>
+namespace a = android;
+namespace ah = android::hardware;
-namespace android {
-
-status_t MediaRecorder::setCamera(const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy)
+#if ANDROID_VERSION_MAJOR >= 7
+a::status_t a::MediaRecorder::setCamera(const sp<ah::ICamera>& camera, const sp<ICameraRecordingProxy>& proxy)
+#else
+a::status_t a::MediaRecorder::setCamera(const sp<a::ICamera>& camera, const sp<ICameraRecordingProxy>& proxy)
+#endif
{
ALOGV("setCamera(%p,%p)", camera.get(), proxy.get());
if (mMediaRecorder == NULL) {
@@ -54,7 +61,7 @@
return ret;
}
-status_t MediaRecorder::setPreviewSurface(const sp<IGraphicBufferProducer>& surface)
+a::status_t a::MediaRecorder::setPreviewSurface(const sp<IGraphicBufferProducer>& surface)
{
ALOGV("setPreviewSurface(%p)", surface.get());
if (mMediaRecorder == NULL) {
@@ -79,7 +86,7 @@
return ret;
}
-status_t MediaRecorder::init()
+a::status_t a::MediaRecorder::init()
{
ALOGV("init");
if (mMediaRecorder == NULL) {
@@ -109,7 +116,7 @@
return ret;
}
-status_t MediaRecorder::setVideoSource(int vs)
+a::status_t a::MediaRecorder::setVideoSource(int vs)
{
ALOGV("setVideoSource(%d)", vs);
if (mMediaRecorder == NULL) {
@@ -144,7 +151,7 @@
return ret;
}
-status_t MediaRecorder::setAudioSource(int as)
+a::status_t a::MediaRecorder::setAudioSource(int as)
{
ALOGV("setAudioSource(%d)", as);
if (mMediaRecorder == NULL) {
@@ -177,7 +184,7 @@
return ret;
}
-status_t MediaRecorder::setOutputFormat(int of)
+a::status_t a::MediaRecorder::setOutputFormat(int of)
{
ALOGV("setOutputFormat(%d)", of);
if (mMediaRecorder == NULL) {
@@ -203,7 +210,7 @@
return ret;
}
-status_t MediaRecorder::setVideoEncoder(int ve)
+a::status_t a::MediaRecorder::setVideoEncoder(int ve)
{
ALOGV("setVideoEncoder(%d)", ve);
if (mMediaRecorder == NULL) {
@@ -233,7 +240,7 @@
return ret;
}
-status_t MediaRecorder::setAudioEncoder(int ae)
+a::status_t a::MediaRecorder::setAudioEncoder(int ae)
{
ALOGV("setAudioEncoder(%d)", ae);
if (mMediaRecorder == NULL) {
@@ -263,7 +270,7 @@
return ret;
}
#if ANDROID_VERSION_MAJOR<=5
-status_t MediaRecorder::setOutputFile(const char* path)
+a::status_t a::MediaRecorder::setOutputFile(const char* path)
{
ALOGV("setOutputFile(%s)", path);
if (mMediaRecorder == NULL) {
@@ -290,7 +297,7 @@
}
#endif
-status_t MediaRecorder::setOutputFile(int fd, int64_t offset, int64_t length)
+a::status_t a::MediaRecorder::setOutputFile(int fd, int64_t offset, int64_t length)
{
ALOGV("setOutputFile(%d, %lld, %lld)", fd, offset, length);
if (mMediaRecorder == NULL) {
@@ -327,7 +334,7 @@
return ret;
}
-status_t MediaRecorder::setVideoSize(int width, int height)
+a::status_t a::MediaRecorder::setVideoSize(int width, int height)
{
ALOGV("setVideoSize(%d, %d)", width, height);
if (mMediaRecorder == NULL) {
@@ -356,7 +363,7 @@
// Query a SurfaceMediaSurface through the Mediaserver, over the
// binder interface. This is used by the Filter Framework (MediaEncoder)
// to get an <IGraphicBufferProducer> object to hook up to ANativeWindow.
-sp<IGraphicBufferProducer> MediaRecorder::
+a::sp<a::IGraphicBufferProducer> a::MediaRecorder::
querySurfaceMediaSourceFromMediaServer()
{
Mutex::Autolock _l(mLock);
@@ -368,7 +375,7 @@
return mSurfaceMediaSource;
}
-status_t MediaRecorder::setVideoFrameRate(int frames_per_second)
+a::status_t a::MediaRecorder::setVideoFrameRate(int frames_per_second)
{
ALOGV("setVideoFrameRate(%d)", frames_per_second);
if (mMediaRecorder == NULL) {
@@ -393,7 +400,7 @@
return ret;
}
-status_t MediaRecorder::setParameters(const String8& params) {
+a::status_t a::MediaRecorder::setParameters(const String8& params) {
ALOGV("setParameters(%s)", params.string());
if (mMediaRecorder == NULL) {
ALOGE("media recorder is not initialized yet");
@@ -420,7 +427,7 @@
return ret;
}
-status_t MediaRecorder::prepare()
+a::status_t a::MediaRecorder::prepare()
{
ALOGV("prepare");
if (mMediaRecorder == NULL) {
@@ -459,7 +466,7 @@
return ret;
}
-status_t MediaRecorder::getMaxAmplitude(int* max)
+a::status_t a::MediaRecorder::getMaxAmplitude(int* max)
{
ALOGV("getMaxAmplitude");
if (mMediaRecorder == NULL) {
@@ -480,7 +487,7 @@
return ret;
}
-status_t MediaRecorder::start()
+a::status_t a::MediaRecorder::start()
{
ALOGV("start");
if (mMediaRecorder == NULL) {
@@ -502,7 +509,7 @@
return ret;
}
-status_t MediaRecorder::stop()
+a::status_t a::MediaRecorder::stop()
{
ALOGV("stop");
if (mMediaRecorder == NULL) {
@@ -530,7 +537,7 @@
}
// Reset should be OK in any state
-status_t MediaRecorder::reset()
+a::status_t a::MediaRecorder::reset()
{
ALOGV("reset");
if (mMediaRecorder == NULL) {
@@ -566,7 +573,7 @@
return ret;
}
-status_t MediaRecorder::close()
+a::status_t a::MediaRecorder::close()
{
ALOGV("close");
if (!(mCurrentState & MEDIA_RECORDER_INITIALIZED)) {
@@ -584,7 +591,7 @@
return ret;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/media_recorder.h
^
|
@@ -34,7 +34,13 @@
class Surface;
class IMediaRecorder;
class IMediaRecorderFactory;
+#if ANDROID_VERSION_MAJOR >= 7
+namespace hardware {
class ICamera;
+}
+#else
+class ICamera;
+#endif
class ICameraRecordingProxy;
class IGraphicBufferProducer;
class Surface;
@@ -214,7 +220,11 @@
void died();
status_t initCheck();
+#if ANDROID_VERSION_MAJOR>=7
+ status_t setCamera(const sp<hardware::ICamera>& camera, const sp<ICameraRecordingProxy>& proxy);
+#else
status_t setCamera(const sp<ICamera>& camera, const sp<ICameraRecordingProxy>& proxy);
+#endif
status_t setPreviewSurface(const sp<IGraphicBufferProducer>& surface);
status_t setVideoSource(int vs);
status_t setAudioSource(int as);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/media_recorder_client.cpp
^
|
@@ -52,9 +52,13 @@
REPORT_FUNCTION();
release();
}
-
+#if ANDROID_VERSION_MAJOR >= 7
+status_t MediaRecorderClient::setCamera(const sp<android::hardware::ICamera>& camera,
+ const sp<ICameraRecordingProxy>& proxy)
+#else
status_t MediaRecorderClient::setCamera(const sp<android::ICamera>& camera,
const sp<ICameraRecordingProxy>& proxy)
+#endif
{
REPORT_FUNCTION();
Mutex::Autolock lock(recorder_lock);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/media_recorder_client.h
^
|
@@ -32,6 +32,13 @@
class Mutex;
class BpMediaRecorderObserver;
+#if ANDROID_VERSION_MAJOR >= 7
+namespace hardware {
+class ICamera;
+}
+#else
+class ICamera;
+#endif
/*!
* \brief The MediaRecorderClient struct wraps the service side of the MediaRecorder class
*/
@@ -41,8 +48,13 @@
MediaRecorderClient();
virtual ~MediaRecorderClient();
+#if ANDROID_VERSION_MAJOR>=7
+ virtual status_t setCamera(const sp<android::hardware::ICamera>& camera,
+ const sp<ICameraRecordingProxy>& proxy);
+#else
virtual status_t setCamera(const sp<ICamera>& camera,
const sp<ICameraRecordingProxy>& proxy);
+#endif
virtual status_t setPreviewSurface(const sp<IGraphicBufferProducer>& surface);
virtual status_t setVideoSource(int vs);
virtual status_t setAudioSource(int as);
@@ -64,10 +76,10 @@
virtual status_t getMaxAmplitude(int* max);
virtual status_t start();
virtual status_t stop();
-#ifdef BOARD_HAS_MEDIA_RECORDER_PAUSE
+#if defined(BOARD_HAS_MEDIA_RECORDER_PAUSE) || ANDROID_VERSION_MAJOR>=7
virtual status_t pause();
#endif
-#ifdef BOARD_HAS_MEDIA_RECORDER_RESUME
+#if defined(BOARD_HAS_MEDIA_RECORDER_RESUME) || ANDROID_VERSION_MAJOR>=7
virtual status_t resume();
#endif
virtual status_t reset();
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/media/media_recorder_layer.cpp
^
|
@@ -26,6 +26,9 @@
#include <hybris/internal/camera_control.h>
#include <hybris/media/media_recorder_layer.h>
+#if ANDROID_MAJOR_VERSION >= 7
+#include "camera/android/hardware/ICamera.h"
+#endif
#include <utils/KeyedVector.h>
#include <utils/Log.h>
@@ -230,7 +233,6 @@
}
mr->init();
-
return mr->setCamera(control->camera->remote(), control->camera->getRecordingProxy());
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/compat/surface_flinger/direct_sf_test.cpp
^
|
@@ -21,6 +21,7 @@
#include <cstdio>
#include <unistd.h>
+#include <stdlib.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -65,6 +65,7 @@
#include <sys/syscall.h>
#include <sys/auxv.h>
#include <sys/prctl.h>
+#include <sys/uio.h>
#include <sys/mman.h>
#include <libgen.h>
@@ -2467,6 +2468,66 @@
return getwc(_get_actual_fp(stream));
}
+static size_t _hybris_hook___fbufsize(FILE *stream)
+{
+ TRACE_HOOK("__fbufsize");
+ return __fbufsize(_get_actual_fp(stream));
+}
+
+static size_t _hybris_hook___fpending(FILE *stream)
+{
+ TRACE_HOOK("__fpending");
+ return __fpending(_get_actual_fp(stream));
+}
+
+static int _hybris_hook___flbf(FILE *stream)
+{
+ TRACE_HOOK("__flbf");
+ return __flbf(_get_actual_fp(stream));
+}
+
+static int _hybris_hook___freadable(FILE *stream)
+{
+ TRACE_HOOK("__freadable");
+ return __freadable(_get_actual_fp(stream));
+}
+
+static int _hybris_hook___fwritable(FILE *stream)
+{
+ TRACE_HOOK("__fwritable");
+ return __fwritable(_get_actual_fp(stream));
+}
+
+static int _hybris_hook___freading(FILE *stream)
+{
+ TRACE_HOOK("__freading");
+ return __freading(_get_actual_fp(stream));
+}
+
+static int _hybris_hook___fwriting(FILE *stream)
+{
+ TRACE_HOOK("__fwriting");
+ return __fwriting(_get_actual_fp(stream));
+}
+
+static int _hybris_hook___fsetlocking(FILE *stream, int type)
+{
+ TRACE_HOOK("__fsetlocking");
+ return __fsetlocking(_get_actual_fp(stream), type);
+}
+
+static void _hybris_hook__flushlbf(void)
+{
+ TRACE_HOOK("_flushlbf");
+ _flushlbf();
+}
+
+static void _hybris_hook___fpurge(FILE *stream)
+{
+ TRACE_HOOK("__fpurge");
+ __fpurge(_get_actual_fp(stream));
+}
+
static void *_hybris_hook_dlopen(const char *filename, int flag)
{
TRACE("filename %s flag %i", filename, flag);
@@ -2630,7 +2691,7 @@
HOOK_INDIRECT(malloc),
HOOK_INDIRECT(free),
HOOK_DIRECT_NO_DEBUG(calloc),
- HOOK_DIRECT_NO_DEBUG(cfree),
+ HOOK_DIRECT_NO_DEBUG(free),
HOOK_DIRECT_NO_DEBUG(realloc),
HOOK_DIRECT_NO_DEBUG(memalign),
HOOK_DIRECT_NO_DEBUG(valloc),
@@ -2901,6 +2962,17 @@
HOOK_DIRECT_NO_DEBUG(__cxa_finalize),
/* sys/prctl.h */
HOOK_INDIRECT(prctl),
+ /* stdio_ext.h */
+ HOOK_INDIRECT(__fbufsize),
+ HOOK_INDIRECT(__fpending),
+ HOOK_INDIRECT(__flbf),
+ HOOK_INDIRECT(__freadable),
+ HOOK_INDIRECT(__fwritable),
+ HOOK_INDIRECT(__freading),
+ HOOK_INDIRECT(__fwriting),
+ HOOK_INDIRECT(__fsetlocking),
+ HOOK_INDIRECT(_flushlbf),
+ HOOK_INDIRECT(__fpurge),
};
static struct _hook hooks_mm[] = {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/common/mm/linker.cpp
^
|
@@ -3231,10 +3231,10 @@
}
// Use LD_LIBRARY_PATH and LD_PRELOAD (but only if we aren't setuid/setgid).
- if (DEFAULT_HYBRIS_LD_LIBRARY_PATH)
- parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
- else
+ if (ldpath_env)
parse_LD_LIBRARY_PATH(ldpath_env);
+ else
+ parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
parse_LD_PRELOAD(ldpreload_env);
somain = si;
@@ -3384,10 +3384,10 @@
ldpreload_env = getenv("HYBRIS_LD_PRELOAD");
}
- if (DEFAULT_HYBRIS_LD_LIBRARY_PATH)
- parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
- else
+ if (ldpath_env)
parse_LD_LIBRARY_PATH(ldpath_env);
+ else
+ parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
parse_LD_PRELOAD(ldpreload_env);
if (sdk_version > 0)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/common/n/linker.cpp
^
|
@@ -181,33 +181,51 @@
#if defined(__LP64__)
static const char* const kSystemLibDir = "/system/lib64";
static const char* const kVendorLibDir = "/vendor/lib64";
+static const char* const kVendorLibEglDir = "/vendor/lib64/egl";
static const char* const kOdmLibDir = "/odm/lib64";
+static const char* const kOdmLibEglDir = "/odm/lib64/egl";
static const char* const kAsanSystemLibDir = "/data/lib64";
static const char* const kAsanVendorLibDir = "/data/vendor/lib64";
+static const char* const kAsanVendorLibEglDir = "/data/vendor/lib64/egl";
static const char* const kAsanOdmLibDir = "/data/odm/lib64";
+static const char* const kAsanOdmLibEglDir = "/data/odm/lib64/egl";
#else
static const char* const kSystemLibDir = "/system/lib";
static const char* const kVendorLibDir = "/vendor/lib";
+static const char* const kVendorLibEglDir = "/vendor/lib/egl";
static const char* const kOdmLibDir = "/odm/lib";
+static const char* const kOdmLibEglDir = "/odm/lib/egl";
static const char* const kAsanSystemLibDir = "/data/lib";
static const char* const kAsanVendorLibDir = "/data/vendor/lib";
+static const char* const kAsanVendorLibEglDir = "/data/vendor/lib/egl";
static const char* const kAsanOdmLibDir = "/data/odm/lib";
+static const char* const kAsanOdmLibEglDir = "/data/odm/lib/egl";
#endif
static const char* const kDefaultLdPaths[] = {
kSystemLibDir,
- kVendorLibDir,
kOdmLibDir,
+ kVendorLibDir,
+
+ // libhybris support:
+ kVendorLibEglDir,
+ kOdmLibEglDir,
nullptr
};
static const char* const kAsanDefaultLdPaths[] = {
kAsanSystemLibDir,
kSystemLibDir,
- kAsanVendorLibDir,
- kVendorLibDir,
kAsanOdmLibDir,
kOdmLibDir,
+ kAsanVendorLibDir,
+ kVendorLibDir,
+
+ // libhybris support:
+ kAsanOdmLibEglDir,
+ kOdmLibEglDir,
+ kAsanVendorLibEglDir,
+ kVendorLibEglDir,
nullptr
};
@@ -4543,10 +4561,10 @@
#endif
// Use LD_LIBRARY_PATH and LD_PRELOAD (but only if we aren't setuid/setgid).
- if (DEFAULT_HYBRIS_LD_LIBRARY_PATH)
- parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
- else
+ if (ldpath_env)
parse_LD_LIBRARY_PATH(ldpath_env);
+ else
+ parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
parse_LD_PRELOAD(ldpreload_env);
parse_LD_SHIM_LIBS(ldshim_libs_env);
@@ -4701,10 +4719,10 @@
ldpreload_env = getenv("HYBRIS_LD_PRELOAD");
}
- if (DEFAULT_HYBRIS_LD_LIBRARY_PATH)
- parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
- else
+ if (ldpath_env)
parse_LD_LIBRARY_PATH(ldpath_env);
+ else
+ parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
parse_LD_PRELOAD(ldpreload_env);
if (sdk_version > 0)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/common/o/Makefile.am
^
|
@@ -49,6 +49,11 @@
-DDEFAULT_HYBRIS_LD_LIBRARY_PATH="\"@DEFAULT_HYBRIS_LD_LIBRARY_PATH@\"" \
$(ARCH_FLAGS) \
$(ANDROID_HEADERS_CFLAGS)
+
+if HAS_ANDROID_9_0_0
+o_la_CPPFLAGS += -DHAS_ANDROID_9_0_0
+endif
+
o_la_LDFLAGS = \
-lsupc++ \
-module \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/common/o/linker.cpp
^
|
@@ -107,35 +107,74 @@
#if defined(__LP64__)
static const char* const kSystemLibDir = "/system/lib64";
static const char* const kVendorLibDir = "/vendor/lib64";
+static const char* const kVendorLibEglDir = "/vendor/lib64/egl";
static const char* const kOdmLibDir = "/odm/lib64";
+static const char* const kOdmLibEglDir = "/odm/lib64/egl";
+#ifdef HAS_ANDROID_9_0_0
+static const char* const kSystemLibVndk28Dir = "/system/lib64/vndk-28";
+#endif
static const char* const kAsanSystemLibDir = "/data/asan/system/lib64";
static const char* const kAsanVendorLibDir = "/data/asan/vendor/lib64";
+static const char* const kAsanVendorLibEglDir = "/data/asan/vendor/lib64/egl";
static const char* const kAsanOdmLibDir = "/data/asan/odm/lib64";
+static const char* const kAsanOdmLibEglDir = "/data/asan/odm/lib64/egl";
+#ifdef HAS_ANDROID_9_0_0
+static const char* const kAsanSystemLibVndk28Dir = "/data/asan/system/lib64/vndk-28";
+#endif
#else
static const char* const kSystemLibDir = "/system/lib";
static const char* const kVendorLibDir = "/vendor/lib";
+static const char* const kVendorLibEglDir = "/vendor/lib/egl";
static const char* const kOdmLibDir = "/odm/lib";
+static const char* const kOdmLibEglDir = "/odm/lib/egl";
+#ifdef HAS_ANDROID_9_0_0
+static const char* const kSystemLibVndk28Dir = "/system/lib/vndk-28";
+#endif
static const char* const kAsanSystemLibDir = "/data/asan/system/lib";
static const char* const kAsanVendorLibDir = "/data/asan/vendor/lib";
+static const char* const kAsanVendorLibEglDir = "/data/asan/vendor/lib/egl";
static const char* const kAsanOdmLibDir = "/data/asan/odm/lib";
+static const char* const kAsanOdmLibEglDir = "/data/asan/odm/lib/egl";
+#ifdef HAS_ANDROID_9_0_0
+static const char* const kAsanSystemLibVndk28Dir = "/data/asan/system/lib/vndk-28";
+#endif
#endif
static const char* const kAsanLibDirPrefix = "/data/asan";
static const char* const kDefaultLdPaths[] = {
kSystemLibDir,
- kVendorLibDir,
kOdmLibDir,
+ kVendorLibDir,
+
+ // libhybris support:
+ kOdmLibEglDir,
+ kVendorLibEglDir,
+
+#ifdef HAS_ANDROID_9_0_0
+ kSystemLibVndk28Dir,
+#endif
nullptr
};
static const char* const kAsanDefaultLdPaths[] = {
kAsanSystemLibDir,
kSystemLibDir,
- kAsanVendorLibDir,
- kVendorLibDir,
kAsanOdmLibDir,
kOdmLibDir,
+ kAsanVendorLibDir,
+ kVendorLibDir,
+
+ // libhybris support:
+ kAsanOdmLibEglDir,
+ kOdmLibEglDir,
+ kAsanVendorLibEglDir,
+ kVendorLibEglDir,
+
+#ifdef HAS_ANDROID_9_0_0
+ kAsanSystemLibVndk28Dir,
+ kSystemLibVndk28Dir,
+#endif
nullptr
};
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/common/o/linker_main.cpp
^
|
@@ -340,10 +340,10 @@
}
// Use LD_LIBRARY_PATH and LD_PRELOAD (but only if we aren't setuid/setgid).
- if (DEFAULT_HYBRIS_LD_LIBRARY_PATH)
- parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
- else
+ if (ldpath_env)
parse_LD_LIBRARY_PATH(ldpath_env);
+ else
+ parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
parse_LD_PRELOAD(ldpreload_env);
somain = si;
@@ -516,10 +516,10 @@
ldpreload_env = getenv("HYBRIS_LD_PRELOAD");
}
- if (DEFAULT_HYBRIS_LD_LIBRARY_PATH)
- parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
- else
+ if (ldpath_env)
parse_LD_LIBRARY_PATH(ldpath_env);
+ else
+ parse_LD_LIBRARY_PATH(DEFAULT_HYBRIS_LD_LIBRARY_PATH);
parse_LD_PRELOAD(ldpreload_env);
if (sdk_version > 0)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -72,6 +72,12 @@
[mesa="no"])
AM_CONDITIONAL( [WANT_MESA], [test x"$mesa" = x"yes"])
+AC_ARG_ENABLE(ubuntu-camera-headers,
+ [ --enable-ubuntu-camera-headers Enable Ubuntu camera headers (default=disabled)],
+ [ubuntu-camera-headers=$enableval],
+ [ubuntu-camera-headers="no"])
+AM_CONDITIONAL( [WANT_UBUNTU_CAMERA_HEADERS], [test x"$ubuntu-camera-headers" = x"yes"])
+
AC_ARG_ENABLE(wayland,
[ --enable-wayland Enable wayland support (default=disabled)],
[wayland=$enableval
@@ -222,6 +228,7 @@
AC_MSG_NOTICE("Android headers version is $android_headers_major.$android_headers_minor.$android_headers_patch")
# Add automake tests for version/API needs here that you need in code, including test .am's
+AM_CONDITIONAL([HAS_ANDROID_9_0_0], [test $android_headers_major -ge 9 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_8_0_0], [test $android_headers_major -ge 8 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_7_0_0], [test $android_headers_major -ge 7 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_6_0_0], [test $android_headers_major -ge 6 -a $android_headers_minor -ge 0 ])
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/egl/platforms/common/eglplatformcommon.cpp
^
|
@@ -335,8 +335,8 @@
if (name == EGL_EXTENSIONS)
{
const char *ret = (*real_eglQueryString)(dpy, name);
- static char eglextensionsbuf[1024];
- snprintf(eglextensionsbuf, 1022, "%sEGL_HYBRIS_native_buffer2 EGL_HYBRIS_WL_acquire_native_buffer %s", ret ? ret : "",
+ static char eglextensionsbuf[2048];
+ snprintf(eglextensionsbuf, 2046, "%sEGL_HYBRIS_native_buffer2 EGL_HYBRIS_WL_acquire_native_buffer %s", ret ? ret : "",
#ifdef WANT_WAYLAND
"EGL_WL_bind_wayland_display "
#else
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/egl/platforms/wayland/eglplatform_wayland.cpp
^
|
@@ -36,6 +36,7 @@
#include <unistd.h>
#include <assert.h>
#include <stdlib.h>
+#include <dlfcn.h>
extern "C" {
#include <eglplatformcommon.h>
};
@@ -61,6 +62,13 @@
static EGLBoolean (*_eglDestroySyncKHR)(EGLDisplay dpy, EGLSyncKHR sync) = NULL;
static EGLint (*_eglClientWaitSyncKHR)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) = NULL;
+/* The following function is implemented in libhybris's libEGL.so.
+ * However, eglplatform_wayland.so is not linking to libEGL directly,
+ * causing undefined symbol errors during loading, if libEGL was not
+ * already loaded by some other dependencies. Therefore, we should try
+ * to load libEGL at runtime here and resolve this function dynamically */
+typedef struct _EGLDisplay *(*PFNHYBRISEGLDISPLAYGETMAPPINGPROC)(EGLDisplay dpy);
+
struct WaylandDisplay {
_EGLDisplay base;
@@ -202,6 +210,36 @@
return ((WaylandNativeWindow *) eglwin->nativewindow)->postBuffer((ANativeWindowBuffer *) buffer);
}
+/**
+ * Loads libhybris's libEGL at runtime to call hybris_egl_display_get_mapping()
+ */
+static struct _EGLDisplay *_hybris_egl_display_get_mapping(EGLDisplay dpy)
+{
+ static void *libEGL_handle = NULL;
+ static PFNHYBRISEGLDISPLAYGETMAPPINGPROC hybris_egl_display_get_mapping_fn = NULL;
+
+ if (!libEGL_handle) {
+ dlerror(); // cleanup error buffer
+ libEGL_handle = dlopen("libEGL.so.1", RTLD_NOW | RTLD_GLOBAL);
+ if (!libEGL_handle) {
+ HYBRIS_ERROR("ERROR: Failed to dlopen libEGL! %s", dlerror());
+ abort();
+ }
+ }
+
+ if (!hybris_egl_display_get_mapping_fn) {
+ dlerror(); // cleanup error buffer
+ hybris_egl_display_get_mapping_fn = (PFNHYBRISEGLDISPLAYGETMAPPINGPROC)dlsym(
+ libEGL_handle, "hybris_egl_display_get_mapping");
+ if (!hybris_egl_display_get_mapping_fn) {
+ HYBRIS_ERROR("ERROR: Cannot resolve 'hybris_egl_display_get_mapping' in libEGL! %s", dlerror());
+ abort();
+ }
+ }
+
+ return hybris_egl_display_get_mapping_fn(dpy);
+}
+
extern "C" wl_buffer *waylandws_createWlBuffer(EGLDisplay dpy, EGLImageKHR image)
{
egl_image *img = reinterpret_cast<egl_image *>(image);
@@ -211,7 +249,7 @@
return NULL;
}
if (img->target == EGL_WAYLAND_BUFFER_WL) {
- WaylandDisplay *wdpy = (WaylandDisplay *)hybris_egl_display_get_mapping(dpy);
+ WaylandDisplay *wdpy = (WaylandDisplay *)_hybris_egl_display_get_mapping(dpy);
server_wlegl_buffer *buf = server_wlegl_buffer_from((wl_resource *)img->egl_buffer);
WaylandNativeWindowBuffer wnb(buf->buf);
// The buffer will be managed by the app, so pass NULL as the queue so that
@@ -247,8 +285,8 @@
const char *ret = eglplatformcommon_eglQueryString(dpy, name, real_eglQueryString);
if (ret && name == EGL_EXTENSIONS)
{
- static char eglextensionsbuf[1024];
- snprintf(eglextensionsbuf, 1022, "%s %s", ret,
+ static char eglextensionsbuf[2048];
+ snprintf(eglextensionsbuf, 2046, "%s %s", ret,
"EGL_EXT_swap_buffers_with_damage EGL_WL_create_wayland_buffer_from_image"
);
ret = eglextensionsbuf;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/egl/ws.c
^
|
@@ -20,6 +20,7 @@
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
+#include <sys/auxv.h>
static struct ws_module *ws = NULL;
@@ -40,7 +41,14 @@
if (egl_platform == NULL)
egl_platform = DEFAULT_EGL_PLATFORM;
- snprintf(ws_name, 2048, PKGLIBDIR "eglplatform_%s.so", egl_platform);
+ const char *eglplatform_dir = PKGLIBDIR;
+ const char *user_eglplatform_dir = getauxval(AT_SECURE)
+ ? NULL
+ : getenv("HYBRIS_EGLPLATFORM_DIR");
+ if (user_eglplatform_dir)
+ eglplatform_dir = user_eglplatform_dir;
+
+ snprintf(ws_name, 2048, "%s/eglplatform_%s.so", eglplatform_dir, egl_platform);
void *wsmod = (void *) dlopen(ws_name, RTLD_LAZY);
if (wsmod==NULL)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/include/EGL/egl.h
^
|
@@ -41,6 +41,8 @@
/* EGL Types */
/* EGLint is defined in eglplatform.h */
+typedef intptr_t EGLAttrib;
+typedef khronos_utime_nanoseconds_t EGLTime;
typedef unsigned int EGLBoolean;
typedef unsigned int EGLenum;
typedef void *EGLConfig;
@@ -48,6 +50,8 @@
typedef void *EGLDisplay;
typedef void *EGLSurface;
typedef void *EGLClientBuffer;
+typedef void *EGLSync;
+typedef void *EGLImage;
/* EGL Versioning */
#define EGL_VERSION_1_0 1
@@ -55,6 +59,7 @@
#define EGL_VERSION_1_2 1
#define EGL_VERSION_1_3 1
#define EGL_VERSION_1_4 1
+#define EGL_VERSION_1_5 1
/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
* enums are assigned unique values starting at 0x3000.
@@ -242,6 +247,50 @@
* a bug in Khronos Bugzilla against task "Registry".
*/
+/* EGL 1.5 tokens */
+#define EGL_CONTEXT_MAJOR_VERSION 0x3098
+#define EGL_CONTEXT_MINOR_VERSION 0x30FB
+#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
+#define EGL_NO_RESET_NOTIFICATION 0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF
+#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
+#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
+#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0
+#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
+#define EGL_OPENGL_ES3_BIT 0x00000040
+#define EGL_CL_EVENT_HANDLE 0x309C
+#define EGL_SYNC_CL_EVENT 0x30FE
+#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
+#define EGL_SYNC_TYPE 0x30F7
+#define EGL_SYNC_STATUS 0x30F1
+#define EGL_SYNC_CONDITION 0x30F8
+#define EGL_SIGNALED 0x30F2
+#define EGL_UNSIGNALED 0x30F3
+#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
+#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull
+#define EGL_TIMEOUT_EXPIRED 0x30F5
+#define EGL_CONDITION_SATISFIED 0x30F6
+#define EGL_NO_SYNC EGL_CAST(EGLSync,0)
+#define EGL_SYNC_FENCE 0x30F9
+#define EGL_GL_COLORSPACE 0x309D
+#define EGL_GL_COLORSPACE_SRGB 0x3089
+#define EGL_GL_COLORSPACE_LINEAR 0x308A
+#define EGL_GL_RENDERBUFFER 0x30B9
+#define EGL_GL_TEXTURE_2D 0x30B1
+#define EGL_GL_TEXTURE_LEVEL 0x30BC
+#define EGL_GL_TEXTURE_3D 0x30B2
+#define EGL_GL_TEXTURE_ZOFFSET 0x30BD
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
+#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
+#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
+#define EGL_IMAGE_PRESERVED 0x30D2
+#define EGL_NO_IMAGE EGL_CAST(EGLImage,0)
/* EGL Functions */
@@ -313,6 +362,18 @@
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
EGLNativePixmapType target);
+/* EGL 1.5 */
+EGLAPI EGLSync EGLAPIENTRY eglCreateSync(EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync(EGLDisplay dpy, EGLSync sync);
+EGLAPI EGLint EGLAPIENTRY eglClientWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
+EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib(EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
+EGLAPI EGLImage EGLAPIENTRY eglCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage(EGLDisplay dpy, EGLImage image);
+EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay(EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface(EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface(EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync(EGLDisplay dpy, EGLSync sync, EGLint flags);
+
/* This is a generic function pointer type, whose name indicates it must
* be cast to the proper type *and calling convention* before use.
*/
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/include/hybris/camera/camera_compatibility_layer_configuration_translator.h
^
|
@@ -28,6 +28,8 @@
extern "C" {
#endif
+#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage"
+
static const char* effect_modes[] =
{
android::CameraParameters::EFFECT_NONE,
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/include/hybris/internal/camera_control.h
^
|
@@ -19,6 +19,9 @@
#include <camera/Camera.h>
#include <camera/CameraParameters.h>
+#if ANDROID_VERSION_MAJOR>=7
+#include <camera/android/hardware/ICamera.h>
+#endif
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=2
#include <gui/SurfaceTexture.h>
#else
@@ -69,6 +72,9 @@
nsecs_t timestamp,
int32_t msg_type,
const android::sp<android::IMemory>& data);
+#if ANDROID_VERSION_MAJOR >= 7
+ void postRecordingFrameHandleTimestamp(nsecs_t timestamp, native_handle_t* handle);
+#endif
};
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/include/hybris/properties/properties.h
^
|
@@ -25,8 +25,6 @@
#include <unistd.h>
#include <stdint.h>
-#include <android-config.h>
-
/* Based on Android */
#define PROP_SERVICE_NAME "property_service"
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/Makefile.am
^
|
@@ -140,13 +140,14 @@
test_camera_CFLAGS = \
-I$(top_srcdir)/include \
$(ANDROID_HEADERS_CFLAGS)
-
test_camera_LDADD = \
$(top_builddir)/common/libhybris-common.la \
$(top_builddir)/egl/libEGL.la \
$(top_builddir)/glesv2/libGLESv2.la \
$(top_builddir)/camera/libcamera.la \
- $(top_builddir)/input/libis.la
+ $(top_builddir)/input/libis.la \
+ $(top_builddir)/egl/platforms/common/libwayland-egl.la \
+ $(WAYLAND_CLIENT_LIBS)
test_media_SOURCES = test_media.c
test_media_CFLAGS = \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_camera.c
^
|
@@ -17,6 +17,11 @@
#include "config.h"
+#include <wayland-client.h>
+#include <wayland-server.h>
+#include <wayland-client-protocol.h>
+#include <wayland-egl.h>
+
#include <hybris/camera/camera_compatibility_layer.h>
#include <hybris/camera/camera_compatibility_layer_capabilities.h>
@@ -286,6 +291,70 @@
return program;
}
+struct wl_display *wldisplay = NULL;
+struct wl_compositor *wlcompositor = NULL;
+struct wl_surface *wlsurface;
+struct wl_egl_window *wlegl_window;
+struct wl_region *wlregion;
+struct wl_shell *wlshell;
+struct wl_shell_surface *wlshell_surface;
+
+static void global_registry_handler(void *data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version)
+{
+ printf("Got a registry event for %s id %d\n", interface, id);
+ if (strcmp(interface, "wl_compositor") == 0) {
+ wlcompositor = wl_registry_bind(registry,
+ id,
+ &wl_compositor_interface,
+ 1);
+ } else if (strcmp(interface, "wl_shell") == 0) {
+ wlshell = wl_registry_bind(registry, id,
+ &wl_shell_interface, 1);
+ }
+}
+
+static void global_registry_remover(void *data, struct wl_registry *registry, uint32_t id)
+{
+ printf("Got a registry losing event for %d\n", id);
+}
+
+static const struct wl_registry_listener registry_listener = {
+ global_registry_handler,
+ global_registry_remover
+};
+
+static void get_server_references(void)
+{
+ wldisplay = wl_display_connect(NULL);
+ if (wldisplay == NULL) {
+ fprintf(stderr, "Can't connect to display\n");
+ exit(1);
+ }
+ printf("connected to display\n");
+
+ struct wl_registry *registry = wl_display_get_registry(wldisplay);
+ wl_registry_add_listener(registry, ®istry_listener, NULL);
+
+ wl_display_dispatch(wldisplay);
+ wl_display_roundtrip(wldisplay);
+
+ if (wlcompositor == NULL || wlshell == NULL) {
+ fprintf(stderr, "Can't find compositor or shell\n");
+ exit(1);
+ } else {
+ fprintf(stderr, "Found compositor and shell\n");
+ }
+}
+
+static void create_opaque_region()
+{
+ wlregion = wl_compositor_create_region(wlcompositor);
+ wl_region_add(wlregion, 0, 0,
+ 1024,
+ 1024);
+ wl_surface_set_opaque_region(wlsurface, wlregion);
+}
+
int main(int argc, char** argv)
{
struct CameraControlListener listener;
@@ -356,6 +425,22 @@
FocusRegion fr = { top: -200, left: -200, bottom: 200, right: 200, weight: 300};
android_camera_set_focus_region(cc, &fr);
+ /* Wayland Setup */
+ get_server_references();
+
+ wlsurface = wl_compositor_create_surface(wlcompositor);
+ if (wlsurface == NULL) {
+ fprintf(stderr, "Can't create surface\n");
+ exit(1);
+ } else {
+ fprintf(stderr, "Created surface\n");
+ }
+
+ wlshell_surface = wl_shell_get_shell_surface(wlshell, wlsurface);
+ wl_shell_surface_set_toplevel(wlshell_surface);
+
+ create_opaque_region();
+
/* EGL Setup */
EGLConfig ecfg;
EGLBoolean rv;
@@ -372,7 +457,7 @@
EGL_NONE
};
- EGLDisplay disp = eglGetDisplay(NULL);
+ EGLDisplay disp = eglGetDisplay((EGLNativeDisplayType)wldisplay);
assert(eglGetError() == EGL_SUCCESS);
assert(disp != EGL_NO_DISPLAY);
@@ -384,8 +469,16 @@
assert(eglGetError() == EGL_SUCCESS);
assert(rv == EGL_TRUE);
+ wlegl_window = wl_egl_window_create(wlsurface, 1024, 1024);
+ if (wlegl_window == EGL_NO_SURFACE) {
+ fprintf(stderr, "Can't create egl window\n");
+ exit(1);
+ } else {
+ fprintf(stderr, "Created egl window\n");
+ }
+
EGLSurface surface = eglCreateWindowSurface((EGLDisplay) disp, ecfg,
- (EGLNativeWindowType) NULL, NULL);
+ (EGLNativeWindowType) wlegl_window, NULL);
assert(eglGetError() == EGL_SUCCESS);
assert(surface != EGL_NO_SURFACE);
@@ -473,5 +566,9 @@
glDisableVertexAttribArray(gaTexHandle);
eglSwapBuffers((EGLDisplay) disp, surface);
+
+ wl_display_dispatch(wldisplay);
}
+
+ wl_display_disconnect(wldisplay);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.34.tar.bz2/libhybris/hybris/tests/test_sensors.c
^
|
@@ -48,17 +48,30 @@
}
}
+void float_to_char(float f,char * buffer, int maxChars){
+ int beforeDot = (int)f;
+ int afterDot = (int)((f-beforeDot)*1e6); /* rounding is not perfect, but that'll do */
+ snprintf(buffer, maxChars, "%d.%d", beforeDot, afterDot);
+}
+
static void print_sensor_info(int i, struct sensor_t const *s)
{
+ char numStr[32];
+
printf("=== Sensor %d ==\n", i);
printf("Name: %s\n", s->name);
printf("Vendor: %s\n", s->vendor);
printf("Version: 0x%x\n", s->version);
printf("Handle: 0x%x\n", s->handle);
printf("Type: %d\n", s->type);
- printf("maxRange: %.f\n", s->maxRange);
- printf("resolution: %.f\n", s->resolution);
- printf("power: %.f mA\n", s->power);
+ // once the hw module is loaded, printf with %f will crash, so use integers
+ float_to_char(s->maxRange, numStr, 30);
+ printf("maxRange: %s\n", numStr);
+ float_to_char(s->resolution, numStr, 30);
+ printf("resolution: %s\n", numStr);
+ float_to_char(s->power, numStr, 30);
+ printf("power: %s mA\n", numStr);
+
printf("minDelay: %d\n", s->minDelay);
//printf("fifoReservedEventCount: %d\n", s->fifoReservedEventCount);
//printf("fifoMaxEventCount: %d\n", s->fifoMaxEventCount);
|