Skip to content

Commit

Permalink
samsung: add support for tvout and yamahaplayer services
Browse files Browse the repository at this point in the history
Change-Id: I653f9876b7fb83734abf3a0b9b9b5af1920b8112
  • Loading branch information
codeworkx committed Dec 30, 2011
1 parent d56520a commit aa585a5
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmds/servicemanager/Android.mk
Expand Up @@ -12,4 +12,10 @@ LOCAL_MODULE := servicemanager
ifeq ($(BOARD_USE_LVMX),true)
LOCAL_CFLAGS += -DLVMX
endif
ifeq ($(BOARD_USE_YAMAHAPLAYER),true)
LOCAL_CFLAGS += -DYAMAHAPLAYER
endif
ifeq ($(BOARD_USE_SECTVOUT),true)
LOCAL_CFLAGS += -DSECTVOUT
endif
include $(BUILD_EXECUTABLE)
6 changes: 6 additions & 0 deletions cmds/servicemanager/service_manager.c
Expand Up @@ -34,6 +34,12 @@ static struct {
{ AID_MEDIA, "media.player" },
{ AID_MEDIA, "media.camera" },
{ AID_MEDIA, "media.audio_policy" },
#ifdef YAMAHAPLAYER
{ AID_MEDIA, "media.yamahaplayer" },
#endif
#ifdef SECTVOUT
{ AID_MEDIA, "SecTVOutService" },
#endif
{ AID_DRM, "drm.drmManager" },
{ AID_NFC, "nfc" },
{ AID_RADIO, "radio.phone" },
Expand Down
4 changes: 4 additions & 0 deletions media/libmedia/Android.mk
Expand Up @@ -56,6 +56,10 @@ ifeq ($(BOARD_USES_AUDIO_LEGACY),true)
endif
endif

ifeq ($(BOARD_USE_YAMAHAPLAYER),true)
LOCAL_CFLAGS += -DYAMAHAPLAYER
endif

LOCAL_SHARED_LIBRARIES := \
libui libcutils libutils libbinder libsonivox libicuuc libexpat \
libcamera_client libstagefright_foundation \
Expand Down
20 changes: 20 additions & 0 deletions media/libmedia/AudioSystem.cpp
Expand Up @@ -810,5 +810,25 @@ extern "C" bool _ZN7android11AudioSystem15isLowVisibilityENS0_11stream_typeE(aud

#endif // AUDIO_LEGACY

#ifdef YAMAHAPLAYER
extern "C" bool _ZN7android11AudioSystem17isSeparatedStreamE19audio_stream_type_t(audio_stream_type_t stream)
{
LOGD("android::AudioSystem::isSeparatedStream(audio_stream_type_t) called!");
LOGD("audio_stream_type_t: %d", stream);

/* this is the correct implementation, but breaks headset volume rocker.
if (stream == 3 || stream == 9 || stream == 10
|| stream == 12 || stream == 13 || stream == 14)
{
LOGD("isSeparatedStream: true");
return true;
}
*/

LOGD("isSeparatedStream: false");
return false;
}
#endif // YAMAHAPLAYER

}; // namespace android

10 changes: 10 additions & 0 deletions media/mediaserver/Android.mk
Expand Up @@ -11,6 +11,16 @@ LOCAL_SHARED_LIBRARIES := \
libutils \
libbinder

ifeq ($(BOARD_USE_YAMAHAPLAYER),true)
LOCAL_CFLAGS += -DYAMAHAPLAYER
LOCAL_SHARED_LIBRARIES += libmediayamahaservice
endif

ifeq ($(BOARD_USE_SECTVOUT),true)
LOCAL_CFLAGS += -DSECTVOUT
LOCAL_SHARED_LIBRARIES += libTVOut
endif

base := $(LOCAL_PATH)/../..

LOCAL_C_INCLUDES := \
Expand Down
18 changes: 18 additions & 0 deletions media/mediaserver/main_mediaserver.cpp
Expand Up @@ -33,11 +33,29 @@

using namespace android;

#ifdef YAMAHAPLAYER
namespace android { namespace yamaha { namespace media {
void InstantiateService(void);
} } }
#endif

#ifdef SECTVOUT
namespace android { namespace SecTVOutService {
void instantiate(void);
} }
#endif

int main(int argc, char** argv)
{
sp<ProcessState> proc(ProcessState::self());
sp<IServiceManager> sm = defaultServiceManager();
LOGI("ServiceManager: %p", sm.get());
#ifdef YAMAHAPLAYER
yamaha::media::InstantiateService();
#endif
#ifdef SECTVOUT
SecTVOutService::instantiate();
#endif
AudioFlinger::instantiate();
MediaPlayerService::instantiate();
CameraService::instantiate();
Expand Down

0 comments on commit aa585a5

Please sign in to comment.