MediaPlayer changes for Tungsten/Android@Home.
Squashed merge from master-tungsten of the following changes: commit e8b156c6b224f0fe5b6a81d5f92bade36275027c Author: Jason Simmons <jsimmons@google.com> Date: Fri Aug 12 10:28:48 2011 -0700 Add a null check to handle failure of android::createPlayer Change-Id: Iacbbc90369a825838d4374b1f774c8880b25753b commit 43be3231034ff8537fdd84422a7954780038671f Author: John Grossman <johngro@google.com> Date: Mon Jun 27 18:59:12 2011 -0700 Move libaah_rtp over from the vendor directory. Also move factor PipeEvent out into utils. Change-Id: Id3877c66efe22d771cf3ef4877107e431b828e37 commit 17526eb3148c9c3d4365b6d5b47e8dc13bca71b6 Author: John Grossman <johngro@google.com> Date: Mon Jun 27 17:06:49 2011 -0700 Name changes for the TRTP Players s/tungsten/aah/g Change-Id: I55e9ad13003f6aa6a36955b54426a7efbe31ac51 commit cbf2903ab6893b6e662514e2f6d670e268a419df Author: John Grossman <johngro@google.com> Date: Fri Apr 15 09:27:54 2011 -0700 Migrate Tungsten code from the HC-Tungsten to the Master-Tungsten branch. Change-Id: I95372d913a0761d90168edb4016f5ece0ea74502 Change-Id: I73f3be191cd974933acddf52892e5600d253cc03 Signed-off-by: Mike J. Chen <mjchen@google.com> Signed-off-by: John Grossman <johngro@google.com>
This commit is contained in:
committed by
Mike Lockwood
parent
06e04e4c17
commit
c15a71e59a
@@ -69,6 +69,11 @@
|
||||
|
||||
#include <OMX.h>
|
||||
|
||||
namespace android {
|
||||
sp<MediaPlayerBase> createAAH_TXPlayer();
|
||||
sp<MediaPlayerBase> createAAH_RXPlayer();
|
||||
}
|
||||
|
||||
namespace {
|
||||
using android::media::Metadata;
|
||||
using android::status_t;
|
||||
@@ -590,6 +595,14 @@ player_type getPlayerType(const char* url)
|
||||
return NU_PLAYER;
|
||||
}
|
||||
|
||||
if (!strncasecmp("aahRX://", url, 8)) {
|
||||
return AAH_RX_PLAYER;
|
||||
}
|
||||
|
||||
if (!strncasecmp("aahTX://", url, 8)) {
|
||||
return AAH_TX_PLAYER;
|
||||
}
|
||||
|
||||
// use MidiFile for MIDI extensions
|
||||
int lenURL = strlen(url);
|
||||
for (int i = 0; i < NELEM(FILE_EXTS); ++i) {
|
||||
@@ -626,6 +639,14 @@ static sp<MediaPlayerBase> createPlayer(player_type playerType, void* cookie,
|
||||
LOGV("Create Test Player stub");
|
||||
p = new TestPlayerStub();
|
||||
break;
|
||||
case AAH_RX_PLAYER:
|
||||
LOGV(" create A@H RX Player");
|
||||
p = createAAH_RXPlayer();
|
||||
break;
|
||||
case AAH_TX_PLAYER:
|
||||
LOGV(" create A@H TX Player");
|
||||
p = createAAH_TXPlayer();
|
||||
break;
|
||||
default:
|
||||
LOGE("Unknown player type: %d", playerType);
|
||||
return NULL;
|
||||
@@ -982,9 +1003,21 @@ status_t MediaPlayerService::Client::setLooping(int loop)
|
||||
status_t MediaPlayerService::Client::setVolume(float leftVolume, float rightVolume)
|
||||
{
|
||||
LOGV("[%d] setVolume(%f, %f)", mConnId, leftVolume, rightVolume);
|
||||
// TODO: for hardware output, call player instead
|
||||
Mutex::Autolock l(mLock);
|
||||
if (mAudioOutput != 0) mAudioOutput->setVolume(leftVolume, rightVolume);
|
||||
|
||||
// for hardware output, call player instead
|
||||
sp<MediaPlayerBase> p = getPlayer();
|
||||
{
|
||||
Mutex::Autolock l(mLock);
|
||||
if (p != 0 && p->hardwareOutput()) {
|
||||
MediaPlayerHWInterface* hwp =
|
||||
reinterpret_cast<MediaPlayerHWInterface*>(p.get());
|
||||
return hwp->setVolume(leftVolume, rightVolume);
|
||||
} else {
|
||||
if (mAudioOutput != 0) mAudioOutput->setVolume(leftVolume, rightVolume);
|
||||
return NO_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user