From d9d7fa0873796ac661c44a7fcd6ad5ff697ff01f Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 24 Jun 2014 08:01:46 -0700 Subject: Support for audio attributes on audio output of media player Change-Id: Iae4995c98e64add1ab9e6c8ae6501515032755f5 --- include/media/AudioTrack.h | 8 +++++--- include/media/mediaplayer.h | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h index 3492520..a3cc396 100644 --- a/include/media/AudioTrack.h +++ b/include/media/AudioTrack.h @@ -188,7 +188,8 @@ public: transfer_type transferType = TRANSFER_DEFAULT, const audio_offload_info_t *offloadInfo = NULL, int uid = -1, - pid_t pid = -1); + pid_t pid = -1, + const audio_attributes_t* pAttributes = NULL); /* Creates an audio track and registers it with AudioFlinger. * With this constructor, the track is configured for static buffer mode. @@ -214,7 +215,8 @@ public: transfer_type transferType = TRANSFER_DEFAULT, const audio_offload_info_t *offloadInfo = NULL, int uid = -1, - pid_t pid = -1); + pid_t pid = -1, + const audio_attributes_t* pAttributes = NULL); /* Terminates the AudioTrack and unregisters it from AudioFlinger. * Also destroys all resources associated with the AudioTrack. @@ -254,7 +256,7 @@ public: const audio_offload_info_t *offloadInfo = NULL, int uid = -1, pid_t pid = -1, - audio_attributes_t* pAttributes = NULL); + const audio_attributes_t* pAttributes = NULL); /* Result of constructing the AudioTrack. This must be checked for successful initialization * before using any AudioTrack API (except for set()), because using diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index 3ca3095..e756368 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -160,6 +160,9 @@ enum media_parameter_keys { // Playback rate expressed in permille (1000 is normal speed), saved as int32_t, with negative // values used for rewinding or reverse playback. KEY_PARAMETER_PLAYBACK_RATE_PERMILLE = 1300, // set only + + // Set a Parcel containing the value of a parcelled Java AudioAttribute instance + KEY_PARAMETER_AUDIO_ATTRIBUTES = 1400 // set only }; // Keep INVOKE_ID_* in sync with MediaPlayer.java. @@ -169,7 +172,7 @@ enum media_player_invoke_ids { INVOKE_ID_ADD_EXTERNAL_SOURCE_FD = 3, INVOKE_ID_SELECT_TRACK = 4, INVOKE_ID_UNSELECT_TRACK = 5, - INVOKE_ID_SET_VIDEO_SCALING_MODE = 6, + INVOKE_ID_SET_VIDEO_SCALING_MODE = 6 }; // Keep MEDIA_TRACK_TYPE_* in sync with MediaPlayer.java. @@ -259,6 +262,7 @@ private: status_t attachNewPlayer(const sp& player); status_t reset_l(); status_t doSetRetransmitEndpoint(const sp& player); + status_t checkStateForKeySet_l(int key); sp mPlayer; thread_id_t mLockThreadId; -- cgit v1.1