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

盐城哪有做网站建设的英文网站建站模板

盐城哪有做网站建设的,英文网站建站模板,郑州企业建筑资质多少钱,建筑证书查询开篇前瞎扯。很久没发技术文章了#xff0c;此文一直放着草稿箱没有完成#xff0c;感觉自己在家庭和工作中找到了拖延的借口#xff0c;开始慢慢变得懒惰了#xff0c;那是万万不行的。恰逢2023开年ChatGPT的爆火#xff0c;更让我这些普通程序员危机感瞬间飙升#xff…开篇前瞎扯。很久没发技术文章了此文一直放着草稿箱没有完成感觉自己在家庭和工作中找到了拖延的借口开始慢慢变得懒惰了那是万万不行的。恰逢2023开年ChatGPT的爆火更让我这些普通程序员危机感瞬间飙升无限感受到自己的知识储备已经跟不上时代的节奏了。所以还是继续学习吧活到老学到老。 还记得系列开篇的这张流程分析图嚒不知不觉已经基本分析全了PeerConnectionFactory之上的内容。有兴趣需要补课的同学follow这个专栏。 现在把目光回归到PeerConnectionFactory这个关键节点拆解中心环节继续向深进发。 从java层接口出发很容易就找到源码.\sdk\android\src\jni\pc\peer_connection_factory.cc文件中的函数JNI_PeerConnectionFactory_CreatePeerConnectionFactory最终调用CreatePeerConnectionFactoryForJava一起看看代码内容。 // .\sdk\android\src\jni\pc\peer_connection_factory.cc文件中的 // 函数JNI_PeerConnectionFactory_CreatePeerConnectionFactory - CreatePeerConnectionFactoryForJava //为了节省篇幅函数内部很多RTC_CHECK省去了。 ScopedJavaLocalRefjobject CreatePeerConnectionFactoryForJava(JNIEnv* jni,const JavaParamRefjobject jcontext,const JavaParamRefjobject joptions,// 节省篇幅入参列表简化如下。// |audio_device_module|, |jencoder_factory|, |jdecoder_factory|,// |audio_processor|, |fec_controller_factory|,// |network_state_predictor_factory|, |neteq_factory|.) {// 1、创建三类工作线程std::unique_ptrrtc::Thread network_thread rtc::Thread::CreateWithSocketServer();network_thread-SetName(network_thread, nullptr);std::unique_ptrrtc::Thread worker_thread rtc::Thread::Create();worker_thread-SetName(worker_thread, nullptr);std::unique_ptrrtc::Thread signaling_thread rtc::Thread::Create();signaling_thread-SetName(signaling_thread, NULL);const absl::optionalPeerConnectionFactoryInterface::Options options JavaToNativePeerConnectionFactoryOptions(jni, joptions);// 2、创建PeerConnectionFactoryDependencies PeerConnectionFactoryDependencies dependencies;dependencies.network_thread network_thread.get();dependencies.worker_thread worker_thread.get();dependencies.signaling_thread signaling_thread.get();dependencies.task_queue_factory CreateDefaultTaskQueueFactory();dependencies.call_factory CreateCallFactory();dependencies.event_log_factory std::make_uniqueRtcEventLogFactory(dependencies.task_queue_factory.get());dependencies.fec_controller_factory std::move(fec_controller_factory);dependencies.network_controller_factory std::move(network_controller_factory);dependencies.network_state_predictor_factory std::move(network_state_predictor_factory);dependencies.neteq_factory std::move(neteq_factory);if (!(options options-disable_network_monitor)) {dependencies.network_monitor_factory std::make_uniqueAndroidNetworkMonitorFactory();}// 3、创建PeerConnectionFactoryDependencies所需的MediaEngineDependencies cricket::MediaEngineDependencies media_dependencies;media_dependencies.task_queue_factory dependencies.task_queue_factory.get();media_dependencies.adm std::move(audio_device_module);media_dependencies.audio_encoder_factory std::move(audio_encoder_factory);media_dependencies.audio_decoder_factory std::move(audio_decoder_factory);media_dependencies.audio_processing std::move(audio_processor);media_dependencies.video_encoder_factory absl::WrapUnique(CreateVideoEncoderFactory(jni, jencoder_factory));media_dependencies.video_decoder_factory absl::WrapUnique(CreateVideoDecoderFactory(jni, jdecoder_factory));dependencies.media_engine cricket::CreateMediaEngine(std::move(media_dependencies));// 4、通过PeerConnectionFactoryDependencies创建CreateModularPeerConnectionFactoryrtc::scoped_refptrPeerConnectionFactoryInterface factory CreateModularPeerConnectionFactory(std::move(dependencies));if (options)factory-SetOptions(*options);return NativeToScopedJavaPeerConnectionFactory(jni, factory, std::move(network_thread), std::move(worker_thread),std::move(signaling_thread)); } 函数内容有点多不过总结起来其实就几个部分 1、创建三类内部组件network_thread/worker_thread/signaling_thread虽然他们都是rtc::Thread虽然命名是线程但其实不是我们所了解的线程反而有点类似Android Handler包含着消息队列和内部执行循环。 2、创建PeerConnectionFactoryDependencies其中需要关注几个关键量 call_factoryp2p链接 / fec_controller_factory丢包纠错 / network_state_predictor_factory网络带宽预测/ media_dependencies媒体相关 以上几个都是webrtc的重点难点都是需要开坑逐一分析学习。 3、创建PeerConnectionFactoryDependencies所依赖的MediaEngineDependenciesMediaEngineDependencies的入参就是之前分析过的几个video/audio-encoder/decoder factory 4、最后就是根据PeerConnectionFactoryDependencies创建集大成的PeerConnectionFactory。 一图概述就是这样 继续往下看看CreateModularPeerConnectionFactory的内容 rtc::scoped_refptrPeerConnectionFactoryInterface CreateModularPeerConnectionFactory(PeerConnectionFactoryDependencies dependencies) {// The PeerConnectionFactory must be created on the signaling thread.if (dependencies.signaling_thread !dependencies.signaling_thread-IsCurrent()) {return dependencies.signaling_thread-Invokertc::scoped_refptrPeerConnectionFactoryInterface(RTC_FROM_HERE, [dependencies] {return CreateModularPeerConnectionFactory(std::move(dependencies));});}auto pc_factory PeerConnectionFactory::Create(std::move(dependencies));if (!pc_factory) {return nullptr;}// Verify that the invocation and the initialization ended up agreeing on the// thread.RTC_DCHECK_RUN_ON(pc_factory-signaling_thread());return PeerConnectionFactoryProxy::Create(pc_factory-signaling_thread(), pc_factory-worker_thread(), pc_factory); }// Static rtc::scoped_refptrPeerConnectionFactory PeerConnectionFactory::Create(PeerConnectionFactoryDependencies dependencies) {auto context ConnectionContext::Create(dependencies);if (!context) {return nullptr;}return rtc::make_ref_countedPeerConnectionFactory(context, dependencies); } 其中PeerConnectionFactory::Create就是真正创建PeerConnectionFactory的地方其中还包含了一个ConnectionContext的创建还有一个比较难明白的地方就是CreateModularPeerConnectionFactory函数的返回PeerConnectionFactoryProxy为啥不直接使用PeerConnectionFactory 而且用普通的阅读器是跟踪不到具体的实现文件。我是用VSCode带C插件的才能跟踪到跟踪进去会发现这是一个完全由宏定义去生成的代理类。大家有空可以自己去观摩我这里就不贴代码了位置在.\api\peer_connection_factory_proxy.h。 接下来直接看看PeerConnectionFactory的头定义先大致了解其结构组成部分。 class PeerConnectionFactory : public PeerConnectionFactoryInterface {public:void SetOptions(const Options options) override;RTCErrorOrrtc::scoped_refptrPeerConnectionInterfaceCreatePeerConnectionOrError(const PeerConnectionInterface::RTCConfiguration configuration,PeerConnectionDependencies dependencies) override;RtpCapabilities GetRtpSenderCapabilities(cricket::MediaType kind) const override;RtpCapabilities GetRtpReceiverCapabilities(cricket::MediaType kind) const override;rtc::scoped_refptrMediaStreamInterface CreateLocalMediaStream(const std::string stream_id) override;rtc::scoped_refptrAudioSourceInterface CreateAudioSource(const cricket::AudioOptions options) override;rtc::scoped_refptrVideoTrackInterface CreateVideoTrack(const std::string id,VideoTrackSourceInterface* video_source) override;rtc::scoped_refptrAudioTrackInterface CreateAudioTrack(const std::string id,AudioSourceInterface* audio_source) override;bool StartAecDump(FILE* file, int64_t max_size_bytes) override;void StopAecDump() override;SctpTransportFactoryInterface* sctp_transport_factory() {return context_-sctp_transport_factory();}virtual cricket::ChannelManager* channel_manager();rtc::Thread* signaling_thread() const {// This method can be called on a different thread when the factory is// created in CreatePeerConnectionFactory().return context_-signaling_thread();}rtc::Thread* worker_thread() const { return context_-worker_thread(); }const Options options() const {RTC_DCHECK_RUN_ON(signaling_thread());return options_;}const WebRtcKeyValueConfig trials() const { return context_-trials(); }protected:virtual ~PeerConnectionFactory();private:rtc::Thread* network_thread() const { return context_-network_thread(); }bool IsTrialEnabled(absl::string_view key) const;const cricket::ChannelManager* channel_manager() const {return context_-channel_manager();}std::unique_ptrRtcEventLog CreateRtcEventLog_w();std::unique_ptrCall CreateCall_w(RtcEventLog* event_log);rtc::scoped_refptrConnectionContext context_;PeerConnectionFactoryInterface::Options options_RTC_GUARDED_BY(signaling_thread());std::unique_ptrTaskQueueFactory task_queue_factory_;std::unique_ptrRtcEventLogFactoryInterface event_log_factory_;std::unique_ptrFecControllerFactoryInterface fec_controller_factory_;std::unique_ptrNetworkStatePredictorFactoryInterfacenetwork_state_predictor_factory_;std::unique_ptrNetworkControllerFactoryInterfaceinjected_network_controller_factory_;std::unique_ptrNetEqFactory neteq_factory_; };功能性方法先不急着深入先大致拆分结构性组成部分。 1、CreatePeerConnectionOrError公开方法和CreateCall_w私有方法应该和创建PeerConnection有着密切联系。这个留着下一篇文件 创建PeerConnection分析。 2、结合CreateModularPeerConnectionFactory方法和PeerConnectionFactory的头定义文件大致可以看出ConnectionContext也是一个很重要的组成部分。 3、ChannelManager也是一个独立的组成部分。 其他也没啥了接着在快速看看ConeectionContext的结构组成。 // This class contains resources needed by PeerConnection and associated // objects. A reference to this object is passed to each PeerConnection. The // methods on this object are assumed not to change the state in any way that // interferes with the operation of other PeerConnections. // // This class must be created and destroyed on the signaling thread. class ConnectionContext final: public rtc::RefCountedNonVirtualConnectionContext {public:// Creates a ConnectionContext. May return null if initialization fails.// The Dependencies class allows simple management of all new dependencies// being added to the ConnectionContext.static rtc::scoped_refptrConnectionContext Create(PeerConnectionFactoryDependencies* dependencies);// This class is not copyable or movable.ConnectionContext(const ConnectionContext) delete;ConnectionContext operator(const ConnectionContext) delete;// Functions called from PeerConnection and friendsSctpTransportFactoryInterface* sctp_transport_factory() const {return sctp_factory_.get();}cricket::ChannelManager* channel_manager() const;rtc::Thread* signaling_thread() { return signaling_thread_; }const rtc::Thread* signaling_thread() const { return signaling_thread_; }rtc::Thread* worker_thread() { return worker_thread_; }const rtc::Thread* worker_thread() const { return worker_thread_; }rtc::Thread* network_thread() { return network_thread_; }const rtc::Thread* network_thread() const { return network_thread_; }const WebRtcKeyValueConfig trials() const { return *trials_.get(); }// Accessors only used from the PeerConnectionFactory classrtc::BasicNetworkManager* default_network_manager() {RTC_DCHECK_RUN_ON(signaling_thread_);return default_network_manager_.get();}rtc::BasicPacketSocketFactory* default_socket_factory() {RTC_DCHECK_RUN_ON(signaling_thread_);return default_socket_factory_.get();}CallFactoryInterface* call_factory() {RTC_DCHECK_RUN_ON(worker_thread_);return call_factory_.get();}private:rtc::Thread* const network_thread_;rtc::Thread* const worker_thread_;rtc::Thread* const signaling_thread_;// channel_manager is accessed both on signaling thread and worker thread.std::unique_ptrcricket::ChannelManager channel_manager_;std::unique_ptrrtc::NetworkMonitorFactory const network_monitor_factory_RTC_GUARDED_BY(signaling_thread_);std::unique_ptrrtc::BasicNetworkManager default_network_manager_RTC_GUARDED_BY(signaling_thread_);std::unique_ptrwebrtc::CallFactoryInterface const call_factory_RTC_GUARDED_BY(worker_thread_);std::unique_ptrrtc::BasicPacketSocketFactory default_socket_factory_RTC_GUARDED_BY(signaling_thread_);std::unique_ptrSctpTransportFactoryInterface const sctp_factory_;// Accessed both on signaling thread and worker thread.std::unique_ptrWebRtcKeyValueConfig const trials_; };有备注看备注翻译过来的意思ConnectionContext此类包含PeerConnection和关联对象所需的资源。该对象的引用将传递给每个PeerConnection。且ConnectionContext此对象上的方法不会干扰其他操作的方式 去更改其PeerConnection对象的任何状态。 看方法可以知道PeerConnectionFactory很多方法是直接引用ConnectionContext的甚至channel_manager / sctp_transport_factory / call_factory 也是直接引用ConnectionContext对象。 重要组成部分ChannelManager、SctpTransportFactory、BasicNetworkManager、BasicPacketSocketFactory、CallFactory。一图总结概述和上图的总结不冲突哈其他更应该把这两图结合一起看。 本篇主要介绍了PeerConnectionFactory的整体结构组成简单揭开了其真正的面纱和其背后隐藏起来的关键部分ConnectionContext。之后会通过CreatePeerConnection-PeerConnection功能去继续分析WebRTC的整体脉络力求全面、清晰、深入浅出。 That is all.
http://www.dnsts.com.cn/news/33101.html

相关文章:

  • 优化排名对网站不好标书制作收费标准
  • 1.电子商务网站建设的核心是( )招网站开发人员
  • 科技 公司 响应式 网站做的网站在百度搜索不到
  • 大型餐饮网站建设成品网站代理
  • 科泉网站《网站建设》期末考试
  • 如室设计网站自己做网站要钱么
  • 工商管理网站wordpress 主题 更新
  • 0网站建设的好坏可以依据的标准有百度关键词优化和百度推广
  • 福州企业网站维护深圳旅游网站建设
  • 创建商城app整站seo哪家服务好
  • 用钢铁侠做网站wordpress文章外链调用
  • ajs17网站建设定制模板
  • 如何加强英文网站建设女生读网络营销与电商直播
  • 线上p2p网站建设漳州本地新闻头条
  • 乒乓球网站建设目标如何做自己的小说网站
  • 网站开发学校聚名网域名
  • 那网站做问答微信公众平台小程序入口
  • 网站开发 360百科泰安哪里有做网站app的
  • 自己做网站主机免费外贸网站模板下载
  • 网站制作公司兴田德润简介美容北京公司网站建设
  • 建设快卡额度查询网站怎么样创办一个网站
  • php图片展示网站网站规划与开发
  • 做网站步骤详解电脑培训机构哪里有
  • 秦皇岛网站建设多少钱平台很重要经典的句子
  • 网站pc端和手机端分离怎么做西樵网站开发
  • 企业网站怎么自适应wordpress两个网站同步
  • 网站开发入无形资产摊销几年wordpress 极速模板
  • 怎么用wix做网站wordpress音乐html
  • 增加网站外链wordpress theme 权限
  • 深圳网站建设推进网络热词2022