美文网首页
熟悉Proxy.h

熟悉Proxy.h

作者: 大飞_2048 | 来源:发表于2019-08-15 19:01 被阅读0次

    由使用聊起

        rtc::scoped_refptr<webrtc::ObjCVideoTrackSource> objCVideoTrackSource(
             new rtc::RefCountedObject<webrtc::ObjCVideoTrackSource>());
           VideoTrackSourceProxy::Create( signalingThread, workerThread, objCVideoTrackSource)];
    

    Proxy.h实现粘贴如下:

    image.png
    • 解析一*
    #define BEGIN_PROXY_MAP(c)                                                    \
      PROXY_MAP_BOILERPLATE(c)                                                    \
      WORKER_PROXY_MAP_BOILERPLATE(c)                                             \
      REFCOUNTED_PROXY_MAP_BOILERPLATE(c)                                         \
     public:                                                                      \
      static rtc::scoped_refptr<c##ProxyWithInternal> Create(                     \
          rtc::Thread* signaling_thread, rtc::Thread* worker_thread,              \
          INTERNAL_CLASS* c) {                                                    \
        return new rtc::RefCountedObject<c##ProxyWithInternal>(signaling_thread,  \
                                                               worker_thread, c); \
      }
    

    参数: Create () 静态函数
    INTERNAL_CLASS 类型 = VideoTrackSourceInterface
    c##ProxyWithInternal = VideoTrackSourceProxyWithInternal

    由PROXY_MAP_BOILERPLATE 展开可以得到: image.png

    相关文章

      网友评论

          本文标题:熟悉Proxy.h

          本文链接:https://www.haomeiwen.com/subject/sfjtsctx.html