Merge ~vicamo/libhybris/+git/libhybris:for-libhybris-maintainers/bug-1619107/media-service-for-32-bit-codecs into ~libhybris-maintainers/libhybris/+git/libhybris:master

Proposed by You-Sheng Yang
Status: Needs review
Proposed branch: ~vicamo/libhybris/+git/libhybris:for-libhybris-maintainers/bug-1619107/media-service-for-32-bit-codecs
Merge into: ~libhybris-maintainers/libhybris/+git/libhybris:master
Diff against target: 38 lines (+9/-0)
2 files modified
compat/media/Android.mk (+3/-0)
compat/media/camera_service.cpp (+6/-0)
Reviewer Review Type Date Requested Status
Simon Fels Approve
Review via email: mp+308821@code.launchpad.net

Description of the change

Bring back 32-bit media.service so that 64-bit Ubuntu processes may access codecs correctly.

To post a comment you must log in.
Revision history for this message
You-Sheng Yang (vicamo) wrote :

So far codec listing works internally, but not for libhybris. The Bp part of a MediaCodec is returned as a shared pointer, and while we have:

  return MediaCodecList::getInstance()->getCodecInfo(index)->getCodecName();

The returned string pointer will be invalidated right after the return statement because nobody holds a reference to that MediaCodec shared pointer, and it desctructs itself right away.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

[push b9b51b7] support compiling under i386/x86_64 as well.

Revision history for this message
Simon Fels (morphis) wrote :

LGTM, do you need anymore changes on this or can we merge this?

review: Approve
Revision history for this message
You-Sheng Yang (vicamo) wrote :
Revision history for this message
You-Sheng Yang (vicamo) wrote :

[push b3c1b3d] 1. wrap header import as well. 2. remove bug link for private project.

Revision history for this message
You-Sheng Yang (vicamo) wrote :

@Simon, fixed mp for frameworks/av. It's safe for both vivid-armhf and xenial-arm64 now.

Unmerged commits

b3c1b3d... by You-Sheng Yang

media: add media.service when necessary

Vendor codecs are usually only available under arm32 flavor. When running in
arm64 ubuntu, MediaCodecList will try to load codecs of arm64, which is
then certainly unavailable. In order to use codecs of a different
architecture, we'll need some kind of process gap and IPC to call remote
procedures. The original Android media service meets the purpose well,
so we have to enable it for such dual-arch setup.

b9b51b7... by Simon Fels

Merge remote-tracking branch 'lp/master' into stable

839cb9c... by Simon Fels

Merge branch 'master' into stable

0692f89... by Simon Fels

Merge branch 'master' into stable

3b7f20d... by Simon Fels

Merge branch 'master' into stable

ca92d8c... by Simon Fels

Merge branch 'master' into stable

3893cca... by Simon Fels

debian: update changelog

9ed4990... by Simon Fels

Merge remote-tracking branch 'lp/master' into stable

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/compat/media/Android.mk b/compat/media/Android.mk
index 2894983..2bd214e 100644
--- a/compat/media/Android.mk
+++ b/compat/media/Android.mk
@@ -38,6 +38,9 @@ ifdef TARGET_2ND_ARCH
38LOCAL_MULTILIB := both38LOCAL_MULTILIB := both
39LOCAL_MODULE_STEM_32 := $(if $(filter false,$(BOARD_UBUNTU_PREFER_32_BIT)),$(LOCAL_MODULE)$(TARGET_2ND_ARCH_MODULE_SUFFIX),$(LOCAL_MODULE))39LOCAL_MODULE_STEM_32 := $(if $(filter false,$(BOARD_UBUNTU_PREFER_32_BIT)),$(LOCAL_MODULE)$(TARGET_2ND_ARCH_MODULE_SUFFIX),$(LOCAL_MODULE))
40LOCAL_MODULE_STEM_64 := $(if $(filter false,$(BOARD_UBUNTU_PREFER_32_BIT)),$(LOCAL_MODULE),$(LOCAL_MODULE)_64)40LOCAL_MODULE_STEM_64 := $(if $(filter false,$(BOARD_UBUNTU_PREFER_32_BIT)),$(LOCAL_MODULE),$(LOCAL_MODULE)_64)
41ifneq ($(filter-out $(TARGET_2ND_ARCH),$(BOARD_UBUNTU_ARCH)),)
42LOCAL_CFLAGS += -DWITH_MEDIA_PLAYER_SERVICE
43endif
41endif44endif
4245
43include $(BUILD_EXECUTABLE)46include $(BUILD_EXECUTABLE)
diff --git a/compat/media/camera_service.cpp b/compat/media/camera_service.cpp
index 38bec4b..5f933df 100644
--- a/compat/media/camera_service.cpp
+++ b/compat/media/camera_service.cpp
@@ -20,6 +20,9 @@
20#undef LOG_TAG20#undef LOG_TAG
21#define LOG_TAG "CameraServiceCompatLayer"21#define LOG_TAG "CameraServiceCompatLayer"
2222
23#if defined(WITH_MEDIA_PLAYER_SERVICE)
24#include <MediaPlayerService.h>
25#endif
23#include "media_recorder_factory.h"26#include "media_recorder_factory.h"
24#include "media_recorder.h"27#include "media_recorder.h"
2528
@@ -41,6 +44,9 @@ int main(int argc, char** argv)
4144
42 ALOGV("Starting camera services (MediaRecorderFactory, CameraRecordService & CameraService)");45 ALOGV("Starting camera services (MediaRecorderFactory, CameraRecordService & CameraService)");
4346
47#if defined(WITH_MEDIA_PLAYER_SERVICE)
48 MediaPlayerService::instantiate();
49#endif
44 // Instantiate the in-process MediaRecorderFactory which is responsible50 // Instantiate the in-process MediaRecorderFactory which is responsible
45 // for creating a new IMediaRecorder (MediaRecorder) instance over Binder51 // for creating a new IMediaRecorder (MediaRecorder) instance over Binder
46 MediaRecorderFactory::instantiate();52 MediaRecorderFactory::instantiate();

Subscribers

People subscribed via source and target branches