audioflinger相关类图
2016-05-10 15:14:44 21 举报
AudioFlinger是Android系统中负责音频管理的模块,它通过与硬件抽象层(HAL)和上层应用程序的交互,实现了音频设备的初始化、配置和控制。在类图中,AudioFlinger主要包括以下几个关键类:AudioPolicyManager、AudioMixer、AudioTrack、RecordThread等。其中,AudioPolicyManager负责管理音频策略,如音量、静音等;AudioMixer用于处理音频混合和路由;AudioTrack负责音频播放;RecordThread则负责录音功能。这些类之间通过回调函数和消息队列进行通信,共同完成音频处理任务。
作者其他创作
大纲/内容
ToneGenerator
startTone(); stopTone();getSessionId(); bool initAudioTrack();bool prepareWave(); void clearWaveGens();
AudioFlinger::RecordHandle(: public android::BnAudioRecord)
sp mRecordTrack;
stop_nonvirtual();start(); stop();
NBAIO_Port(: public RefBase)
bool mNegotiated; size_t mFrameSize;NBAIO_Format mFormat;
ssize_t negotiate();NBAIO_Format format();
TimedAudioTrack(: public AudioTrack)
status_t allocateTimedBuffer();status_t queueTimedBuffer();status_t setMediaTimeTransform();
AudioFlinger::AudioHwDevice
audio_module_handle_t mHandle;char* mModuleName;audio_hw_device_t * mHwDevice;
bool canSetMasterVolume();handle(); hwDevice();
AudioTrack(: public RefBase)
set(); latency(); start(); stop(); flush(); createTrack_l(); getTimestamp(); setSampleRate(); setLoop();reload(); getOutput();obtainBuffer(); releaseBuffer();
char * getServiceName(); status_t setPhoneState();audio_io_handle_t getOutput(); status_t getOutputForAttr();status_t startOutput(); initStreamVolume();
NBAIO_Sink(: public NBAIO_Port)
size_t mFramesWritten;
size_t framesWritten(); framesUnderrun();availableToWrite(); write(); WriteVia();
RecordThread(: public ThreadBase)
createRecordTrack_l(); start(); stop(); audioConfigChanged(); createAudioPath_l();addPatchRecord(); hasAudioSession();setSyncEvent(); frameCount(); inputStandBy();
AudioFlinger::TrackHandle(: public android::BnAudioTrack)
sp mTrack;
sp getCblk();start(); stop(); flush(); signal();
sp mSharedBuffer; bool mResetDone; audio_stream_type_t mStreamType;int16_t *mMainBuffer; int32_t *mAuxBuffer;AudioTrackServerProxy* mAudioTrackServerProxy;AudioTimestamp mPreviousTimestamp;
status_t start(); void pause(); uint32_t sampleRate();void setAuxBuffer(); void signal();
AudioFlinger::RecordThread(: public ThreadBase)
removeTrack_l(); initCheck(); readOnlyHeap();pipeMemory(); createRecordTrack_l(); start(); stop();audioConfigChanged(); createAudioPatch_l();addEffectChain_l(); hasAudioSession();
audio_track_cblk_t(AudioTrackShared.h)
NBAIO_Format
unsigned mSampleRate;unsigned mChannelCount;audio_format_t mFormat;size_t mFrameSize;
audio_hw_device_t (audio.h中audio_hw_device)
AudioCommand(: public RefBase)
int mCommand; nsecs_t mTime;status_t mStatus; sp mParam;
AudioTrack::AudioTrackThread(: public Thread)
Mutex mMyLock; Condition mMyCond;bool mPaused; nsecs_t mPausedNs;
requestExit();pause(); resume(); threadLoop();
PlaybackThread(: public ThreadBase)
mixer_state prepareTracks_l();writeCallback(); shouldStandby_l(); initCheck(); setStreamVolume();audioCOnfigChanged(); addPatchTrack(); suspendSleepTimeUs();usesHwAvSync(); broadcast_l();
AudioBufferProvider::Buffer
union { void * raw; short* i16; int8_t* i8;}size_t frameCount;
PlaybackThread::OutputTrack(: public Track)
vector mBufferQueue;AudioBufferProvider::Buffer mOutBuffer;bool mActive; DuplicatingThread* mSourceThread;AudioTrackClientProxy* mClientProxy;
start();stop();write();isActive();
AudioCommandThread(: public Thread)
Mutex mLock;Condition mWaitWorkCV;Vector sp mAudioCommands;ToneGenerator *mpToneGenerator; sp mLastCommand;wp mService;
startToneCommand(); status_t volumeCommand();stopOutputCommand(); sendCommand();
AudioFlinger::NotificationClient(: public IBinder::DeathRecipient)
sp mAudioFlinger;pid_t mPid;sp mAudioFlingerClient;
sp audioFlingerClient();void binderDied();
MemoryDealer( : public RefBase)
sp mHeap;SimpleBestFitAllocator * mAllocator;
virtual sp allocate();sp getMemoryHeap();
FastCapture( : public FastThread)
static FastCaptureState initial; FastCaptureState preIdle;NBAIO_Source *inputSource; int inputSourceGen;NBAIO_Sink *pipeSink; FastCaptureDumpState dummyDumpState;
FastThreadState *poll();void onIdle();void OnExit(); onWork();FastCaptureStateQueue* sq();
static char* getServiceName();virtual sp createTrack();virtual sp openRecord();sampleRate(); latency(); openOutput(); openInput(); setVoiceVolume(); setMode(); registerClient(); createEffect();
AudioResampler
AudioResampler* creat(); void init();void setSampleRate(); setVolume();setPTS();
AudioFlinger::Client(: public RefBase)
const sp mAudioFlinger;const sp mMemoryDealer;const pid_t mPid; Mutex mTimedTrackLock;int mTimedTrackCount;
sp heap();sp audioFlinger();pid_t pid();
AudioTrackClientProxy(: public ClientProxy)
void setSendLevel(); void setVolumeLR();void setSampleRate(); flush();bool clearStreamEndDone();getStreamEndDone();
NBAIO_Source(: public NBAIO_Port)
size_t framesRead(); framesOverrun();availableToRead(); read(); ReadVia();
AudioPolicyClient(: public AudioPolicyClientInferface)
AudioPolicyService *mAudioPolicyService;
loadHwModule(); openOutput(); openDuplicateOutput();closeOutput(); openInput(); setStreamVolume();startTone(); stopTone(); moveEffects();
audio_offload_info_t(Audio.h)
uint16_t version; uint16_t size; uint32_t sample_rate; audio_channel_mask_t channel_mask; audio_format_t format; audio_stream_type_t stream_type; uint32_t bit_rate; int64_t duration_us; bool has_video; bool is_streaming;
WaveGenerator
void getSamples();
AudioStreamIn
AudioHwDevice* audioHwDev;audio_stream_in_t* stream;
audio_hw_device_t* hwDev();
AudioFlinger::RecordTrack(: public TrackBase)
start(); stop(); destroy();clearOverflow(); clearOverflow();setOverflow();
0 条评论
下一页