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
1diff --git a/compat/media/Android.mk b/compat/media/Android.mk
2index 2894983..2bd214e 100644
3--- a/compat/media/Android.mk
4+++ b/compat/media/Android.mk
5@@ -38,6 +38,9 @@ ifdef TARGET_2ND_ARCH
6 LOCAL_MULTILIB := both
7 LOCAL_MODULE_STEM_32 := $(if $(filter false,$(BOARD_UBUNTU_PREFER_32_BIT)),$(LOCAL_MODULE)$(TARGET_2ND_ARCH_MODULE_SUFFIX),$(LOCAL_MODULE))
8 LOCAL_MODULE_STEM_64 := $(if $(filter false,$(BOARD_UBUNTU_PREFER_32_BIT)),$(LOCAL_MODULE),$(LOCAL_MODULE)_64)
9+ifneq ($(filter-out $(TARGET_2ND_ARCH),$(BOARD_UBUNTU_ARCH)),)
10+LOCAL_CFLAGS += -DWITH_MEDIA_PLAYER_SERVICE
11+endif
12 endif
13
14 include $(BUILD_EXECUTABLE)
15diff --git a/compat/media/camera_service.cpp b/compat/media/camera_service.cpp
16index 38bec4b..5f933df 100644
17--- a/compat/media/camera_service.cpp
18+++ b/compat/media/camera_service.cpp
19@@ -20,6 +20,9 @@
20 #undef LOG_TAG
21 #define LOG_TAG "CameraServiceCompatLayer"
22
23+#if defined(WITH_MEDIA_PLAYER_SERVICE)
24+#include <MediaPlayerService.h>
25+#endif
26 #include "media_recorder_factory.h"
27 #include "media_recorder.h"
28
29@@ -41,6 +44,9 @@ int main(int argc, char** argv)
30
31 ALOGV("Starting camera services (MediaRecorderFactory, CameraRecordService & CameraService)");
32
33+#if defined(WITH_MEDIA_PLAYER_SERVICE)
34+ MediaPlayerService::instantiate();
35+#endif
36 // Instantiate the in-process MediaRecorderFactory which is responsible
37 // for creating a new IMediaRecorder (MediaRecorder) instance over Binder
38 MediaRecorderFactory::instantiate();

Subscribers

People subscribed via source and target branches