diff options
author | Glenn Kasten <gkasten@google.com> | 2012-04-19 09:35:04 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-04-23 16:54:41 -0700 |
commit | a636433cbd09c0708b85f337ef45c0cdef3bcb4d (patch) | |
tree | 8a629f33d648d1ddd8b79305f02763c539fef7cd /media | |
parent | 9adb12830ac2da72c91b842d24725ced6d236b16 (diff) | |
download | frameworks_av-a636433cbd09c0708b85f337ef45c0cdef3bcb4d.zip frameworks_av-a636433cbd09c0708b85f337ef45c0cdef3bcb4d.tar.gz frameworks_av-a636433cbd09c0708b85f337ef45c0cdef3bcb4d.tar.bz2 |
Use C APIs instead of C++ APIs for policy
The C++ APIs are going away.
Note: we use tid == 0 which is not supported yet by the C APIs,
do not submit this until that is added.
Change-Id: I0e90789e6c81c69f2544e899c52421ea5d1342be
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 8 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index 950f5c6..c21979b 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -79,7 +79,7 @@ status_t AudioRecord::getMinFrameCount( AudioRecord::AudioRecord() : mStatus(NO_INIT), mSessionId(0), - mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT) + mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(SP_DEFAULT) { } @@ -95,7 +95,7 @@ AudioRecord::AudioRecord( int notificationFrames, int sessionId) : mStatus(NO_INIT), mSessionId(0), - mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT) + mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(SP_DEFAULT) { mStatus = set(inputSource, sampleRate, format, channelMask, frameCount, flags, cbf, user, notificationFrames, sessionId); @@ -342,7 +342,7 @@ status_t AudioRecord::start(AudioSystem::sync_event_t event, int triggerSession) mCondition.signal(); } else { mPreviousPriority = getpriority(PRIO_PROCESS, 0); - mPreviousSchedulingGroup = androidGetThreadSchedulingGroup(0); + get_sched_policy(0, &mPreviousSchedulingGroup); androidSetThreadPriority(0, ANDROID_PRIORITY_AUDIO); } } else { @@ -374,7 +374,7 @@ status_t AudioRecord::stop() t->requestExit(); } else { setpriority(PRIO_PROCESS, 0, mPreviousPriority); - androidSetThreadSchedulingGroup(0, mPreviousSchedulingGroup); + set_sched_policy(0, mPreviousSchedulingGroup); } } diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 5d5a312..b1be8b1 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -84,7 +84,7 @@ AudioTrack::AudioTrack() : mStatus(NO_INIT), mIsTimed(false), mPreviousPriority(ANDROID_PRIORITY_NORMAL), - mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT) + mPreviousSchedulingGroup(SP_DEFAULT) { } @@ -102,7 +102,7 @@ AudioTrack::AudioTrack( : mStatus(NO_INIT), mIsTimed(false), mPreviousPriority(ANDROID_PRIORITY_NORMAL), - mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT) + mPreviousSchedulingGroup(SP_DEFAULT) { mStatus = set(streamType, sampleRate, format, channelMask, frameCount, flags, cbf, user, notificationFrames, @@ -123,7 +123,7 @@ AudioTrack::AudioTrack( int sessionId) : mStatus(NO_INIT), mIsTimed(false), - mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT) + mPreviousPriority(ANDROID_PRIORITY_NORMAL), mPreviousSchedulingGroup(SP_DEFAULT) { mStatus = set((audio_stream_type_t)streamType, sampleRate, (audio_format_t)format, channelMask, frameCount, (audio_output_flags_t)flags, cbf, user, notificationFrames, @@ -144,7 +144,7 @@ AudioTrack::AudioTrack( : mStatus(NO_INIT), mIsTimed(false), mPreviousPriority(ANDROID_PRIORITY_NORMAL), - mPreviousSchedulingGroup(ANDROID_TGROUP_DEFAULT) + mPreviousSchedulingGroup(SP_DEFAULT) { mStatus = set(streamType, sampleRate, format, channelMask, 0 /*frameCount*/, flags, cbf, user, notificationFrames, @@ -378,7 +378,7 @@ void AudioTrack::start() t->resume(); } else { mPreviousPriority = getpriority(PRIO_PROCESS, 0); - mPreviousSchedulingGroup = androidGetThreadSchedulingGroup(0); + get_sched_policy(0, &mPreviousSchedulingGroup); androidSetThreadPriority(0, ANDROID_PRIORITY_AUDIO); } @@ -403,7 +403,7 @@ void AudioTrack::start() t->pause(); } else { setpriority(PRIO_PROCESS, 0, mPreviousPriority); - androidSetThreadSchedulingGroup(0, mPreviousSchedulingGroup); + set_sched_policy(0, mPreviousSchedulingGroup); } } } @@ -436,7 +436,7 @@ void AudioTrack::stop() t->pause(); } else { setpriority(PRIO_PROCESS, 0, mPreviousPriority); - androidSetThreadSchedulingGroup(0, mPreviousSchedulingGroup); + set_sched_policy(0, mPreviousSchedulingGroup); } } |