[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://github.com/sailfishos/droidmedia.git</param>
<param name="branch">master</param>
- <param name="revision">0.20210818.0</param>
+ <param name="revision">0.20211101.0</param>
<param name="token"/>
<param name="debian"/>
<param name="dumb"/>
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/Android.mk
^
|
@@ -89,19 +89,27 @@
libmedia_omx
endif
+ifeq ($(shell test $(ANDROID_MAJOR) -ge 11 && echo true),true)
+LOCAL_SHARED_LIBRARIES += libmedia_codeclist
+endif
+
LOCAL_CPPFLAGS=-DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) $(FORCE_HAL_PARAM) -Wno-unused-parameter
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libdroidmedia
-ifeq ($(strip $(ANDROID_MAJOR)),7)
+ifeq ($(shell test $(ANDROID_MAJOR) -ge 7 && echo true),true)
LOCAL_C_INCLUDES := frameworks/native/include/media/openmax \
frameworks/native/include/media/hardware
-else ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
-LOCAL_C_INCLUDES := frameworks/native/include/media/openmax \
- frameworks/native/include/media/hardware \
- frameworks/native/libs/nativewindow/include \
+ifeq ($(shell test $(ANDROID_MAJOR) -ge 8 && echo true),true)
+LOCAL_C_INCLUDES += frameworks/native/libs/nativewindow/include \
frameworks/av/media/libstagefright/omx/include \
frameworks/av/media/libstagefright/xmlparser/include
+endif
+ifeq ($(shell test $(ANDROID_MAJOR) -ge 11 && echo true),true)
+LOCAL_C_INCLUDES += frameworks/av/media/libmediametrics/include \
+ frameworks/av/media/libstagefright/include \
+ frameworks/av/drm/libmediadrm/interface
+endif
else
LOCAL_C_INCLUDES := frameworks/native/include/media/openmax
endif
@@ -145,9 +153,16 @@
LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.4
endif
+ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),10))
+LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.5
+endif
+
+ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),11))
+LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.6
+endif
+
ifeq ($(shell test $(ANDROID_MAJOR) -ge 10 && echo true),true)
-LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.5 \
- android.hardware.camera.device@3.4 \
+LOCAL_SHARED_LIBRARIES += android.hardware.camera.device@3.4 \
libsensorprivacy
LOCAL_AIDL_INCLUDES := frameworks/native/libs/sensorprivacy/aidl
endif
@@ -168,6 +183,12 @@
LOCAL_SHARED_LIBRARIES += android.hidl.memory@1.0
endif
+ifeq ($(shell test $(ANDROID_MAJOR) -ge 11 && echo true),true)
+LOCAL_SHARED_LIBRARIES += libmedia_codeclist \
+ libresourcemanagerservice \
+ libbinder_ndk
+endif
+
LOCAL_MODULE_TAGS := optional
LOCAL_CPPFLAGS=-DANDROID_MAJOR=$(ANDROID_MAJOR) -DANDROID_MINOR=$(ANDROID_MINOR) -DANDROID_MICRO=$(ANDROID_MICRO) -Wno-unused-parameter
ifeq ($(MINIMEDIA_SENSORSERVER_DISABLE),1)
@@ -248,9 +269,16 @@
LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.4
endif
+ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),10))
+LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.5
+endif
+
+ifeq ($(ANDROID_MAJOR),$(filter $(ANDROID_MAJOR),11))
+LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.6
+endif
+
ifeq ($(shell test $(ANDROID_MAJOR) -ge 10 && echo true),true)
-LOCAL_SHARED_LIBRARIES += android.hardware.camera.provider@2.5 \
- android.hardware.camera.device@3.4 \
+LOCAL_SHARED_LIBRARIES += android.hardware.camera.device@3.4 \
libsensorprivacy
LOCAL_AIDL_INCLUDES := frameworks/native/libs/sensorprivacy/aidl
endif
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/AsyncDecodingSource.cpp
^
|
@@ -18,7 +18,11 @@
#include "AsyncDecodingSource.h"
#include <utils/Log.h>
#include <gui/Surface.h>
+#if ANDROID_MAJOR >= 11
+#include <mediadrm/ICrypto.h>
+#else
#include <media/ICrypto.h>
+#endif
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
@@ -58,6 +62,8 @@
return nullptr;
}
+ format->setInt32("android._num-input-buffers", 12);
+
Vector<AString> matchingCodecs;
MediaCodecList::findMatchingCodecs(
mime, false /* encoder */, flags, &matchingCodecs);
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/AsyncDecodingSource.h
^
|
@@ -21,7 +21,7 @@
#include <media/stagefright/foundation/AString.h>
#include <media/stagefright/foundation/Mutexed.h>
#include <media/stagefright/foundation/AHandlerReflector.h>
-#if ANDROID_MAJOR >= 9
+#if ANDROID_MAJOR >= 9 && ANDROID_MAJOR <= 10
#include <media/MediaSource.h>
#else
#include <media/stagefright/MediaSource.h>
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/droidmediacamera.cpp
^
|
@@ -147,7 +147,11 @@
switch (dataMsgType) {
case CAMERA_MSG_RAW_IMAGE:
mem.size = dataPtr->size();
+#if ANDROID_MAJOR >= 11
+ mem.data = dataPtr->unsecurePointer();
+#else
mem.data = dataPtr->pointer();
+#endif
if (m_cam->m_cb.raw_image_cb) {
m_cam->m_cb.raw_image_cb(m_cam->m_cb_data, &mem);
@@ -156,7 +160,11 @@
case CAMERA_MSG_COMPRESSED_IMAGE:
mem.size = dataPtr->size();
+#if ANDROID_MAJOR >= 11
+ mem.data = dataPtr->unsecurePointer();
+#else
mem.data = dataPtr->pointer();
+#endif
if (m_cam->m_cb.compressed_image_cb) {
m_cam->m_cb.compressed_image_cb(m_cam->m_cb_data, &mem);
@@ -165,7 +173,11 @@
case CAMERA_MSG_POSTVIEW_FRAME:
mem.size = dataPtr->size();
+#if ANDROID_MAJOR >= 11
+ mem.data = dataPtr->unsecurePointer();
+#else
mem.data = dataPtr->pointer();
+#endif
if (m_cam->m_cb.postview_frame_cb) {
m_cam->m_cb.postview_frame_cb(m_cam->m_cb_data, &mem);
}
@@ -179,7 +191,11 @@
case CAMERA_MSG_PREVIEW_FRAME:
mem.size = dataPtr->size();
+#if ANDROID_MAJOR >= 11
+ mem.data = dataPtr->unsecurePointer();
+#else
mem.data = dataPtr->pointer();
+#endif
if (m_cam->m_cb.preview_frame_cb) {
m_cam->m_cb.preview_frame_cb(m_cam->m_cb_data, &mem);
}
@@ -341,7 +357,7 @@
cam->m_queue = queue;
cam->m_queue->attachToCameraPreview(cam->m_camera);
-#if ANDROID_MAJOR >= 8
+#if ANDROID_MAJOR >= 9
android::sp<DroidMediaBufferQueue>
recording_queue(new DroidMediaBufferQueue("DroidMediaCameraBufferRecordingQueue"));
if (!recording_queue->connectListener()) {
@@ -369,7 +385,7 @@
camera->m_queue->setCallbacks(0, 0);
-#if ANDROID_MAJOR >= 8
+#if ANDROID_MAJOR >= 9
if (camera->m_recording_queue.get()) {
camera->m_recording_queue->setCallbacks(0, 0);
}
@@ -515,7 +531,11 @@
void *droid_media_camera_recording_frame_get_data(DroidMediaCameraRecordingData *data)
{
+#if ANDROID_MAJOR >= 11
+ return data->mem->unsecurePointer();
+#else
return data->mem->pointer();
+#endif
}
bool droid_media_camera_enable_face_detection(DroidMediaCamera *camera,
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/droidmediacodec.cpp
^
|
@@ -45,7 +45,7 @@
#include "AsyncDecodingSource.h"
#endif
-#if ANDROID_MAJOR >= 9
+#if ANDROID_MAJOR >= 9 && ANDROID_MAJOR <= 10
#include <media/MediaSource.h>
#else
#include <media/stagefright/MediaSource.h>
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/private.cpp
^
|
@@ -129,7 +129,7 @@
}
void _DroidMediaBufferQueue::attachToCameraVideo(android::sp<android::Camera>& camera) {
-#if ANDROID_MAJOR >= 8
+#if ANDROID_MAJOR >= 9
camera->setVideoTarget(m_producer);
#endif
}
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/private.h
^
|
@@ -22,7 +22,7 @@
#include "droidmedia.h"
#include <gui/BufferQueue.h>
#include <camera/Camera.h>
-#if ANDROID_MAJOR >= 9
+#if ANDROID_MAJOR >= 9 && ANDROID_MAJOR <= 10
#include <media/MediaSource.h>
#else
#include <media/stagefright/MediaSource.h>
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/services/services.h
^
|
@@ -65,5 +65,8 @@
#include "services_10_0_0.h"
#endif
+#if ANDROID_MAJOR == 11
+#include "services_11_0_0.h"
+#endif
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/services/services_10_0_0.h
^
|
@@ -168,6 +168,7 @@
using namespace android;
+#include <binder/BinderService.h>
#include <gui/ISurfaceComposer.h>
#include <gui/IDisplayEventConnection.h>
#include <gui/ISurfaceComposerClient.h>
@@ -201,6 +202,11 @@
return sp<IDisplayEventConnection>();
}
+ sp<IDisplayEventConnection> createDisplayEventConnection(
+ VsyncSource) {
+ return sp<IDisplayEventConnection>();
+ }
+
sp<IBinder> createDisplay(const String8&, bool) {
return NULL;
@@ -611,10 +617,17 @@
const Vector<MediaResource> &) {
}
+ void addResource(int, int64_t, const sp<IResourceManagerClient>,
+ const Vector<MediaResource> &) {
+ }
+
void removeResource(int, int64_t,
const Vector<MediaResource> &) {
}
+ void removeResource(int, int64_t) {
+ }
+
void removeClient(int, int64_t) {
}
|
[-]
[+]
|
Added |
_service:tar_git:droidmedia-devel-0.20211101.0.tgz/services/services_11_0_0.h
^
|
@@ -0,0 +1,786 @@
+/*
+ * Copyright (C) 2014-2021 Jolla Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Authored by: Mohammed Hassan <mohammed.hassan@jolla.com>
+ */
+
+#include <sensor/ISensorServer.h>
+#include <sensor/ISensorEventConnection.h>
+#include <sensor/Sensor.h>
+#include <sensor/BitTube.h>
+
+class FakeSensorEventConnection : public android::BnSensorEventConnection
+{
+ android::sp<android::BitTube> mChannel;
+public:
+ FakeSensorEventConnection() {
+ mChannel = new android::BitTube(0);
+ }
+
+ android::sp<android::BitTube> getSensorChannel() const {
+ return mChannel;
+ }
+
+ android::status_t enableDisable(int, bool, nsecs_t, nsecs_t, int) {
+ return 0;
+ }
+
+ android::status_t setEventRate(int, nsecs_t) {
+ return 0;
+ }
+
+ android::status_t flush() {
+ return 0;
+ }
+
+ virtual int32_t configureChannel(int32_t, int32_t) {
+ return 0;
+ }
+
+protected:
+ void destroy() {
+ }
+
+};
+
+class FakeSensorServer : public android::BinderService<FakeSensorServer>,
+ public android::BnSensorServer
+{
+public:
+ static char const *getServiceName() {
+ return "sensorservice";
+ }
+
+ android::Vector<android::Sensor> getSensorList(const android::String16&) {
+ return android::Vector<android::Sensor>();
+ }
+
+ android::Vector<android::Sensor> getDynamicSensorList(const android::String16&) {
+ return android::Vector<android::Sensor>();
+ }
+
+ android::sp<android::ISensorEventConnection> createSensorEventConnection(
+ const android::String8&, int, const android::String16&) {
+ return android::sp<android::ISensorEventConnection>(new FakeSensorEventConnection);
+ }
+
+ android::sp<android::ISensorEventConnection> createSensorDirectConnection(
+ const android::String16&, uint32_t, int32_t, int32_t, const native_handle_t *) {
+ return android::sp<android::ISensorEventConnection>(new FakeSensorEventConnection);
+ }
+
+ int setOperationParameter(
+ int32_t, int32_t, const android::Vector<float> &, const android::Vector<int32_t> &) {
+ return 0;
+ }
+
+ int32_t isDataInjectionEnabled() {
+ return 0;
+ }
+
+ android::status_t shellCommand(int, int, int,
+ android::Vector<android::String16>&) {
+ return 0;
+ }
+};
+
+#include <android/frameworks/sensorservice/1.0/IEventQueue.h>
+#include <android/frameworks/sensorservice/1.0/ISensorManager.h>
+#include <android/frameworks/sensorservice/1.0/types.h>
+#include <android/hardware/sensors/1.0/types.h>
+
+class FakeEventQueue :
+ public android::frameworks::sensorservice::V1_0::IEventQueue
+{
+public:
+ FakeEventQueue() {}
+
+ android::hardware::Return<android::frameworks::sensorservice::V1_0::Result> enableSensor(
+ int32_t sensorHandle, int32_t samplingPeriodUs, int64_t maxBatchReportLatencyUs) {
+ return android::frameworks::sensorservice::V1_0::Result::BAD_VALUE;
+ }
+
+ android::hardware::Return<android::frameworks::sensorservice::V1_0::Result> disableSensor(
+ int32_t sensorHandle) {
+ return android::frameworks::sensorservice::V1_0::Result::BAD_VALUE;
+ }
+};
+
+class FakeSensorManager :
+ public android::frameworks::sensorservice::V1_0::ISensorManager
+{
+
+ // Methods from ::android::frameworks::sensorservice::V1_0::ISensorManager follow.
+ android::hardware::Return<void> getSensorList(getSensorList_cb _hidl_cb) {
+ android::hardware::hidl_vec<::android::hardware::sensors::V1_0::SensorInfo> ret;
+ _hidl_cb(ret, android::frameworks::sensorservice::V1_0::Result::OK);
+ return android::hardware::Void();
+ }
+
+ android::hardware::Return<void> getDefaultSensor(
+ android::hardware::sensors::V1_0::SensorType type,
+ getDefaultSensor_cb _hidl_cb) {
+ _hidl_cb({}, android::frameworks::sensorservice::V1_0::Result::NOT_EXIST);
+ return android::hardware::Void();
+ }
+
+ android::hardware::Return<void> createAshmemDirectChannel(
+ const android::hardware::hidl_memory& mem, uint64_t size,
+ createAshmemDirectChannel_cb _hidl_cb) {
+ _hidl_cb(nullptr, android::frameworks::sensorservice::V1_0::Result::BAD_VALUE);
+ return android::hardware::Void();
+ }
+
+ android::hardware::Return<void> createGrallocDirectChannel(
+ const android::hardware::hidl_handle& buffer, uint64_t size,
+ createGrallocDirectChannel_cb _hidl_cb) {
+ _hidl_cb(nullptr, android::frameworks::sensorservice::V1_0::Result::UNKNOWN_ERROR);
+ return android::hardware::Void();
+ }
+
+ android::hardware::Return<void> createEventQueue(
+ const android::sp<android::frameworks::sensorservice::V1_0::IEventQueueCallback> &callback,
+ createEventQueue_cb _hidl_cb) {
+ if (callback == nullptr) {
+ _hidl_cb(nullptr, android::frameworks::sensorservice::V1_0::Result::BAD_VALUE);
+ return android::hardware::Void();
+ }
+
+ android::sp<android::frameworks::sensorservice::V1_0::IEventQueue> queue = new FakeEventQueue();
+
+ _hidl_cb(queue, android::frameworks::sensorservice::V1_0::Result::OK);
+ return android::hardware::Void();
+ }
+};
+
+using namespace android;
+
+#include <gui/ISurfaceComposer.h>
+#include <gui/IDisplayEventConnection.h>
+#include <gui/ISurfaceComposerClient.h>
+#include <ui/Rect.h>
+#include <system/graphics.h>
+
+class MiniSurfaceFlinger : public BinderService<MiniSurfaceFlinger>,
+ public BnSurfaceComposer,
+ public IBinder::DeathRecipient
+{
+public:
+ static char const *getServiceName() {
+ return "SurfaceFlinger";
+ }
+
+ void binderDied(const wp<IBinder>&) {
+ // Nothing
+ }
+
+ sp<ISurfaceComposerClient> createConnection() {
+ return sp<ISurfaceComposerClient>();
+ }
+
+ sp<ISurfaceComposerClient> createScopedConnection(
+ const sp<IGraphicBufferProducer>&) {
+ return sp<ISurfaceComposerClient>();
+ }
+
+ sp<IDisplayEventConnection> createDisplayEventConnection(
+ VsyncSource, ConfigChanged) {
|