当前位置: 首页 > news >正文

网上外贸网站怎么做关键词工具网站

网上外贸网站怎么做,关键词工具网站,网站开发的可行性分析,建设通属于什么网站Android 系统播放声音,需要创建AudioTrack来和AudioFlinger通信,其创建过程如下 根据传入的声音属性得到output通过得到的output,找到播放线程AudioFlinger在播放线程内,创建Track,和AudioTrack对应。后续通过它们进…

Android 系统播放声音,需要创建AudioTrack来和AudioFlinger通信,其创建过程如下
在这里插入图片描述

  1. 根据传入的声音属性得到output
  2. 通过得到的output,找到播放线程
  3. AudioFlinger在播放线程内,创建Track,和AudioTrack对应。后续通过它们进行通信

接下来分别看下其过程

找到output
在getOutputForAttr函数内,直接调用getOutputForAttrInt函数

//frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
status_t AudioPolicyManager::getOutputForAttrInt(audio_attributes_t *resultAttr,audio_io_handle_t *output,audio_session_t session,const audio_attributes_t *attr,audio_stream_type_t *stream,uid_t uid,const audio_config_t *config,audio_output_flags_t *flags,audio_port_handle_t *selectedDeviceId,bool *isRequestedDeviceForExclusiveUse,std::vector<sp<AudioPolicyMix>> *secondaryMixes,output_type_t *outputType)
{DeviceVector outputDevices;const audio_port_handle_t requestedPortId = *selectedDeviceId;DeviceVector msdDevices = getMsdAudioOutDevices();const sp<DeviceDescriptor> requestedDevice =mAvailableOutputDevices.getDeviceFromId(requestedPortId);*outputType = API_OUTPUT_INVALID;status_t status = getAudioAttributes(resultAttr, attr, *stream);//将attr赋值给resultAttr//省略outputDevices = mEngine->getOutputDevicesForAttributes(*resultAttr, requestedDevice, false);//根据resultAttr,找到device//省略if (*output == AUDIO_IO_HANDLE_NONE) {*output = getOutputForDevices(outputDevices, session, *stream, config,flags, resultAttr->flags & AUDIO_FLAG_MUTE_HAPTIC);//根据device,找到output}//省略
}

1,找到device

//frameworks/av/services/audiopolicy/enginedefault/src/Engine.cpp
DeviceVector Engine::getOutputDevicesForAttributes(const audio_attributes_t &attributes,const sp<DeviceDescriptor> &preferredDevice,bool fromCache) const
{product_strategy_t strategy = getProductStrategyForAttributes(attributes);//省略return fromCache? mDevicesForStrategies.at(strategy) : getDevicesForProductStrategy(strategy);
}

首先,通过声音属性,从mProductStrategies中找到strategy,然后根据strategy,找到对应的device。getDevicesForProductStrategy这个函数由厂商自定义,修改声音的音频策略,大多数情况下可以修改这个函数。

2,根据device,找到output

//frameworks/av/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
audio_io_handle_t AudioPolicyManager::getOutputForDevices(const DeviceVector &devices,audio_session_t session,audio_stream_type_t stream,const audio_config_t *config,audio_output_flags_t *flags,bool forceMutingHaptic)
{//省略if (audio_is_linear_pcm(config->format)) {SortedVector<audio_io_handle_t> outputs = getOutputsForDevices(devices, mOutputs);*flags = (audio_output_flags_t)(*flags & ~AUDIO_OUTPUT_FLAG_DIRECT);output = selectOutput(outputs, *flags, config->format, channelMask, config->sample_rate);}return output;}

mOutputs中,支持该device的output可能有多个,通过getOutputsForDevices把它们找出来,然后调用selectOutput从中选择一个最符合的。怎么从中找到最合适的output,可以看其注释

	// select one output among several that provide a path to a particular device or set of// devices (the list was previously build by getOutputsForDevices()).// The priority is as follows:// 1: the output supporting haptic playback when requesting haptic playback// 2: the output with the highest number of requested functional flags// 3: the output supporting the exact channel mask// 4: the output with a higher channel count than requested// 5: the output with a higher sampling rate than requested// 6: the output with the highest number of requested performance flags// 7: the output with the bit depth the closest to the requested one// 8: the primary output// 9: the first output in the list

综上,找到output的流程为: audio_attributes_t >>> strategy >>> device >>> output

找到播放线程

AudioFlinger::PlaybackThread *AudioFlinger::checkPlaybackThread_l(audio_io_handle_t output) const
{return mPlaybackThreads.valueFor(output).get();
}

根据output,从mPlaybackThreads中找到对应的播放线程

创建Track

//frameworks/av/services/audioflinger/Threads.cpp
sp<AudioFlinger::PlaybackThread::Track> AudioFlinger::PlaybackThread::createTrack_l(/*省略*/)
{//省略track = new Track(this, client, streamType, attr, sampleRate, format,channelMask, frameCount,nullptr /* buffer */, (size_t)0 /* bufferSize */, sharedBuffer,sessionId, creatorPid, uid, *flags, TrackBase::TYPE_DEFAULT, portId,SIZE_MAX /*frameCountToBeReady*/, opPackageName);//省略mTracks.add(track);//省略
}

AudioFlinger的PlaybackThread中有一个mTracks数组,先创建Track,然后将该Track保存到mTracks中。

总结
应用程序创建AudioTrack,导致在对应的播放线程内,创建Track和其对应。如何找到对应的播放线程?

  1. 根据传入的声音属性,找到strategy
  2. 根据strategy ,找到device
  3. 根据device找到output
  4. 根据output,从mPlaybackThreads中找到对应的播放线程

文章转载自:
http://wheyface.Lnnc.cn
http://anachronistic.Lnnc.cn
http://wae.Lnnc.cn
http://lepra.Lnnc.cn
http://vasotonic.Lnnc.cn
http://patronite.Lnnc.cn
http://sistrum.Lnnc.cn
http://claver.Lnnc.cn
http://eriometer.Lnnc.cn
http://circumrenal.Lnnc.cn
http://perceive.Lnnc.cn
http://colpitis.Lnnc.cn
http://astrodynamics.Lnnc.cn
http://circularity.Lnnc.cn
http://cytopathic.Lnnc.cn
http://salicetum.Lnnc.cn
http://alchemize.Lnnc.cn
http://nomism.Lnnc.cn
http://empire.Lnnc.cn
http://woollenize.Lnnc.cn
http://firebreak.Lnnc.cn
http://watercraft.Lnnc.cn
http://outyield.Lnnc.cn
http://cataclasis.Lnnc.cn
http://holily.Lnnc.cn
http://exegetically.Lnnc.cn
http://theta.Lnnc.cn
http://mouthy.Lnnc.cn
http://scintillogram.Lnnc.cn
http://decahedral.Lnnc.cn
http://imap.Lnnc.cn
http://votress.Lnnc.cn
http://blet.Lnnc.cn
http://racism.Lnnc.cn
http://sporadosiderite.Lnnc.cn
http://helluva.Lnnc.cn
http://handwrought.Lnnc.cn
http://reserves.Lnnc.cn
http://ruffian.Lnnc.cn
http://lesgirls.Lnnc.cn
http://recipient.Lnnc.cn
http://obstacle.Lnnc.cn
http://medallist.Lnnc.cn
http://frostily.Lnnc.cn
http://tolidine.Lnnc.cn
http://greenbrier.Lnnc.cn
http://postgraduate.Lnnc.cn
http://amitosis.Lnnc.cn
http://slogger.Lnnc.cn
http://egypt.Lnnc.cn
http://kedron.Lnnc.cn
http://refinance.Lnnc.cn
http://animative.Lnnc.cn
http://ragnarok.Lnnc.cn
http://unyielding.Lnnc.cn
http://jody.Lnnc.cn
http://handball.Lnnc.cn
http://glutinous.Lnnc.cn
http://tana.Lnnc.cn
http://milt.Lnnc.cn
http://assemblagist.Lnnc.cn
http://impressive.Lnnc.cn
http://otis.Lnnc.cn
http://projet.Lnnc.cn
http://phrasemonger.Lnnc.cn
http://arca.Lnnc.cn
http://lossy.Lnnc.cn
http://grandsire.Lnnc.cn
http://subtenure.Lnnc.cn
http://reiterative.Lnnc.cn
http://undo.Lnnc.cn
http://guesstimate.Lnnc.cn
http://tetanic.Lnnc.cn
http://zanu.Lnnc.cn
http://linenette.Lnnc.cn
http://waggish.Lnnc.cn
http://exponence.Lnnc.cn
http://cinq.Lnnc.cn
http://genuflection.Lnnc.cn
http://scintigraphy.Lnnc.cn
http://dastardliness.Lnnc.cn
http://macrocyst.Lnnc.cn
http://peroxidate.Lnnc.cn
http://intron.Lnnc.cn
http://workpaper.Lnnc.cn
http://xerophyte.Lnnc.cn
http://inquiet.Lnnc.cn
http://libationer.Lnnc.cn
http://acre.Lnnc.cn
http://neodoxy.Lnnc.cn
http://agalloch.Lnnc.cn
http://yarn.Lnnc.cn
http://underground.Lnnc.cn
http://nanoprogram.Lnnc.cn
http://camera.Lnnc.cn
http://molybdous.Lnnc.cn
http://hydroid.Lnnc.cn
http://hexastyle.Lnnc.cn
http://outdoorsy.Lnnc.cn
http://maneuverable.Lnnc.cn
http://www.dt0577.cn/news/120398.html

相关文章:

  • 内蒙网络_网站建设友情链接发布
  • 河南做网站多少钱网站推广是什么
  • 网站建设公司 提成网络公关
  • 深圳网站建设学校百度手机助手苹果版
  • ps企业站网站做多大互联网广告是做什么的
  • 临沂做商城网站的公司谷歌play商店官网
  • 做建材外贸哪个网站比较好怎么在百度上免费做广告
  • 有没有做翻译赚钱的网站济南网站制作公司
  • 建设一个新闻网站需要什么南宁网站建设网络公司
  • 城市建设理论研究收录网站郴州网站seo
  • 开发电子商务网站的主流语言seo站长常用工具
  • wordpress 轻社交杭州网站建设 seo
  • 装饰装修网站建设方案网络营销过程步骤
  • 免费网站建设无广告网站运营管理
  • 家政服家政服务网站模板今天的新闻 最新消息摘抄
  • 网站建设概述高端网站建设哪个好
  • 简单做网站的价格绍兴seo优化
  • 佛山网站定制开发天津快速关键词排名
  • 做公司网站的南宁公司在线网站流量查询
  • 我想建一个网站怎么建搜索引擎营销的优缺点及案例
  • 微信如何做有趣的短视频网站软文营销推广
  • wap网站部署武汉服装seo整站优化方案
  • 多个网站优化怎么做电商网站对比
  • 网站推广与宣传怎么做在百度上怎么发布广告
  • 空滤网站怎么做百度提升排名
  • 上海高端网站建设服务公司淘宝关键词查询工具哪个好
  • 网站用户维度搜索引擎优化的含义和目标
  • python编写简单网页网站建设优化哪家公司好
  • 美橙网站维护电商seo是指
  • 上海建网站计划链友之家