[-]
[+]
|
Changed |
_service:tar_git:libhybris.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris.spec
^
|
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/.gitignore
^
|
@@ -36,37 +36,52 @@
hybris/egl/glvnd/g_egldispatchstubs.h
hybris/egl/glvnd/g_egldispatchstubs.c
hybris/egl/platforms/common/hybris-egl-platform.pc
-hybris/egl/platforms/common/wayland-android-client-protocol.h
-hybris/egl/platforms/common/wayland-android-protocol.c
-hybris/egl/platforms/common/wayland-android-server-protocol.h
hybris/egl/platforms/common/wayland-egl.pc
hybris/egl/platforms/hwcomposer/hwcomposer-egl.pc
hybris/glesv1/glesv1_cm.pc
hybris/glesv2/glesv2.pc
+hybris/gralloc/libgralloc.pc
hybris/hardware/libhardware.pc
+hybris/hwc2/libhwc2.pc
hybris/input/libis.pc
hybris/libnfc_ndef_nxp/libnfc_ndef_nxp.pc
hybris/libnfc_nxp/libnfc_nxp.pc
hybris/libsync/libsync.pc
+hybris/media/libmedia.pc
+hybris/opencl/OpenCL.pc
+hybris/platforms/common/wayland-android-client-protocol.h
+hybris/platforms/common/wayland-android-protocol.c
+hybris/platforms/common/wayland-android-server-protocol.h
hybris/properties/libandroid-properties.pc
hybris/sf/libsf.pc
hybris/vibrator/libvibrator.pc
+hybris/wifi/libwifi.pc
# Util binaries
hybris/utils/getprop
hybris/utils/setprop
# Test binaries
+hybris/tests/test_audio
hybris/tests/test_camera
+hybris/tests/test_dlopen
hybris/tests/test_egl_configs
hybris/tests/test_gps
+hybris/tests/test_hwcomposer
hybris/tests/test_input
+hybris/tests/test_media
hybris/tests/test_nfc
+hybris/tests/test_opencl
+hybris/tests/test_recorder
hybris/tests/test_sf
hybris/tests/test_egl
hybris/tests/test_glesv2
+hybris/tests/test_glesv3
hybris/tests/test_lights
hybris/tests/test_offscreen_rendering
hybris/tests/test_sensors
hybris/tests/test_ui
+hybris/tests/test_vibrator
+hybris/tests/test_vulkan
+hybris/tests/test_wifi
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/camera/Android.mk
^
|
@@ -8,6 +8,10 @@
endif
endif
+ifeq ($(HYBRIS_MEDIA_32_BIT_ONLY),)
+HYBRIS_MEDIA_32_BIT_ONLY := $(shell cat frameworks/av/media/libmediaplayerservice/Android.bp | grep compile_multilib | grep -o "32" | sed "s/32/true/")
+endif
+
ifeq ($(HYBRIS_MEDIA_32_BIT_ONLY),true)
HYBRIS_MEDIA_MULTILIB := 32
endif
@@ -17,6 +21,8 @@
HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
+IS_ANDROID_8 := $(shell test $(ANDROID_VERSION_MAJOR) -ge 8 && echo true)
+
LOCAL_SRC_FILES := camera_compatibility_layer.cpp
LOCAL_MODULE := libcamera_compat_layer
@@ -25,9 +31,16 @@
LOCAL_C_INCLUDES := \
$(HYBRIS_PATH)/include
+ifeq ($(IS_ANDROID_8),true)
+LOCAL_CFLAGS += \
+ -Wno-unused-parameter \
+ -Wno-unused-variable
+endif
+
LOCAL_SHARED_LIBRARIES := \
libcutils \
libcamera_client \
+ liblog \
libutils \
libbinder \
libhardware \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/camera/camera_compatibility_layer.cpp
^
|
@@ -116,15 +116,28 @@
switch (msg_type) {
case CAMERA_MSG_RAW_IMAGE:
if (listener->on_data_raw_image_cb)
+#if ANDROID_VERSION_MAJOR>=11
+ listener->on_data_raw_image_cb(data->unsecurePointer(), data->size(), listener->context);
+#else
listener->on_data_raw_image_cb(data->pointer(), data->size(), listener->context);
+#endif
break;
case CAMERA_MSG_COMPRESSED_IMAGE:
if (listener->on_data_compressed_image_cb)
+#if ANDROID_VERSION_MAJOR>=11
+ listener->on_data_compressed_image_cb(data->unsecurePointer(), data->size(), listener->context);
+#else
listener->on_data_compressed_image_cb(data->pointer(), data->size(), listener->context);
+#endif
break;
case CAMERA_MSG_PREVIEW_FRAME:
if (listener->on_preview_frame_cb)
+#if ANDROID_VERSION_MAJOR>=11
+ listener->on_preview_frame_cb(data->unsecurePointer(), data->size(), listener->context);
+#else
listener->on_preview_frame_cb(data->pointer(), data->size(), listener->context);
+#endif
+ break;
default:
break;
}
@@ -148,6 +161,12 @@
}
#endif
+void CameraControl::postRecordingFrameHandleTimestampBatch(const std::vector<nsecs_t>& /*timestamps*/,
+ const std::vector<native_handle_t*>& /*handles*/)
+{
+ REPORT_FUNCTION();
+}
+
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
namespace android
{
@@ -176,6 +195,19 @@
}
#endif
+static void setParameters_resilient(CameraControl* control)
+{
+ android::status_t err = control->camera->setParameters(control->camera_parameters.flatten());
+
+ if (err != android::NO_ERROR) {
+ // The parameters that we have is now stale. Reset to the current parameter
+ // to prevent the bad value from blocking other values.
+
+ ALOGW("Fails to set camera parameters: %s", strerror(-err));
+ control->camera_parameters = android::CameraParameters(control->camera->getParameters());
+ }
+}
+
int android_camera_get_number_of_devices()
{
REPORT_FUNCTION();
@@ -304,7 +336,7 @@
control->camera_parameters.set(
android::CameraParameters::KEY_FLASH_MODE,
flash_modes[mode]);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_flash_mode(CameraControl* control, FlashMode* mode)
@@ -363,7 +395,7 @@
control->camera_parameters.set(
android::CameraParameters::KEY_WHITE_BALANCE,
white_balance_modes[mode]);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_white_balance_mode(CameraControl* control, WhiteBalanceMode* mode)
@@ -389,7 +421,7 @@
control->camera_parameters.set(
android::CameraParameters::KEY_SCENE_MODE,
scene_modes[mode]);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_enumerate_supported_scene_modes(CameraControl* control, scene_mode_callback cb, void* ctx)
@@ -440,7 +472,7 @@
control->camera_parameters.set(
android::CameraParameters::KEY_FOCUS_MODE,
auto_focus_modes[mode]);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_auto_focus_mode(CameraControl* control, AutoFocusMode* mode)
@@ -467,7 +499,7 @@
control->camera_parameters.set(
android::CameraParameters::KEY_EFFECT,
effect_modes[mode]);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_effect_mode(CameraControl* control, EffectMode* mode)
@@ -500,7 +532,7 @@
android::Mutex::Autolock al(control->guard);
control->camera_parameters.setPreviewFrameRate(fps);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_preview_fps(CameraControl* control, int* fps)
@@ -558,7 +590,7 @@
android::Mutex::Autolock al(control->guard);
control->camera_parameters.setPreviewSize(width, height);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_picture_size(CameraControl* control, int* width, int* height)
@@ -584,7 +616,7 @@
control->camera_parameters.set(
android::CameraParameters::KEY_JPEG_THUMBNAIL_HEIGHT,
height);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_thumbnail_size(struct CameraControl* control, int* width, int* height)
@@ -640,7 +672,7 @@
android::Mutex::Autolock al(control->guard);
control->camera_parameters.setPictureSize(width, height);
- control->camera->setParameters(control->camera_parameters.flatten());
+ setParameters_resilient(control);
}
void android_camera_get_current_zoom(CameraControl* control, int* zoom)
@@ -697,30 +729,41 @@
REPORT_FUNCTION();
assert(control);
+ if (texture_id == 0) {
+#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
+ control->camera->setPreviewTexture(NULL);
+#else
+ control->camera->setPreviewTarget(NULL);
+#endif
+ return;
+ }
+
static const bool allow_synchronous_mode = false;
static const bool is_controlled_by_app = true;
+ if (control->preview_texture == NULL || control->preview_texture_id != texture_id) {
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
- android::sp<android::NativeBufferAlloc> native_alloc(
+ android::sp<android::NativeBufferAlloc> native_alloc(
new android::NativeBufferAlloc()
);
#endif
#if ANDROID_VERSION_MAJOR>=5
- android::sp<android::IGraphicBufferProducer> producer;
- android::sp<android::IGraphicBufferConsumer> consumer;
- android::BufferQueue::createBufferQueue(&producer, &consumer);
+ android::sp<android::IGraphicBufferProducer> producer;
+ android::sp<android::IGraphicBufferConsumer> consumer;
+ android::BufferQueue::createBufferQueue(&producer, &consumer);
+ control->preview_bq = producer;
#else
- android::sp<android::BufferQueue> buffer_queue(
+ android::sp<android::BufferQueue> buffer_queue(
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=3
new android::BufferQueue(false, NULL, native_alloc)
#else
new android::BufferQueue(NULL)
#endif
);
+ control->preview_bq = buffer_queue;
#endif
- if (control->preview_texture == NULL) {
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=2
control->preview_texture = android::sp<android::SurfaceTexture>(
new android::SurfaceTexture(
@@ -747,6 +790,8 @@
true,
is_controlled_by_app));
#endif
+
+ control->preview_texture_id = texture_id;
}
control->preview_texture->setFrameAvailableListener(
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/input/Android.mk
^
|
@@ -18,7 +18,7 @@
libgui \
libandroidfw
-ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -ge 11 && echo true),true)
+ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -ge 10 && echo true),true)
static_libraries := \
libskia
else
@@ -85,7 +85,7 @@
libgtest_main
-ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -ge 11 && echo true),true)
+ifeq ($(shell test $(ANDROID_VERSION_MAJOR) -ge 10 && echo true),true)
static_libraries += \
libskia
else
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/Android.mk
^
|
@@ -8,6 +8,10 @@
endif
endif
+ifeq ($(HYBRIS_MEDIA_32_BIT_ONLY),)
+HYBRIS_MEDIA_32_BIT_ONLY := $(shell cat frameworks/av/media/libmediaplayerservice/Android.bp | grep compile_multilib | grep -o "32" | sed "s/32/true/")
+endif
+
ifeq ($(HYBRIS_MEDIA_32_BIT_ONLY),true)
HYBRIS_MEDIA_MULTILIB := 32
endif
@@ -16,30 +20,41 @@
include $(LOCAL_PATH)/../Android.common.mk
ifeq ($(CAMERA_SERVICE_WANT_UBUNTU_HEADERS),1)
- LOCAL_CPPFLAGS += -DWANT_UBUNTU_CAMERA_HEADERS
+ LOCAL_CPPFLAGS += -DWANT_UBUNTU_CAMERA_HEADERS
endif
LOCAL_SRC_FILES := \
camera_service.cpp
LOCAL_SHARED_LIBRARIES := \
- libcameraservice \
- libcamera_client \
- libmedialogservice \
libcutils \
- libmedia \
libmedia_compat_layer \
- libmediaplayerservice \
+ libaudioclient \
libutils \
liblog \
libbinder
+ifeq ($(IS_ANDROID_8),true)
+LOCAL_SHARED_LIBRARIES += \
+ libaudioclient
+else
+LOCAL_SHARED_LIBRARIES += \
+ libcameraservice \
+ libcamera_client \
+ libmedialogservice \
+ libmedia \
+ libmediaplayerservice
+endif
+
LOCAL_C_INCLUDES := \
- frameworks/av/media/libmediaplayerservice \
- frameworks/av/services/medialog \
- frameworks/av/services/camera/libcameraservice
+ frameworks/av/media/libmediaplayerservice \
+ frameworks/av/services/medialog \
+ frameworks/av/services/camera/libcameraservice
IS_ANDROID_5 := $(shell test $(ANDROID_VERSION_MAJOR) -ge 5 && echo true)
+IS_ANDROID_8 := $(shell test $(ANDROID_VERSION_MAJOR) -ge 8 && echo true)
+IS_ANDROID_10 := $(shell test $(ANDROID_VERSION_MAJOR) -ge 10 && echo true)
+IS_ANDROID_11 := $(shell test $(ANDROID_VERSION_MAJOR) -ge 11 && echo true)
ifeq ($(IS_ANDROID_5),true)
LOCAL_C_INCLUDES += system/media/camera/include
@@ -52,6 +67,15 @@
LOCAL_MODULE := camera_service
+ifeq ($(IS_ANDROID_8),true)
+LOCAL_INIT_RC := camera_service.rc
+endif
+
+ifeq ($(IS_ANDROID_11),true)
+LOCAL_HEADER_LIBRARIES += \
+ libmedia_headers
+endif
+
ifdef TARGET_2ND_ARCH
LOCAL_MULTILIB := both
LOCAL_MODULE_STEM_32 := $(if $(filter false,$(BOARD_UBUNTU_PREFER_32_BIT)),$(LOCAL_MODULE)$(TARGET_2ND_ARCH_MODULE_SUFFIX),$(LOCAL_MODULE))
@@ -67,12 +91,25 @@
# -------------------------------------------------
+ifeq ($(IS_ANDROID_8),true)
+include $(CLEAR_VARS)
+LOCAL_MODULE := micshm.sh
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_SRC_FILES := micshm.sh
+include $(BUILD_PREBUILT)
+endif
+
+# -------------------------------------------------
+
include $(CLEAR_VARS)
include $(LOCAL_PATH)/../Android.common.mk
HYBRIS_PATH := $(LOCAL_PATH)/../../hybris
-LOCAL_CFLAGS += -std=gnu++0x
+ifneq ($(IS_ANDROID_8),true)
+ LOCAL_CFLAGS += -std=gnu++0x
+endif
ifeq ($(BOARD_HAS_MEDIA_RECORDER_PAUSE),true)
LOCAL_CFLAGS += -DBOARD_HAS_MEDIA_RECORDER_PAUSE
@@ -81,6 +118,14 @@
LOCAL_CFLAGS += -DBOARD_HAS_MEDIA_RECORDER_RESUME
endif
+ifeq ($(IS_ANDROID_8),true)
+LOCAL_CFLAGS += \
+ -Wno-unused-parameter \
+ -Wno-multichar \
+ -Wno-unused-variable \
+ -Wno-unused-private-field
+endif
+
LOCAL_SRC_FILES:= \
media_compatibility_layer.cpp \
media_codec_layer.cpp \
@@ -122,6 +167,25 @@
libaudioutils \
libmediaplayerservice
+ifeq ($(IS_ANDROID_8),true)
+LOCAL_SHARED_LIBRARIES += \
+ liblog \
+ libmedia_omx
+ifeq ($(IS_ANDROID_10),false)
+LOCAL_SHARED_LIBRARIES += \
+ libmediaextractor
+endif
+endif
+
+ifeq ($(IS_ANDROID_11),true)
+LOCAL_HEADER_LIBRARIES += \
+ libmediadrm_headers \
+ libmediametrics_headers
+
+LOCAL_SHARED_LIBRARIES += \
+ libmedia_codeclist
+endif
+
LOCAL_C_INCLUDES := \
$(HYBRIS_PATH)/include \
frameworks/base/media/libstagefright/include \
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/camera_service.cpp
^
|
@@ -23,11 +23,14 @@
#include "media_recorder_factory.h"
#include "media_recorder.h"
-#if ANDROID_VERSION_MAJOR==5 && WANT_UBUNTU_CAMERA_HEADERS
+#if (ANDROID_VERSION_MAJOR==5 && WANT_UBUNTU_CAMERA_HEADERS) || ANDROID_VERSION_MAJOR>=9
#include <media/camera_record_service.h>
#endif
+#if ANDROID_VERSION_MAJOR<=5
#include <CameraService.h>
+#endif
+#include <binder/BinderService.h>
#include <signal.h>
@@ -38,7 +41,7 @@
/*!
* \brief main() instantiates the MediaRecorderFactory Binder server and the CameraService
*/
-int main(int argc, char** argv)
+int main()
{
signal(SIGPIPE, SIG_IGN);
@@ -48,10 +51,12 @@
// 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
+#if (ANDROID_VERSION_MAJOR==5 && WANT_UBUNTU_CAMERA_HEADERS) || ANDROID_VERSION_MAJOR>=9
CameraRecordService::instantiate();
#endif
+#if ANDROID_VERSION_MAJOR<=5
CameraService::instantiate();
+#endif
ProcessState::self()->startThreadPool();
IPCThreadState::self()->joinThreadPool();
}
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/camera_service.rc
^
|
@@ -0,0 +1,8 @@
+on boot
+ exec - root -- /system/bin/micshm.sh
+
+service camera_service /system/bin/camera_service
+ class main
+ user media
+ group audio camera graphics media
+ ioprio rt 4
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/decoding_service.cpp
^
|
@@ -34,7 +34,6 @@
typedef void* EGLSyncKHR;
#include <ui/GraphicBuffer.h>
-#include <gui/GraphicBufferAlloc.h>
#include <gui/IGraphicBufferProducer.h>
#include <gui/IGraphicBufferConsumer.h>
#include <gui/Surface.h>
@@ -278,10 +277,6 @@
void DecodingService::createBufferQueue()
{
- // Use a new native buffer allocator vs the default one, which means it'll use the proper one
- // that will allow rendering to work with Mir
- sp<IGraphicBufferAlloc> g_buffer_alloc(new GraphicBufferAlloc());
-
// This BuferQueue is shared between the client and the service
#if ANDROID_VERSION_MAJOR>=5
BufferQueue::createBufferQueue(&producer, &consumer);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/decoding_service_priv.h
^
|
@@ -23,6 +23,7 @@
#include <binder/IInterface.h>
#include <binder/Parcel.h>
+#include <utils/KeyedVector.h>
namespace android {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_buffer_layer.cpp
^
|
@@ -34,25 +34,35 @@
return static_cast<MediaBufferPrivate*>(buffer);
}
-MediaBufferPrivate::MediaBufferPrivate(android::MediaBuffer *buffer) :
+#if ANDROID_VERSION_MAJOR>=8
+MediaBufferPrivate::MediaBufferPrivate(android::MediaBufferBase *buffer, bool managedByWrapper) :
+#else
+MediaBufferPrivate::MediaBufferPrivate(android::MediaBuffer *buffer, bool managedByWrapper) :
+#endif
buffer(buffer),
return_callback(NULL),
- return_callback_data(NULL)
+ return_callback_data(NULL),
+ isBufferManagedByWrapper(managedByWrapper)
{
}
MediaBufferPrivate::MediaBufferPrivate() :
- buffer(NULL)
+ buffer(NULL),
+ isBufferManagedByWrapper(true)
{
}
MediaBufferPrivate::~MediaBufferPrivate()
{
- if (buffer)
+ if (isBufferManagedByWrapper && buffer)
buffer->release();
}
+#if ANDROID_VERSION_MAJOR>=8
+void MediaBufferPrivate::signalBufferReturned(android::MediaBufferBase *buffer)
+#else
void MediaBufferPrivate::signalBufferReturned(android::MediaBuffer *buffer)
+#endif
{
if (buffer != this->buffer) {
ALOGE("Got called for unknown buffer %p", buffer);
@@ -67,7 +77,11 @@
MediaBufferWrapper* media_buffer_create(size_t size)
{
+#if ANDROID_VERSION_MAJOR>=8
+ android::MediaBufferBase *mbuf = android::MediaBufferBase::Create(size);
+#else
android::MediaBuffer *mbuf = new android::MediaBuffer(size);
+#endif
if (!mbuf)
return NULL;
@@ -159,7 +173,11 @@
if (!d || !d->buffer)
return NULL;
+#if ANDROID_VERSION_MAJOR>=8
+ return new MediaMetaDataPrivate(d->buffer);
+#else
return new MediaMetaDataPrivate(d->buffer->meta_data());
+#endif
}
void media_buffer_set_return_callback(MediaBufferWrapper *buffer,
@@ -190,8 +208,13 @@
{
}
+#if ANDROID_VERSION_MAJOR>=8
+MediaABufferPrivate::MediaABufferPrivate(android::sp<android::MediaCodecBuffer> buffer) :
+ buffer(buffer)
+#else
MediaABufferPrivate::MediaABufferPrivate(android::sp<android::ABuffer> buffer) :
buffer(buffer)
+#endif
{
}
@@ -201,7 +224,11 @@
if (!d)
return NULL;
+#if ANDROID_VERSION_MAJOR>=8
+ d->buffer = new android::MediaCodecBuffer(new android::AMessage, new android::ABuffer(capacity));
+#else
d->buffer = new android::ABuffer(capacity);
+#endif
if (!d->buffer.get()) {
delete d;
return NULL;
@@ -216,7 +243,11 @@
if (!d)
return NULL;
+#if ANDROID_VERSION_MAJOR>=8
+ d->buffer = new android::MediaCodecBuffer(new android::AMessage, new android::ABuffer(data, size));
+#else
d->buffer = new android::ABuffer(data, size);
+#endif
if (!d->buffer.get()) {
delete d;
return NULL;
@@ -241,12 +272,20 @@
return;
#if ANDROID_VERSION_MAJOR>=5
+#if ANDROID_VERSION_MAJOR>=8
+ android::MediaBufferBase *media_buffer = NULL;
+#else
android::MediaBuffer *media_buffer = NULL;
+#endif
if (mbuf != NULL)
media_buffer = MediaBufferPrivate::toPrivate(mbuf)->buffer;
+#if ANDROID_VERSION_MAJOR>=8
+ d->buffer->meta()->setObject("mediaBufferHolder", new android::MediaBufferHolder(media_buffer));
+#else
d->buffer->setMediaBufferBase(media_buffer);
+#endif
#else
return;
#endif
@@ -260,12 +299,26 @@
#if ANDROID_VERSION_MAJOR>= 5
+#if ANDROID_VERSION_MAJOR>=8
+ android::MediaBufferBase *mbufb = NULL;
+
+ android::sp<android::RefBase> holder;
+ if (d->buffer->meta()->findObject("mediaBufferHolder", &holder)) {
+ mbufb = (holder != nullptr) ?
+ static_cast<android::MediaBufferHolder*>(holder.get())->mediaBuffer() : nullptr;
+ }
+#else
android::MediaBufferBase *mbufb = d->buffer->getMediaBufferBase();
+#endif
if (mbufb == NULL)
return NULL;
MediaBufferPrivate *mbuf = new MediaBufferPrivate;
+#if ANDROID_VERSION_MAJOR>=8
+ mbuf->buffer = mbufb;
+#else
mbuf->buffer = (android::MediaBuffer*) mbufb;
+#endif
return mbuf;
#else
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_buffer_priv.h
^
|
@@ -21,6 +21,9 @@
#include <hybris/media/media_buffer_layer.h>
+#if ANDROID_VERSION_MAJOR>=8
+#include <media/MediaCodecBuffer.h>
+#endif
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/MediaBuffer.h>
@@ -30,15 +33,26 @@
public:
static MediaBufferPrivate* toPrivate(MediaBufferWrapper *source);
- MediaBufferPrivate(android::MediaBuffer *data);
+#if ANDROID_VERSION_MAJOR>=8
+ MediaBufferPrivate(android::MediaBufferBase *data, bool managedByWrapper = true);
+#else
+ MediaBufferPrivate(android::MediaBuffer *data, bool managedByWrapper = true);
+#endif
MediaBufferPrivate();
~MediaBufferPrivate();
+#if ANDROID_VERSION_MAJOR>=8
+ void signalBufferReturned(android::MediaBufferBase *buffer);
+
+ android::MediaBufferBase *buffer;
+#else
void signalBufferReturned(android::MediaBuffer *buffer);
android::MediaBuffer *buffer;
+#endif
MediaBufferReturnCallback return_callback;
void *return_callback_data;
+ bool isBufferManagedByWrapper;
};
struct MediaABufferPrivate
@@ -47,10 +61,18 @@
static MediaABufferPrivate* toPrivate(MediaABufferWrapper *source);
MediaABufferPrivate();
+#if ANDROID_VERSION_MAJOR>=8
+ MediaABufferPrivate(android::sp<android::MediaCodecBuffer> buffer);
+#else
MediaABufferPrivate(android::sp<android::ABuffer> buffer);
+#endif
public:
+#if ANDROID_VERSION_MAJOR>=8
+ android::sp<android::MediaCodecBuffer> buffer;
+#else
android::sp<android::ABuffer> buffer;
+#endif
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_codec_layer.cpp
^
|
@@ -36,7 +36,14 @@
#include <media/stagefright/foundation/AHandler.h>
#include <media/stagefright/foundation/AString.h>
+#if ANDROID_VERSION_MAJOR>=11
+#include <mediadrm/ICrypto.h>
+#else
#include <media/ICrypto.h>
+#endif
+#if ANDROID_VERSION_MAJOR>=8
+#include <media/MediaCodecBuffer.h>
+#endif
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/AMessage.h>
@@ -79,8 +86,13 @@
sp<MediaCodec> media_codec;
sp<ALooper> looper;
+#if ANDROID_VERSION_MAJOR>=8
+ Vector<sp<MediaCodecBuffer> > input_buffers;
+ Vector<sp<MediaCodecBuffer> > output_buffers;
+#else
Vector<sp<ABuffer> > input_buffers;
Vector<sp<ABuffer> > output_buffers;
+#endif
List<MediaCodecBufferInfo> available_output_buffer_infos;
Mutex mtx_output_buffer_infos;
List<size_t> available_input_buffer_indices;
@@ -429,7 +441,11 @@
status_t err = OK;
+#if ANDROID_VERSION_MAJOR>=8
+ Vector<sp<MediaCodecBuffer> > input_bufs[1];
+#else
Vector<sp<ABuffer> > input_bufs[1];
+#endif
err = d->media_codec->getInputBuffers(&input_bufs[0]);
CHECK_EQ(err, static_cast<status_t>(OK));
@@ -441,7 +457,11 @@
err = d->media_codec->dequeueInputBuffer(&index, -1ll);
CHECK_EQ(err, static_cast<status_t>(OK));
+#if ANDROID_VERSION_MAJOR>=8
+ const sp<MediaCodecBuffer> &dstBuffer = input_bufs[0].itemAt(index);
+#else
const sp<ABuffer> &dstBuffer = input_bufs[0].itemAt(index);
+#endif
CHECK_LE(srcBuffer->size(), dstBuffer->capacity());
dstBuffer->setRange(0, srcBuffer->size());
@@ -527,7 +547,7 @@
ALOGE("Failed to get input buffers size");
return 0;
}
- ALOGD("Got %d input buffers", d->input_buffers.size());
+ ALOGD("Got %zu input buffers", d->input_buffers.size());
return d->input_buffers.size();
}
@@ -552,7 +572,7 @@
if (n > d->input_buffers.size())
{
- ALOGE("Failed to get %uth input buffer, n > total buffer size", n);
+ ALOGE("Failed to get %zu input buffer, n > total buffer size", n);
return NULL;
}
@@ -579,7 +599,7 @@
if (n > d->input_buffers.size())
{
- ALOGE("Failed to get %uth input buffer, n > total buffer size", n);
+ ALOGE("Failed to get %zu input buffer, n > total buffer size", n);
return NULL;
}
@@ -594,7 +614,11 @@
if (d == NULL)
return BAD_VALUE;
+#if ANDROID_VERSION_MAJOR>=8
+ Vector<sp<MediaCodecBuffer> > input_buffers;
+#else
Vector<sp<ABuffer> > input_buffers;
+#endif
status_t ret = d->media_codec->getInputBuffers(&input_buffers);
if (ret != OK)
{
@@ -604,7 +628,7 @@
if (n > input_buffers.size())
{
- ALOGE("Failed to get %uth input buffer capacity, n > total buffer size", n);
+ ALOGE("Failed to get %zu input buffer capacity, n > total buffer size", n);
return 0;
}
@@ -625,7 +649,7 @@
ALOGE("Failed to get output buffers size");
return 0;
}
- ALOGD("Got %d output buffers", d->output_buffers.size());
+ ALOGD("Got %zu output buffers", d->output_buffers.size());
return d->output_buffers.size();
}
@@ -647,7 +671,7 @@
if (n > d->output_buffers.size())
{
- ALOGE("Failed to get %uth output buffer, n > total buffer size", n);
+ ALOGE("Failed to get %zu output buffer, n > total buffer size", n);
return NULL;
}
@@ -674,7 +698,7 @@
if (n > d->output_buffers.size())
{
- ALOGE("Failed to get %uth output buffer, n > total buffer size", n);
+ ALOGE("Failed to get %zu output buffer, n > total buffer size", n);
return NULL;
}
@@ -698,7 +722,7 @@
if (n > d->output_buffers.size())
{
- ALOGE("Failed to get %uth output buffer capacity, n > total buffer size", n);
+ ALOGE("Failed to get %zu output buffer capacity, n > total buffer size", n);
return 0;
}
@@ -746,10 +770,10 @@
}
ALOGD("Dequeued output buffer:\n-----------------------");
- ALOGD("index: %u", info->index);
- ALOGD("offset: %d", info->offset);
- ALOGD("size: %d", info->size);
- ALOGD("presentation_time_us: %lld", info->presentation_time_us);
+ ALOGD("index: %zu", info->index);
+ ALOGD("offset: %zu", info->offset);
+ ALOGD("size: %zu", info->size);
+ ALOGD("presentation_time_us: %lld", (long long)info->presentation_time_us);
ALOGD("flags: %d", info->flags);
d->mtx_output_buffer_infos.lock();
@@ -779,17 +803,17 @@
// Make sure that there is at least one dequeued input buffer available
if (d->available_input_buffer_indices.empty())
{
- ALOGE("Input buffer index %d has not been dequeued, cannot queue input buffer", info->index);
+ ALOGE("Input buffer index %zu has not been dequeued, cannot queue input buffer", info->index);
return BAD_VALUE;
}
const size_t index = *d->available_input_buffer_indices.begin();
d->available_input_buffer_indices.erase(d->available_input_buffer_indices.begin());
- ALOGD("info->index: %d", index);
- ALOGD("info->offset: %d", info->offset);
- ALOGD("info->size: %d", info->size);
- ALOGD("info->presentation_time_us: %lld", info->presentation_time_us);
+ ALOGD("info->index: %zu", index);
+ ALOGD("info->offset: %zu", info->offset);
+ ALOGD("info->size: %zu", info->size);
+ ALOGD("info->presentation_time_us: %lld", (long long)info->presentation_time_us);
ALOGD("info->flags: %d", info->flags);
AString err_msg;
@@ -797,7 +821,7 @@
info->presentation_time_us, info->flags, &err_msg);
if (ret != OK)
{
- ALOGE("Failed to queue input buffer (err: %d, index: %d)", ret, index);
+ ALOGE("Failed to queue input buffer (err: %d, index: %zu)", ret, index);
ALOGE("Detailed error message: %s", err_msg.c_str());
}
@@ -821,16 +845,16 @@
status_t ret = d->media_codec->dequeueInputBuffer(index, timeout_us);
if (ret == -EAGAIN)
{
- ALOGD("dequeueInputBuffer returned %d, tried timeout: %lld", ret, timeout_us);
+ ALOGD("dequeueInputBuffer returned %d, tried timeout: %lld", ret, (long long)timeout_us);
return INFO_TRY_AGAIN_LATER;
}
else if (ret == OK)
{
- ALOGD("Dequeued input buffer (index: %d)", *index);
+ ALOGD("Dequeued input buffer (index: %zu)", *index);
d->available_input_buffer_indices.push_back(*index);
}
else
- ALOGE("Failed to dequeue input buffer (err: %d, index: %d)", ret, *index);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_codec_list.cpp
^
|
@@ -82,7 +82,9 @@
REPORT_FUNCTION()
Vector<AString> types;
-#if ANDROID_VERSION_MAJOR>=5
+#if ANDROID_VERSION_MAJOR>=10
+ MediaCodecList::getInstance()->getCodecInfo(index)->getSupportedMediaTypes(&types);
+#elif ANDROID_VERSION_MAJOR>=5
MediaCodecList::getInstance()->getCodecInfo(index)->getSupportedMimes(&types);
#else
status_t err = MediaCodecList::getInstance()->getSupportedTypes(index, &types);
@@ -92,7 +94,7 @@
return 0;
}
#endif
- ALOGD("Number of supported codec types: %d", types.size());
+ ALOGD("Number of supported codec types: %zu", types.size());
return types.size();
}
@@ -102,7 +104,9 @@
REPORT_FUNCTION()
Vector<AString> types;
-#if ANDROID_VERSION_MAJOR>=5
+#if ANDROID_VERSION_MAJOR>=10
+ MediaCodecList::getInstance()->getCodecInfo(index)->getSupportedMediaTypes(&types);
+#elif ANDROID_VERSION_MAJOR>=5
MediaCodecList::getInstance()->getCodecInfo(index)->getSupportedMimes(&types);
#else
status_t err = MediaCodecList::getInstance()->getSupportedTypes(index, &types);
@@ -122,7 +126,9 @@
}
Vector<AString> types;
-#if ANDROID_VERSION_MAJOR>=5
+#if ANDROID_VERSION_MAJOR>=10
+ MediaCodecList::getInstance()->getCodecInfo(index)->getSupportedMediaTypes(&types);
+#elif ANDROID_VERSION_MAJOR>=5
MediaCodecList::getInstance()->getCodecInfo(index)->getSupportedMimes(&types);
#else
status_t err = MediaCodecList::getInstance()->getSupportedTypes(index, &types);
@@ -147,7 +153,7 @@
Vector<MediaCodecList::ProfileLevel> profile_levels;
#endif
Vector<uint32_t> color_formats;
- ALOGD("index: %d, type: '%s'", index, type);
+ ALOGD("index: %zu, type: '%s'", index, type);
#if ANDROID_VERSION_MAJOR>=5
MediaCodecList::getInstance()->getCodecInfo(index)->getCapabilitiesFor(type)->getSupportedProfileLevels(&profile_levels);
MediaCodecList::getInstance()->getCodecInfo(index)->getCapabilitiesFor(type)->getSupportedColorFormats(&color_formats);
@@ -167,12 +173,12 @@
if (num_profile_levels != NULL)
{
- ALOGD("Number of codec profile levels: %d", profile_levels.size());
+ ALOGD("Number of codec profile levels: %zu", profile_levels.size());
*num_profile_levels = profile_levels.size();
}
if (num_color_formats != NULL)
{
- ALOGD("Number of codec color formats: %d", color_formats.size());
+ ALOGD("Number of codec color formats: %zu", color_formats.size());
*num_color_formats = color_formats.size();
}
}
@@ -274,7 +280,7 @@
for (size_t i=0; i<formats.size(); ++i)
{
color_formats[i] = formats[i];
- ALOGD("Color format [%d]: %d", i, formats[i]);
+ ALOGD("Color format [%zu]: %d", i, formats[i]);
}
return OK;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_codec_source_layer.cpp
^
|
@@ -22,7 +22,11 @@
#include <gui/Surface.h>
+#if ANDROID_VERSION_MAJOR>=11
+#include <mediadrm/ICrypto.h>
+#else
#include <media/ICrypto.h>
+#endif
#include <media/stagefright/foundation/AHandler.h>
#include <media/stagefright/foundation/AString.h>
@@ -51,7 +55,11 @@
android::status_t start(android::MetaData *params = NULL);
android::status_t stop();
android::sp<android::MetaData> getFormat();
+#if ANDROID_VERSION_MAJOR>=8
+ android::status_t read(android::MediaBufferBase **buffer, const android::MediaSource::ReadOptions *options = NULL);
+#else
android::status_t read(android::MediaBuffer **buffer, const android::MediaSource::ReadOptions *options = NULL);
+#endif
android::status_t pause();
android::sp<android::MetaData> format;
@@ -95,7 +103,11 @@
return format;
}
+#if ANDROID_VERSION_MAJOR>=8
+android::status_t MediaSourcePrivate::read(android::MediaBufferBase **buffer, const android::MediaSource::ReadOptions *options)
+#else
android::status_t MediaSourcePrivate::read(android::MediaBuffer **buffer, const android::MediaSource::ReadOptions *options)
+#endif
{
(void) options;
@@ -339,12 +351,18 @@
if (!d)
return false;
+#if ANDROID_VERSION_MAJOR>=8
+ android::MediaBufferBase *buff = NULL;
+#else
android::MediaBuffer *buff = NULL;
+#endif
android::status_t err = d->codec->read(&buff);
if (err != android::OK)
return false;
- *buffer = new MediaBufferPrivate(buff);
+ // This MediaCodecSource layer is the oddball here. It's using a MediaBuffer that's
+ // created by MediaCodecSource into our private object, hence it's already managed.
+ *buffer = new MediaBufferPrivate(buff, false);
return true;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_compatibility_layer.cpp
^
|
@@ -36,6 +36,9 @@
#else
#include <gui/GLConsumer.h>
#endif
+#if ANDROID_VERSION_MAJOR>=8
+#include <gui/BufferQueue.h>
+#endif
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
@@ -477,7 +480,7 @@
struct stat st;
stat(url, &st);
- ALOGD("source file length: %lld\n", st.st_size);
+ ALOGD("source file length: %lld\n", (long long)st.st_size);
mp->setDataSource(fd, 0, st.st_size);
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_meta_data_layer.cpp
^
|
@@ -33,10 +33,21 @@
}
MediaMetaDataPrivate::MediaMetaDataPrivate() :
+#if ANDROID_VERSION_MAJOR>=8
+ data(nullptr)
+#else
data(new android::MetaData)
+#endif
{
}
+#if ANDROID_VERSION_MAJOR>=8
+MediaMetaDataPrivate::MediaMetaDataPrivate(android::MediaBufferBase *buffer) :
+ data(buffer)
+{
+}
+#endif
+
MediaMetaDataPrivate::MediaMetaDataPrivate(const android::sp<android::MetaData> &md) :
data(md)
{
@@ -70,8 +81,6 @@
return android::kKeySliceHeight;
case MEDIA_META_DATA_KEY_FRAMERATE:
return android::kKeyFrameRate;
- case MEDIA_META_DATA_KEY_MEDIA_BUFFER:
- return 'mediaBuffer';
default:
break;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_meta_data_priv.h
^
|
@@ -20,17 +20,67 @@
#define MEDIA_META_DATA_PRIV_H_
#include <media/stagefright/MetaData.h>
+#if ANDROID_VERSION_MAJOR>=8
+#include <media/MediaBufferHolder.h>
+#endif
struct MediaMetaDataPrivate
{
public:
static MediaMetaDataPrivate* toPrivate(MediaMetaDataWrapper *md);
+#if ANDROID_VERSION_MAJOR>=8
+ struct MetaDataPtr {
+ MetaDataPtr(android::MediaBufferBase *buf = nullptr) :
+ buffer(buf)
+ {
+ if (buffer) {
+ buffer->add_ref();
+ data = &buffer->meta_data();
+ } else {
+ data = new android::MetaDataBase;
+ }
+ }
+
+ MetaDataPtr(const android::sp<android::MetaData> &md) :
+ buffer(nullptr),
+ data(new android::MetaDataBase(*md))
+ {
+ }
+
+ ~MetaDataPtr() {
+ if (buffer) {
+ buffer->release();
+ buffer = nullptr;
+ data = nullptr;
+ } else {
+ delete data;
+ }
+ }
+
+ inline android::MetaDataBase &operator*() const { return *data; }
+ inline android::MetaDataBase *operator->() const { return data; }
+ inline android::MetaDataBase *get() const { return data; }
+ inline operator android::MetaData *() { return new android::MetaData(*data); }
+
+ private:
+ android::MediaBufferBase *buffer;
+ android::MetaDataBase *data;
+ };
+#endif
+
MediaMetaDataPrivate();
+#if ANDROID_VERSION_MAJOR>=8
+ MediaMetaDataPrivate(android::MediaBufferBase *buffer);
+#endif
MediaMetaDataPrivate(const android::sp<android::MetaData> &md);
~MediaMetaDataPrivate();
+#if ANDROID_VERSION_MAJOR>=8
+ MetaDataPtr data;
+#else
android::sp<android::MetaData> data;
+#endif
};
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_recorder.cpp
^
|
@@ -299,9 +299,17 @@
}
#endif
+#if ANDROID_VERSION_MAJOR>=8
+a::status_t a::MediaRecorder::setOutputFile(int fd)
+#else
a::status_t a::MediaRecorder::setOutputFile(int fd, int64_t offset, int64_t length)
+#endif
{
+#if ANDROID_VERSION_MAJOR>=8
+ ALOGV("setOutputFile(%d)", fd);
+#else
ALOGV("setOutputFile(%d, %lld, %lld)", fd, offset, length);
+#endif
if (mMediaRecorder == NULL) {
ALOGE("media recorder is not initialized yet");
return INVALID_OPERATION;
@@ -326,7 +334,11 @@
return BAD_VALUE;
}
+#if ANDROID_VERSION_MAJOR>=8
+ status_t ret = mMediaRecorder->setOutputFile(fd);
+#else
status_t ret = mMediaRecorder->setOutputFile(fd, offset, length);
+#endif
if (OK != ret) {
ALOGV("setOutputFile failed: %d", ret);
mCurrentState = MEDIA_RECORDER_ERROR;
@@ -562,6 +574,7 @@
if (OK != ret) {
return ret; // No need to continue
}
+ FALLTHROUGH_INTENDED;
} // Intentional fall through
case MEDIA_RECORDER_INITIALIZED:
ret = close();
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_recorder.h
^
|
@@ -234,7 +234,11 @@
#if ANDROID_VERSION_MAJOR<=5
status_t setOutputFile(const char* path);
#endif
+#if ANDROID_VERSION_MAJOR>=8
+ status_t setOutputFile(int fd);
+#else
status_t setOutputFile(int fd, int64_t offset, int64_t length);
+#endif
status_t setVideoSize(int width, int height);
status_t setVideoFrameRate(int frames_per_second);
status_t setParameters(const String8& params);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_recorder_client.cpp
^
|
@@ -16,13 +16,14 @@
* Authored by: Jim Hodapp <jim.hodapp@canonical.com>
*/
+// #define LOG_NDEBUG 0
+#define LOG_TAG "MediaRecorderClient"
+
#include "media_recorder_client.h"
#include <libmediaplayerservice/StagefrightRecorder.h>
#include <binder/IServiceManager.h>
-#define LOG_NDEBUG 0
-#define LOG_TAG "MediaRecorderClient"
#define REPORT_FUNCTION() ALOGV("%s \n", __PRETTY_FUNCTION__)
@@ -147,7 +148,11 @@
return recorder->setOutputFile(path);
}
#else
+#if ANDROID_VERSION_MAJOR>=8
+status_t MediaRecorderClient::setInputSurface(const sp<PersistentSurface>& surface)
+#else
status_t MediaRecorderClient::setInputSurface(const sp<IGraphicBufferConsumer>& surface)
+#endif
{
REPORT_FUNCTION();
Mutex::Autolock lock(recorder_lock);
@@ -159,7 +164,11 @@
}
#endif
+#if ANDROID_VERSION_MAJOR>=8
+status_t MediaRecorderClient::setOutputFile(int fd)
+#else
status_t MediaRecorderClient::setOutputFile(int fd, int64_t offset, int64_t length)
+#endif
{
REPORT_FUNCTION();
Mutex::Autolock lock(recorder_lock);
@@ -167,7 +176,11 @@
ALOGE("recorder must not be NULL");
return NO_INIT;
}
+#if ANDROID_VERSION_MAJOR>=8
+ return recorder->setOutputFile(fd);
+#else
return recorder->setOutputFile(fd, offset, length);
+#endif
}
status_t MediaRecorderClient::setVideoSize(int width, int height)
@@ -348,7 +361,11 @@
return NO_ERROR;
}
+#if ANDROID_VERSION_MAJOR>=8
+status_t MediaRecorderClient::dump(int fd, const Vector<String16>& args)
+#else
status_t MediaRecorderClient::dump(int fd, const Vector<String16>& args) const
+#endif
{
REPORT_FUNCTION();
if (recorder != NULL) {
@@ -367,3 +384,131 @@
}
return recorder->querySurfaceMediaSource();
}
+
+#if ANDROID_VERSION_MAJOR>=8
+status_t MediaRecorderClient::setNextOutputFile(int fd)
+{
+ REPORT_FUNCTION();
+ ALOGV("setNextOutputFile(%d)", fd);
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder == NULL) {
+ ALOGE("recorder is not initialized");
+ return NO_INIT;
+ }
+ return recorder->setNextOutputFile(fd);
+}
+
+status_t MediaRecorderClient::getMetrics(Parcel* reply)
+{
+ REPORT_FUNCTION();
+ ALOGV("MediaRecorderClient::getMetrics");
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder == NULL) {
+ ALOGE("recorder is not initialized");
+ return NO_INIT;
+ }
+ return recorder->getMetrics(reply);
+}
+
+status_t MediaRecorderClient::setInputDevice(audio_port_handle_t deviceId)
+{
+ REPORT_FUNCTION();
+ ALOGV("setInputDevice(%d)", deviceId);
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->setInputDevice(deviceId);
+ }
+ return NO_INIT;
+}
+
+status_t MediaRecorderClient::getRoutedDeviceId(audio_port_handle_t* deviceId)
+{
+ REPORT_FUNCTION();
+ ALOGV("getRoutedDeviceId");
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->getRoutedDeviceId(deviceId);
+ }
+ return NO_INIT;
+}
+
+status_t MediaRecorderClient::enableAudioDeviceCallback(bool enabled)
+{
+ REPORT_FUNCTION();
+ ALOGV("enableDeviceCallback: %d", enabled);
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->enableAudioDeviceCallback(enabled);
+ }
+ return NO_INIT;
+}
+
+status_t MediaRecorderClient::getActiveMicrophones(
+ std::vector<media::MicrophoneInfo>* activeMicrophones)
+{
+ REPORT_FUNCTION();
+ ALOGV("getActiveMicrophones");
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->getActiveMicrophones(activeMicrophones);
+ }
+ return NO_INIT;
+}
+#endif
+
+#if ANDROID_VERSION_MAJOR>=10
+status_t MediaRecorderClient::setPreferredMicrophoneDirection(audio_microphone_direction_t direction)
+{
+ REPORT_FUNCTION();
+ ALOGV("setPreferredMicrophoneDirection(%d)", direction);
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->setPreferredMicrophoneDirection(direction);
+ }
+ return NO_INIT;
+}
+
+status_t MediaRecorderClient::setPreferredMicrophoneFieldDimension(float zoom)
+{
+ REPORT_FUNCTION();
+ ALOGV("setPreferredMicrophoneFieldDimension(%f)", zoom);
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->setPreferredMicrophoneFieldDimension(zoom);
+ }
+ return NO_INIT;
+}
+
+status_t MediaRecorderClient::getPortId(audio_port_handle_t *portId)
+{
+ REPORT_FUNCTION();
+ ALOGV("getPortId");
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->getPortId(portId);
+ }
+ return NO_INIT;
+}
+#endif
+
+#if ANDROID_VERSION_MAJOR>=11
+status_t MediaRecorderClient::setPrivacySensitive(bool privacySensitive)
+{
+ REPORT_FUNCTION();
+ ALOGV("setPrivacySensitive(%d)", privacySensitive);
+ Mutex::Autolock lock(recorder_lock);
+ if (recorder != NULL) {
+ return recorder->setPrivacySensitive(privacySensitive);
+ }
+ return NO_INIT;
+}
+status_t MediaRecorderClient::isPrivacySensitive(bool *privacySensitive) const
+{
+ REPORT_FUNCTION();
+ ALOGV("isPrivacySensitive");
+ if (recorder != NULL) {
+ return recorder->isPrivacySensitive(privacySensitive);
+ }
+ return NO_INIT;
+}
+#endif
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_recorder_client.h
^
|
@@ -28,7 +28,11 @@
namespace android {
+#if ANDROID_VERSION_MAJOR>=8
+struct MediaRecorderBase;
+#else
class MediaRecorderBase;
+#endif
class Mutex;
class BpMediaRecorderObserver;
@@ -64,9 +68,17 @@
#if ANDROID_VERSION_MAJOR<=5
virtual status_t setOutputFile(const char* path);
#else
+#if ANDROID_VERSION_MAJOR>=8
+ virtual status_t setInputSurface(const sp<PersistentSurface>& surface);
+#else
virtual status_t setInputSurface(const sp<IGraphicBufferConsumer>& surface);
#endif
+#endif
+#if ANDROID_VERSION_MAJOR>=8
+ virtual status_t setOutputFile(int fd);
+#else
virtual status_t setOutputFile(int fd, int64_t offset, int64_t length);
+#endif
virtual status_t setVideoSize(int width, int height);
virtual status_t setVideoFrameRate(int frames_per_second);
virtual status_t setParameters(const String8& params);
@@ -86,8 +98,30 @@
virtual status_t init();
virtual status_t close();
virtual status_t release();
+#if ANDROID_VERSION_MAJOR>=8
+ virtual status_t dump(int fd, const Vector<String16>& args);
+#else
virtual status_t dump(int fd, const Vector<String16>& args) const;
+#endif
virtual sp<IGraphicBufferProducer> querySurfaceMediaSource();
+#if ANDROID_VERSION_MAJOR>=8
+ virtual status_t setNextOutputFile(int fd);
+ virtual status_t getMetrics(Parcel* reply);
+ virtual status_t setInputDevice(audio_port_handle_t deviceId);
+ virtual status_t getRoutedDeviceId(audio_port_handle_t* deviceId);
+ virtual status_t enableAudioDeviceCallback(bool enabled);
+ virtual status_t getActiveMicrophones(
+ std::vector<media::MicrophoneInfo>* activeMicrophones);
+#endif
+#if ANDROID_VERSION_MAJOR>=10
+ virtual status_t setPreferredMicrophoneDirection(audio_microphone_direction_t direction);
+ virtual status_t setPreferredMicrophoneFieldDimension(float zoom);
+ virtual status_t getPortId(audio_port_handle_t *portId);
+#endif
+#if ANDROID_VERSION_MAJOR>=11
+ virtual status_t setPrivacySensitive(bool privacySensitive);
+ virtual status_t isPrivacySensitive(bool *privacySensitive) const;
+#endif
private:
sp<BpMediaRecorderObserver> media_recorder_observer;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/media_recorder_layer.cpp
^
|
@@ -342,7 +342,11 @@
return android::BAD_VALUE;
}
+#if ANDROID_VERSION_MAJOR>=8
+ return mr->setOutputFile(fd);
+#else
return mr->setOutputFile(fd, 0, 0);
+#endif
}
/*!
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/micshm.sh
^
|
@@ -0,0 +1,4 @@
+#!/system/bin/sh
+mkfifo -m 0660 /dev/socket/micshm
+chown media:media /dev/socket/micshm
+chmod 0660 /dev/socket/micshm
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/media/surface_texture_client_hybris_priv.h
^
|
@@ -27,6 +27,9 @@
#else
#include <gui/GLConsumer.h>
#endif
+#if ANDROID_VERSION_MAJOR>=8
+#include <gui/BufferQueue.h>
+#endif
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=2
struct _SurfaceTextureClientHybris : public android::SurfaceTextureClient
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/compat/surface_flinger/surface_flinger_compatibility_layer.cpp
^
|
@@ -29,7 +29,7 @@
#include <ui/Region.h>
#include <ui/Rect.h>
#if ANDROID_VERSION_MAJOR>=5
- #include <hardware/hwcomposer_defs.h>
+#include <hardware/hwcomposer_defs.h>
#endif
#include <cassert>
@@ -170,19 +170,19 @@
android::DisplayInfo info;
android::SurfaceComposerClient::getDisplayInfo(display, &info);
- if (display_info == NULL) {
- fprintf(stderr, "Warning: sf_get_display_info: display_info is null! Please allocate it before \n");
- return -2;
- }
-
- // partial copy
- display_info->w = info.w;
- display_info->h = info.h;
- display_info->xdpi = info.xdpi;
- display_info->ydpi = info.ydpi;
- display_info->fps = info.fps;
- display_info->density = info.density;
- display_info->orientation = info.orientation;
+ if (display_info == NULL) {
+ fprintf(stderr, "Warning: sf_get_display_info: display_info is null! Please allocate it before \n");
+ return -2;
+ }
+
+ // partial copy
+ display_info->w = info.w;
+ display_info->h = info.h;
+ display_info->xdpi = info.xdpi;
+ display_info->ydpi = info.ydpi;
+ display_info->fps = info.fps;
+ display_info->density = info.density;
+ display_info->orientation = info.orientation;
return 0;
}
@@ -290,6 +290,7 @@
}
}
+#if ANDROID_VERSION_MAJOR<8
void sf_client_begin_transaction(SfClient* client)
{
assert(client);
@@ -301,6 +302,7 @@
assert(client);
client->client->closeGlobalTransaction();
}
+#endif
SfSurface* sf_surface_create(SfClient* client, SfSurfaceCreationParameters* params)
{
@@ -330,6 +332,15 @@
return NULL;
}
+#if ANDROID_VERSION_MAJOR>=8
+ uint32_t mDisplayLayerStack = 0;
+ android::SurfaceComposerClient::Transaction()
+ .setLayerStack(surface->surface_control, mDisplayLayerStack)
+ .setLayer(surface->surface_control, params->layer)
+ .setAlpha(surface->surface_control, params->alpha)
+ .setPosition(surface->surface_control, params->x, params->y)
+ .apply();
+#else
sf_client_begin_transaction(client);
{
surface->surface_control->setPosition(params->x, params->y);
@@ -337,6 +348,7 @@
surface->surface_control->setAlpha(params->alpha);
}
sf_client_end_transaction(client);
+#endif
if (params->create_egl_window_surface) {
if (client->egl_support) {
@@ -392,23 +404,47 @@
void sf_surface_move_to(SfSurface* surface, int x, int y)
{
assert(surface);
+#if ANDROID_VERSION_MAJOR>=8
+ android::SurfaceComposerClient::Transaction()
+ .setPosition(surface->surface_control, x, y)
+ .apply(true);
+#else
surface->surface_control->setPosition(x, y);
+#endif
}
void sf_surface_set_size(SfSurface* surface, int w, int h)
{
assert(surface);
+#if ANDROID_VERSION_MAJOR>=8
+ android::SurfaceComposerClient::Transaction()
+ .setSize(surface->surface_control, w, h)
+ .apply(true);
+#else
surface->surface_control->setSize(w, h);
+#endif
}
void sf_surface_set_layer(SfSurface* surface, int layer)
{
assert(surface);
+#if ANDROID_VERSION_MAJOR>=8
+ android::SurfaceComposerClient::Transaction()
+ .setLayer(surface->surface_control, layer)
+ .apply(true);
+#else
surface->surface_control->setLayer(layer);
+#endif
}
void sf_surface_set_alpha(SfSurface* surface, float alpha)
{
assert(surface);
+#if ANDROID_VERSION_MAJOR>=8
+ android::SurfaceComposerClient::Transaction()
+ .setAlpha(surface->surface_control, alpha)
+ .apply(true);
+#else
surface->surface_control->setAlpha(alpha);
+#endif
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/common/hooks.c
^
|
@@ -2933,6 +2933,8 @@
// HOOK_DIRECT(memswap),
HOOK_DIRECT_NO_DEBUG(index),
HOOK_DIRECT_NO_DEBUG(rindex),
+ HOOK_DIRECT_NO_DEBUG(stpcpy),
+ HOOK_DIRECT_NO_DEBUG(stpncpy),
HOOK_DIRECT_NO_DEBUG(strchr),
HOOK_DIRECT_NO_DEBUG(strrchr),
HOOK_INDIRECT(strlen),
@@ -3332,6 +3334,8 @@
/* fdsan.h */
HOOK_INDIRECT(android_fdsan_exchange_owner_tag),
HOOK_INDIRECT(android_fdsan_close_with_tag),
+ /* pthread.h */
+ HOOK_DIRECT_NO_DEBUG(pthread_setschedprio),
};
static int hook_cmp(const void *a, const void *b)
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/common/q/Makefile.am
^
|
@@ -19,6 +19,7 @@
q_la_SOURCES = \
hybris_compat.cpp \
+ bionic/libc/bionic/bionic_call_ifunc_resolver.cpp \
dlfcn.cpp \
linker_allocator.cpp \
linker_block_allocator.cpp \
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/common/q/bionic/libc/bionic/bionic_call_ifunc_resolver.cpp
^
|
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "private/bionic_call_ifunc_resolver.h"
+#include <sys/auxv.h>
+#include <sys/ifunc.h>
+
+ElfW(Addr) __bionic_call_ifunc_resolver(ElfW(Addr) resolver_addr) {
+#if defined(__aarch64__)
+ typedef ElfW(Addr) (*ifunc_resolver_t)(uint64_t, __ifunc_arg_t*);
+ static __ifunc_arg_t arg = { sizeof(__ifunc_arg_t), getauxval(AT_HWCAP), getauxval(AT_HWCAP2) };
+ return reinterpret_cast<ifunc_resolver_t>(resolver_addr)(arg._hwcap | _IFUNC_ARG_HWCAP, &arg);
+#elif defined(__arm__)
+ typedef ElfW(Addr) (*ifunc_resolver_t)(unsigned long);
+ static unsigned long hwcap = getauxval(AT_HWCAP);
+ return reinterpret_cast<ifunc_resolver_t>(resolver_addr)(hwcap);
+#else
+ typedef ElfW(Addr) (*ifunc_resolver_t)(void);
+ return reinterpret_cast<ifunc_resolver_t>(resolver_addr)();
+#endif
+}
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/common/q/bionic/libc/include/sys/ifunc.h
^
|
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <sys/cdefs.h>
+
+/**
+ * @file sys/ifunc.h
+ * @brief Declarations used for ifunc resolvers. Currently only meaningful for arm64.
+ */
+
+__BEGIN_DECLS
+
+#if defined(__aarch64__)
+
+/**
+ * Provides information about hardware capabilities to ifunc resolvers.
+ *
+ * Starting with API level 30, ifunc resolvers on arm64 are passed two arguments. The first is a
+ * uint64_t whose value is equal to getauxval(AT_HWCAP) | _IFUNC_ARG_HWCAP. The second is a pointer
+ * to a data structure of this type. Prior to API level 30, no arguments are passed to ifunc
+ * resolvers. Code that wishes to be compatible with prior API levels should not accept any
+ * arguments in the resolver.
+ */
+typedef struct __ifunc_arg_t {
+ /** Set to sizeof(__ifunc_arg_t). */
+ unsigned long _size;
+
+ /** Set to getauxval(AT_HWCAP). */
+ unsigned long _hwcap;
+
+ /** Set to getauxval(AT_HWCAP2). */
+ unsigned long _hwcap2;
+} __ifunc_arg_t;
+
+/**
+ * If this bit is set in the first argument to an ifunc resolver, indicates that the second argument
+ * is a pointer to a data structure of type __ifunc_arg_t. This bit is always set on Android
+ * starting with API level 30.
+ */
+#define _IFUNC_ARG_HWCAP (1ULL << 62)
+
+#endif
+
+__END_DECLS
|
[-]
[+]
|
Added |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/common/q/bionic/libc/private/bionic_call_ifunc_resolver.h
^
|
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2019 The Android Open Source Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <link.h>
+#include <sys/cdefs-android.h>
+
+__LIBC_HIDDEN__ ElfW(Addr) __bionic_call_ifunc_resolver(ElfW(Addr) resolver_addr);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/common/q/linker.cpp
^
|
@@ -70,6 +70,7 @@
#include "linker_tls.h"
#include "linker_utils.h"
+#include "private/bionic_call_ifunc_resolver.h"
#include "private/bionic_globals.h"
#include "android-base/macros.h"
//#include "android-base/strings.h"
@@ -2640,11 +2641,9 @@
}
ElfW(Addr) call_ifunc_resolver(ElfW(Addr) resolver_addr) {
- typedef ElfW(Addr) (*ifunc_resolver_t)(void);
- ifunc_resolver_t ifunc_resolver = reinterpret_cast<ifunc_resolver_t>(resolver_addr);
- ElfW(Addr) ifunc_addr = ifunc_resolver();
+ ElfW(Addr) ifunc_addr = __bionic_call_ifunc_resolver(resolver_addr);
TRACE_TYPE(RELO, "Called ifunc_resolver@%p. The result is %p",
- ifunc_resolver, reinterpret_cast<void*>(ifunc_addr));
+ reinterpret_cast<void *>(resolver_addr), reinterpret_cast<void*>(ifunc_addr));
return ifunc_addr;
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/configure.ac
^
|
@@ -256,6 +256,8 @@
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_13_0_0],[test $android_headers_major -ge 13 -a $android_headers_minor -ge 0 ])
+AM_CONDITIONAL([HAS_ANDROID_12_0_0],[test $android_headers_major -ge 12 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_11_0_0],[test $android_headers_major -ge 11 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_10_0_0],[test $android_headers_major -ge 10 -a $android_headers_minor -ge 0 ])
AM_CONDITIONAL([HAS_ANDROID_9_0_0], [test $android_headers_major -ge 9 -a $android_headers_minor -ge 0 ])
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/egl/egl.c
^
|
@@ -17,6 +17,8 @@
#include "config.h"
+#include <android-config.h>
+
/* EGL function pointers */
#define EGL_EGLEXT_PROTOTYPES
#include <EGL/egl.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/egl/eglhybris.h
^
|
@@ -19,10 +19,11 @@
#ifndef EGL_HYBRIS_H_
#define EGL_HYBRIS_H_
+#include "platformcommon.h"
+
/* Needed for ICS window.h */
#include <string.h>
#include <system/window.h>
-#include "platformcommon.h"
#ifdef __cplusplus
extern "C" {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/egl/platforms/common/eglnativewindowbase.h
^
|
@@ -17,13 +17,13 @@
#ifndef EGLNATIVEWINDOWBASE_H
#define EGLNATIVEWINDOWBASE_H
+#include "nativewindowbase.h"
+
/* for ICS window.h */
#include <string.h>
#include <system/window.h>
#include <EGL/egl.h>
-#include "nativewindowbase.h"
-
/**
* @brief A Class to do common ANativeWindow initialization and thunk c-style
* callbacks into C++ method calls.
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/gralloc/gralloc.c
^
|
@@ -109,6 +109,12 @@
void hybris_gralloc_initialize(int framebuffer)
{
if (version == -1) {
+#if ANDROID_VERSION_MAJOR>=10
+ hybris_ui_initialize();
+ if (hybris_ui_check_for_symbol("graphic_buffer_allocator_allocate")) {
+ version = 2;
+ } else
+#endif
if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const struct hw_module_t **)&gralloc_hardware_module) == 0) {
#if HAS_GRALLOC1_HEADER
uint8_t majorVersion = (gralloc_hardware_module->module_api_version >> 8) & 0xFF;
@@ -152,16 +158,8 @@
assert(NULL);
}
} else {
-#if ANDROID_VERSION_MAJOR>=10
- hybris_ui_initialize();
- if (hybris_ui_check_for_symbol("graphic_buffer_allocator_allocate")) {
- version = 2;
- } else
-#endif
- {
- fprintf(stderr, "failed to find/load gralloc module\n");
- assert(NULL);
- }
+ fprintf(stderr, "failed to find/load gralloc module\n");
+ assert(NULL);
}
} else {
TRACE("hybris gralloc module has been already initialized\n");
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/hwc2/hwc2.c
^
|
@@ -19,6 +19,8 @@
#include <dlfcn.h>
#include <stddef.h>
+#include <android-config.h>
+
#include <hybris/common/binding.h>
#include <hybris/hwc2/hwc2_compatibility_layer.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/include/EGL/eglplatform.h
^
|
@@ -103,7 +103,7 @@
typedef intptr_t EGLNativePixmapType;
typedef intptr_t EGLNativeWindowType;
-#elif defined(USE_X11)
+#elif defined(USE_X11) && !defined(MESA_EGL_NO_X11_HEADERS)
/* X11 (tentative) */
#include <X11/Xlib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/include/hybris/gralloc/gralloc.h
^
|
@@ -22,6 +22,8 @@
extern "C" {
#endif
+#include <android-config.h>
+
#include <cutils/native_handle.h>
#include <system/window.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/include/hybris/internal/camera_control.h
^
|
@@ -31,6 +31,10 @@
#include <stdint.h>
#include <unistd.h>
+#if ANDROID_VERSION_MAJOR >= 9
+#include <vector>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -48,11 +52,17 @@
CameraControlListener* listener;
android::sp<android::Camera> camera;
android::CameraParameters camera_parameters;
+ int preview_texture_id = 0;
#if ANDROID_VERSION_MAJOR==4 && ANDROID_VERSION_MINOR<=2
android::sp<android::SurfaceTexture> preview_texture;
#else
android::sp<android::GLConsumer> preview_texture;
#endif
+#if ANDROID_VERSION_MAJOR >= 5
+ android::sp<android::IGraphicBufferProducer> preview_bq;
+#else
+ android::sp<android::BufferQueue> preview_bq;
+#endif
// From android::SurfaceTexture/GLConsumer::FrameAvailableListener
#if ANDROID_VERSION_MAJOR==5 && ANDROID_VERSION_MINOR>=1 || ANDROID_VERSION_MAJOR>=6
void onFrameAvailable(const android::BufferItem& item);
@@ -75,6 +85,10 @@
#if ANDROID_VERSION_MAJOR >= 7
void postRecordingFrameHandleTimestamp(nsecs_t timestamp, native_handle_t* handle);
#endif
+#if ANDROID_VERSION_MAJOR >= 9
+ void postRecordingFrameHandleTimestampBatch(const std::vector<nsecs_t>& timestamps,
+ const std::vector<native_handle_t*>& handles);
+#endif
};
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/include/hybris/media/media_meta_data_layer.h
^
|
@@ -37,8 +37,7 @@
MEDIA_META_DATA_KEY_STRIDE = 7,
MEDIA_META_DATA_KEY_COLOR_FORMAT = 8,
MEDIA_META_DATA_KEY_SLICE_HEIGHT = 9,
- MEDIA_META_DATA_KEY_FRAMERATE = 10,
- MEDIA_META_DATA_KEY_MEDIA_BUFFER = 11
+ MEDIA_META_DATA_KEY_FRAMERATE = 10
};
uint32_t media_meta_data_get_key_id(int key);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/include/hybris/media/surface_texture_client_hybris.h
^
|
@@ -34,13 +34,6 @@
extern "C" {
#endif
- // Taken from native_window.h
- enum {
- WINDOW_FORMAT_RGBA_8888 = 1,
- WINDOW_FORMAT_RGBX_8888 = 2,
- WINDOW_FORMAT_RGB_565 = 4,
- };
-
typedef void* SurfaceTextureClientHybris;
typedef void* GLConsumerHybris;
typedef void* GLConsumerWrapperHybris;
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/libsync/sync.c
^
|
@@ -21,9 +21,9 @@
#include <string.h>
#include <stdlib.h>
-#include <android-version.h>
+#include <android-config.h>
-#if (ANDROID_VERSION_MAJOR >= 10)
+#if (ANDROID_VERSION_MAJOR >= 10) && (ANDROID_VERSION_MAJOR < 12)
#include <linux/sync_file.h>
struct sync_file_info* sync_file_info(int32_t fd);
static inline struct sync_fence_info* sync_get_fence_info(const struct sync_file_info* info) {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/nativewindowbase.cpp
^
|
@@ -21,6 +21,8 @@
#define TRACE(message, ...)
#endif
+#include "nativewindowbase.h"
+
#include <string.h>
#include <system/window.h>
#include <system/graphics.h>
@@ -39,8 +41,6 @@
#define HYBRIS_TRACE_END(...)
#endif
-#include "nativewindowbase.h"
-
BaseNativeWindowBuffer::BaseNativeWindowBuffer()
{
TRACE("%p", this);
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/nativewindowbase.h
^
|
@@ -17,6 +17,8 @@
#ifndef NATIVEWINDOWBASE_H
#define NATIVEWINDOWBASE_H
+#include <android-config.h>
+
/* for ICS window.h */
#include <string.h>
#include <system/window.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/platformcommon.h
^
|
@@ -18,6 +18,8 @@
#ifndef PLATFORM_COMMON_H_
#define PLATFORM_COMMON_H_
+#include <android-config.h>
+
/* Needed for ICS window.h */
#include <string.h>
#include <system/window.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/server_wlegl.cpp
^
|
@@ -24,6 +24,8 @@
#include <android-config.h>
#include <cstring>
+#include "server_wlegl.h"
+
extern "C" {
#include <cutils/native_handle.h>
}
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/server_wlegl.h
^
|
@@ -24,6 +24,8 @@
#ifndef SERVER_WLEGL_H
#define SERVER_WLEGL_H
+#include <android-config.h>
+
#include <system/window.h>
extern "C" {
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/server_wlegl_buffer.h
^
|
@@ -23,6 +23,8 @@
#ifndef SERVER_WLEGL_BUFFER_H
#define SERVER_WLEGL_BUFFER_H
+#include <android-config.h>
+
#include <cutils/native_handle.h>
#include <string.h>
#include <system/window.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/server_wlegl_handle.h
^
|
@@ -23,6 +23,8 @@
#ifndef SERVER_WLEGL_HANDLE_H
#define SERVER_WLEGL_HANDLE_H
+#include <android-config.h>
+
#include <stdint.h>
#include <string.h>
#include <wayland-server.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/platforms/common/windowbuffer.h
^
|
@@ -23,6 +23,8 @@
#ifndef WINDOWBUFFER_H
#define WINDOWBUFFER_H
+#include <android-config.h>
+
#include <cutils/native_handle.h>
#include <string.h>
#include <system/window.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/ui/ui.c
^
|
@@ -17,7 +17,8 @@
#include <dlfcn.h>
#include <stddef.h>
-#include <android-version.h>
+#include <android-config.h>
+
#if ANDROID_VERSION_MAJOR>=10
#include <android/rect.h>
#include <cutils/native_handle.h>
|
[-]
[+]
|
Changed |
_service:tar_git:libhybris-0.0.5.49.tar.bz2/libhybris/hybris/vulkan/vulkan.c
^
|
@@ -544,8 +544,6 @@
VULKAN_IDLOAD(vkSetPrivateDataEXT);
VULKAN_IDLOAD(vkGetPrivateDataEXT);
VULKAN_IDLOAD(vkCmdSetFragmentShadingRateEnumNV);
-VULKAN_IDLOAD(vkAcquireWinrtDisplayNV);
-VULKAN_IDLOAD(vkGetWinrtDisplayNV);
VULKAN_IDLOAD(vkCmdSetVertexInputEXT);
#if VK_HEADER_VERSION >= 184
VULKAN_IDLOAD(vkGetDeviceSubpassShadingMaxWorkgroupSizeHUAWEI);
|