Audio PCM输出流程

1、frameworks/base/media/java/android/media/AudioManager.java
   createAudioPatch(){}
2、frameworks/base/media/java/android/media/AudioSystem.java
   public static native int createAudioPatch();
3、frameworks/base/core/jni/android_media_AudioSystem.cpp
   android_media_AudioSystem_createAudioPatch(){}
4、frameworks/av/media/libmedia/AudioSystem.cpp
   status_t AudioSystem::createAudioPatch(){}
5、frameworks/av/services/audioflinger/PatchPanel.cpp
   status_t AudioFlinger::PatchPanel::createAudioPatch()
6、frameworks/av/services/audioflinger/AudioFlinger.cpp
   sp<AudioFlinger::PlaybackThread> AudioFlinger::openOutput_l()
   {
     AudioStreamOut *outputStream = new AudioStreamOut(outHwDev, outStream, flags); 
     PlaybackThread *thread;
     thread = new DirectOutputThread(this, outputStream, *output, devices);
   }
7、frameworks/av/services/audioflinger/Threads.cpp
   ssize_t AudioFlinger::PlaybackThread::threadLoop_write()
   {
     ssize_t framesWritten = mNormalSink->write((char *)mSinkBuffer + offset, count); 
   }
8、frameworks/av/media/libnbaio/AudioStreamOutSink.cpp
   ssize_t AudioStreamOutSink::write(const void *buffer, size_t count)
   {
     ssize_t ret = mStream->write(mStream, buffer, count * mFrameSize);  
   }
9、hardware/rockchip/audio/tinyalsa_hal/audio_hw.c
   static ssize_t out_write()
   {
     ret = start_output_stream(out);
   }

   static int start_output_stream()
   {
     out->pcm[PCM_CARD] = pcm_open();
   }
10、external/tinyalsa/pcm.c
   struct pcm *pcm_open
   {
     snprintf(fn, sizeof(fn), "/dev/snd/pcmC%uD%u%c", card, device, flags & PCM_IN ? 'c' : 'p');                                                                                                                    pcm->fd = open(fn, O_RDWR);
   }
发布了720 篇原创文章 · 获赞 417 · 访问量 227万+
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 编程工作室 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览