[Merge] ~vicamo/avila-private/+git/platform_frameworks_av:bug-1619107/media-service-for-32-bit-codecs into ~avila-private-team/avila-private/+git/platform_frameworks_av:ubuntu
Vicamo Yang
vicamo at gmail.com
Tue Nov 22 02:22:04 UTC 2016
Diff comments:
> diff --git a/media/libstagefright/Android.mk b/media/libstagefright/Android.mk
> index dc95b8a..67bfbe0 100644
> --- a/media/libstagefright/Android.mk
> +++ b/media/libstagefright/Android.mk
> @@ -15,6 +15,12 @@ ifeq ($(strip $(MTK_VIDEO_VP8ENC_SUPPORT)),yes)
> LOCAL_CFLAGS += -DMTK_VIDEO_VP8ENC_SUPPORT
> endif
>
> +ifdef TARGET_2ND_ARCH
> +ifneq ($(filter-out $(TARGET_2ND_ARCH),$(BOARD_UBUNTU_ARCH)),)
Some comments could be better, but this is common to *all* android devices so far. Android always runs media service in 32-bit mode even in current AOSP android-7 & master branches as well as all known 64-bit devices we have. x86_64 emulator variant is no exception.
> +LOCAL_CFLAGS += -DWITH_MEDIA_PLAYER_SERVICE
> +endif
> +endif
> +
> LOCAL_SRC_FILES:= \
> ACodec.cpp \
> AACExtractor.cpp \
> diff --git a/media/libstagefright/MediaCodecList.cpp b/media/libstagefright/MediaCodecList.cpp
> index d5ad77a..8324835 100644
> --- a/media/libstagefright/MediaCodecList.cpp
> +++ b/media/libstagefright/MediaCodecList.cpp
> @@ -84,7 +84,26 @@ void MediaCodecList::BinderDeathObserver::binderDied(const wp<IBinder> &who __un
>
> // static
> sp<IMediaCodecList> MediaCodecList::getInstance() {
> - sRemoteList = getLocalInstance();
> + Mutex::Autolock _l(sRemoteInitMutex);
> + if (sRemoteList == NULL) {
> +#if defined(WITH_MEDIA_PLAYER_SERVICE)
> + sp<IBinder> binder =
> + defaultServiceManager()->getService(String16("media.player"));
> + sp<IMediaPlayerService> service =
> + interface_cast<IMediaPlayerService>(binder);
> + if (service.get() != NULL) {
> + sRemoteList = service->getCodecList();
> + if (sRemoteList != NULL) {
> + sBinderDeathObserver = new BinderDeathObserver();
> + binder->linkToDeath(sBinderDeathObserver.get());
> + }
> + }
> +#endif
> + if (sRemoteList == NULL) {
> + // if failed to get remote list, create local list
> + sRemoteList = getLocalInstance();
> + }
> + }
This part was reverted from a previous Ubuntu patch, so all the added lines are actually directly from AOSP. If you compare with AOSP, then you get minimum changes this way.
> return sRemoteList;
> }
>
--
https://code.launchpad.net/~vicamo/avila-private/+git/platform_frameworks_av/+merge/308820
Your team Ubuntu Phablet Team is requested to review the proposed merge of ~vicamo/avila-private/+git/platform_frameworks_av:bug-1619107/media-service-for-32-bit-codecs into ~avila-private-team/avila-private/+git/platform_frameworks_av:ubuntu.
More information about the Ubuntu-reviews
mailing list