e81531e91e
This doesn't actually create a HAL, but rather a set of helper static libraries that device specific libraries (i.e. the old libaudio pieces) can link against to create a proper audio HAL module. We provide an audio_policy static wrapper and audio hardware interface static wrapper. Change-Id: Ie56195447ad24b83888f752dca24674b0afd8a76 Signed-off-by: Dima Zavin <dima@android.com>
79 lines
3.5 KiB
C++
79 lines
3.5 KiB
C++
/*
|
|
* Copyright (C) 2011 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#ifndef ANDROID_AUDIOPOLICYCLIENTLEGACY_H
|
|
#define ANDROID_AUDIOPOLICYCLIENTLEGACY_H
|
|
|
|
#include <hardware/audio.h>
|
|
#include <hardware/audio_policy.h>
|
|
#include <hardware/audio_policy_hal.h>
|
|
|
|
#include <hardware_legacy/AudioSystemLegacy.h>
|
|
#include <hardware_legacy/AudioPolicyInterface.h>
|
|
|
|
/************************************/
|
|
/* FOR BACKWARDS COMPATIBILITY ONLY */
|
|
/************************************/
|
|
namespace android_audio_legacy {
|
|
|
|
class AudioPolicyCompatClient : public AudioPolicyClientInterface {
|
|
public:
|
|
AudioPolicyCompatClient(struct audio_policy_service_ops *serviceOps,
|
|
void *service) :
|
|
mServiceOps(serviceOps) , mService(service) {}
|
|
|
|
virtual audio_io_handle_t openOutput(uint32_t *pDevices,
|
|
uint32_t *pSamplingRate,
|
|
uint32_t *pFormat,
|
|
uint32_t *pChannels,
|
|
uint32_t *pLatencyMs,
|
|
AudioSystem::output_flags flags);
|
|
virtual audio_io_handle_t openDuplicateOutput(audio_io_handle_t output1,
|
|
audio_io_handle_t output2);
|
|
virtual status_t closeOutput(audio_io_handle_t output);
|
|
virtual status_t suspendOutput(audio_io_handle_t output);
|
|
virtual status_t restoreOutput(audio_io_handle_t output);
|
|
virtual audio_io_handle_t openInput(uint32_t *pDevices,
|
|
uint32_t *pSamplingRate,
|
|
uint32_t *pFormat,
|
|
uint32_t *pChannels,
|
|
uint32_t acoustics);
|
|
virtual status_t closeInput(audio_io_handle_t input);
|
|
virtual status_t setStreamOutput(AudioSystem::stream_type stream, audio_io_handle_t output);
|
|
virtual status_t moveEffects(int session,
|
|
audio_io_handle_t srcOutput,
|
|
audio_io_handle_t dstOutput);
|
|
|
|
virtual String8 getParameters(audio_io_handle_t ioHandle, const String8& keys);
|
|
virtual void setParameters(audio_io_handle_t ioHandle,
|
|
const String8& keyValuePairs,
|
|
int delayMs = 0);
|
|
virtual status_t setStreamVolume(AudioSystem::stream_type stream,
|
|
float volume,
|
|
audio_io_handle_t output,
|
|
int delayMs = 0);
|
|
virtual status_t startTone(ToneGenerator::tone_type tone, AudioSystem::stream_type stream);
|
|
virtual status_t stopTone();
|
|
virtual status_t setVoiceVolume(float volume, int delayMs = 0);
|
|
|
|
private:
|
|
struct audio_policy_service_ops* mServiceOps;
|
|
void* mService;
|
|
};
|
|
|
|
}; // namespace android_audio_legacy
|
|
|
|
#endif // ANDROID_AUDIOPOLICYCLIENTLEGACY_H
|