<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                實時音視頻的修改也比較多,需要注意的是MHBeautyManager?參數要始終保持一致,也就是傳入MHMeiyanMenusView和Zego的濾鏡類的參數是一樣的。 需要在下面的類中作如下修改。黑框中的部分為新加的,可以與即構的demo對比參考。 ZGVideoFilterAsyncDemo.h ``` @property?(nonatomic, strong) MHBeautyManager?*beautyManager; ``` ZGVideoFilterAsyncDemo.m ``` // SDK 回調。App 在此接口中獲取 SDK 采集到的視頻幀數據,并進行處理 - (void)queueInputBuffer:(CVPixelBufferRef)pixel_buffer timestamp:(unsignedlonglong)timestamp_100n { // * 采集到的圖像數據通過這個傳進來,這個點需要異步處理 dispatch_async(queue_, ^ { int?imageWidth = (int)CVPixelBufferGetWidth(pixel_buffer); int?imageHeight = (int)CVPixelBufferGetHeight(pixel_buffer); int?imageStride = (int)CVPixelBufferGetBytesPerRowOfPlane(pixel_buffer, 0); CVPixelBufferRef?dst = [self->buffer_pool_dequeueInputBuffer:imageWidth height:imageHeight stride:imageStride]; ``` ![](https://img.kancloud.cn/19/f2/19f20e81181aba758c676121ca172bd2_1734x504.png) ``` //if?(dst) { // if(self.beautyManager){ // [self.beautyManager processZGWithPixelBuffer:pixel_buffer]; ? ? ? ? //? ? } CVPixelBufferRef?output = pixel_buffer; if?([ZGImageUtilscopyPixelBufferFrom:output to:dst]) { ?// * 把從 buffer pool 中得到的 CVPixelBuffer 實例傳進來 ? ? ? ? ? ? ? ? [self->buffer_pool_queueInputBuffer:dst timestamp:timestamp_100n]; ? ? ? ? ? ? } ? ? ? ? } self.pendingCount= self.pendingCount- 1; CVPixelBufferRelease(pixel_buffer); ? ? }); } ``` lZGVideoFilterAsyncDemo.h ``` @property?(nonatomic, strong) MHBeautyManager?*beautyManager; ``` lZGVideoFilterFactoryDemo.m ``` // 創建外部濾鏡實例 - (id)zego_create?{ if?(g_filter_== nil) { ? ? ? ? // 此處的 bufferType 對應四種濾鏡類型,以創建不同的外部濾鏡實例 switch?(self.bufferType) { case ZegoVideoBufferTypeAsyncPixelBuffer: ? ? ? ? ? ? ? ? { g_filter_?= [[ZGVideoFilterAsyncDemo alloc] init]; ? ? ? ? ? ? ? ? ? ? ZGVideoFilterAsyncDemo* g_filter = ///黑框部分開始 (ZGVideoFilterAsyncDemo*)g_filter_; [g_filter setMHBeautyManager:self.beautyManager]; ///黑框部分結束 ? ? ? ? ? ? ? ? } break; case ZegoVideoBufferTypeSyncPixelBuffer: g_filter_?= [[ZGVideoFilterSyncDemo alloc] init]; break; case ZegoVideoBufferTypeAsyncI420PixelBuffer: g_filter_?= [[ZGVideoFilterI420Demo alloc] init]; break; case ZegoVideoBufferTypeAsyncNV12PixelBuffer: g_filter_?= [[ZGVideoFilterNV12Demo alloc] init]; break; default: break; ? ? ? ? } ? ? } returng_filter_; } ``` ZGExternalVideoFilterDemo.h 添加如下方法: ``` - (void)initFilterFactoryType:(ZegoVideoBufferType)type beautyManager:(MHBeautyManager*)beautyManager; lZGExternalVideoFilterDemo.m實現該方法: - (void)initFilterFactoryType:(ZegoVideoBufferType)type beautyManager:(MHBeautyManager*)beautyManager{ if?(self.g_filterFactory== nil) { self.g_filterFactory?= [[ZGVideoFilterFactoryDemo alloc] init]; self.g_filterFactory.bufferType?= type; self.g_filterFactory.beautyManager?= beautyManager; ? ? } [ZGApiManager releaseApi]; [ZegoExternalVideoFilter setVideoFilterFactory:self.g_filterFactorychannelIndex:ZEGOAPI_CHN_MAIN]; } ``` ZGVideoTalkLoginViewController ``` 初始化MHBeautyManager? - (MHBeautyManager?*)beautyManager?{ if?(!_beautyManager) { ? ? ? ? _beautyManager?= [[MHBeautyManageralloc] init]; ? ? } return_beautyManager; } ``` 在ViewDidLoad方法中初始ZGExternalVideoFilterDemo: ``` self.demo?= [[ZGExternalVideoFilterDemoalloc] init]; self.demo.delegate= self; [self.demo initFilterFactoryType:ZegoVideoBufferTypeAsyncPixelBuffer beautyManager:self.beautyManager]; ``` ZGVideoTalkViewController是實現視頻通話的功能,將上一步中的beautyManager作為參數傳入。 ``` ZGVideoTalkViewController*vc = [sb instantiateViewControllerWithIdentifier:NSStringFromClass([ZGVideoTalkViewControllerclass])]; ? ? vc.roomID?= roomID; vc.videoTalkDemo= self.videoTalkDemo; vc.beautyManager= self.beautyManager; ``` 在ZGVideoTalkViewController.h文件中 ``` @property?(nonatomic, strong) MHBeautyManager?*beautyManager; ``` ZGVideoTalkViewController?.m 文件中對美顏UI初始化,并將傳入的beautyManager傳入MHMeiyanMenusView ``` - (MHMeiyanMenusView?*)menusView?{ if?(!_menusView) { ? ? ? ? _menusView?= [[MHMeiyanMenusView alloc] initWithFrame:CGRectMake(0, window_height- MHMeiyanMenuHeight- BottomIndicatorHeight, window_width, MHMeiyanMenuHeight) superView:self.viewdelegate:self? beautyManager:self.beautyManagerisTXSDK:NO]; ? ? } return _menusView; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看