remove FMRadio patches

This commit is contained in:
Moyster 2016-10-24 12:51:36 +02:00
parent 2585e41394
commit 328a3092b6
2 changed files with 0 additions and 140 deletions

View File

@ -3,7 +3,6 @@ cd ../../../..
cd frameworks/av
git apply -v ../../device/mediatek/mt6753_common/patches/framework_av/0001-libmedia-stub-out-MTK-specific-bits-audio-working.patch
git apply -v ../../device/mediatek/mt6753_common/patches/framework_av/0002-camera.patch
git apply -v ../../device/mediatek/mt6753_common/patches/framework_av/0003-frameworks_av_fmradio_patch.patch
git apply -v ../../device/mediatek/mt6753_common/patches/framework_av/0001_engineering_mode_audio_settings_frameworks_av.patch
git apply -v ../../device/mediatek/mt6753_common/patches/framework_av/frameworks_av_videorecording_fix.patch
cd ../..

View File

@ -1,139 +0,0 @@
commit 0c5b6c0502f6feff62ec97405ea76aaacdde25fd
Author: Jan Engelmohr <jan.engelmohr@mailbox.tu-dresden.de>
Date: Thu May 5 00:47:41 2016 +0200
added frameworks_av patch for MTKs FM Radio
Change-Id: I50724ad6535650f376d13df992f1e5695da580bd
diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h
index b95f949..4760ba2 100644
--- a/include/media/MediaPlayerInterface.h
+++ b/include/media/MediaPlayerInterface.h
@@ -54,6 +54,7 @@ enum player_type {
// argument to the 'test:' url in the setDataSource call.
TEST_PLAYER = 5,
DASH_PLAYER = 6,
+ FM_AUDIO_PLAYER=7,
};
diff --git a/media/libmediaplayerservice/Android.mk b/media/libmediaplayerservice/Android.mk
index 8f06c55..7425a76 100644
--- a/media/libmediaplayerservice/Android.mk
+++ b/media/libmediaplayerservice/Android.mk
@@ -43,6 +43,7 @@ LOCAL_SHARED_LIBRARIES := \
libutils \
libvorbisidec \
libdrmframework \
+ libmtkplayer
LOCAL_STATIC_LIBRARIES := \
libstagefright_nuplayer \
@@ -55,6 +56,7 @@ LOCAL_C_INCLUDES := \
$(TOP)/frameworks/av/media/libstagefright/webm \
$(TOP)/frameworks/native/include/media/openmax \
$(TOP)/external/tremolo/Tremolo \
+ $(TOP)/device/mediatek/mt6753_common/MediaTek/fmaudioplayer
LOCAL_MODULE:= libmediaplayerservice
diff --git a/media/libmediaplayerservice/MediaPlayerFactory.cpp b/media/libmediaplayerservice/MediaPlayerFactory.cpp
index 03fae91..54ea2cf 100644
--- a/media/libmediaplayerservice/MediaPlayerFactory.cpp
+++ b/media/libmediaplayerservice/MediaPlayerFactory.cpp
@@ -1,4 +1,9 @@
/*
+* Copyright (C) 2014 MediaTek Inc.
+* Modification based on code covered by the mentioned copyright
+* and/or permission notice(s).
+*/
+/*
**
** Copyright 2012, The Android Open Source Project
**
@@ -33,6 +38,7 @@
#include "TestPlayerStub.h"
#include "StagefrightPlayer.h"
#include "nuplayer/NuPlayerDriver.h"
+#include "FMAudioPlayer.h"
#include <dlfcn.h>
namespace android {
@@ -387,6 +393,21 @@ class TestPlayerFactory : public MediaPlayerFactory::IFactory {
return new TestPlayerStub();
}
};
+class FMPlayerFactory : public MediaPlayerFactory::IFactory {
+ public:
+ virtual float scoreFactory(const sp<IMediaPlayer>& client,
+ const char* url,
+ float curScore) {
+ if(strncmp(url, "THIRDPARTY://MEDIAPLAYER_PLAYERTYPE_FM", 38) == 0)
+ return 1.0;
+ return 0.0;
+ }
+
+ virtual sp<MediaPlayerBase> createPlayer() {
+ return new FMAudioPlayer();
+ return NULL;
+ }
+};
void MediaPlayerFactory::registerBuiltinFactories() {
Mutex::Autolock lock_(&sLock);
@@ -398,6 +419,7 @@ void MediaPlayerFactory::registerBuiltinFactories() {
registerFactory_l(new NuPlayerFactory(), NU_PLAYER);
registerFactory_l(new SonivoxPlayerFactory(), SONIVOX_PLAYER);
registerFactory_l(new TestPlayerFactory(), TEST_PLAYER);
+ registerFactory_l(new FMPlayerFactory(), FM_AUDIO_PLAYER);
const char* FACTORY_LIB = "libdashplayer.so";
const char* FACTORY_CREATE_FN = "CreateDASHFactory";
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 0c9b646..4d89d05 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -1,4 +1,9 @@
/*
+* Copyright (C) 2014 MediaTek Inc.
+* Modification based on code covered by the mentioned copyright
+* and/or permission notice(s).
+*/
+/*
** Copyright (c) 2011-2013, The Linux Foundation. All rights reserved.
** Not a Contribution.
** Copyright 2007, The Android Open Source Project
@@ -1151,6 +1156,19 @@ status_t AudioFlinger::setStreamVolume(audio_stream_type_t stream, float value,
thread->setStreamVolume(stream, value);
}
+ // change by hochi for fm volume
+ if(stream == AUDIO_STREAM_MUSIC)
+ {
+ sp<ThreadBase> thread;
+ thread = checkPlaybackThread_l(output);
+ if (thread == primaryPlaybackThread_l())
+ {
+ //MTK_ALOG_D("setStreamVolume FM value = %f",value);
+ audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
+ dev->set_parameters (dev,String8::format("SetFmVolume=%f",value));
+ }
+ }
+
return NO_ERROR;
}
@@ -1165,6 +1183,12 @@ status_t AudioFlinger::setStreamMute(audio_stream_type_t stream, bool muted)
if (status != NO_ERROR) {
return status;
}
+ if(stream == AUDIO_STREAM_MUSIC)
+ {
+ //MTK_ALOG_D("setStreamMute MATV muted=%d",muted);
+ audio_hw_device_t *dev = mPrimaryHardwareDev->hwDevice();
+ dev->set_parameters (dev,String8::format("SetMatvMute=%d",muted));
+ }
ALOG_ASSERT(stream != AUDIO_STREAM_PATCH, "attempt to mute AUDIO_STREAM_PATCH");
if (uint32_t(stream) == AUDIO_STREAM_ENFORCED_AUDIBLE) {