SellyCloudSDK_demo/Example/SellyCloudSDK/VideoCall/SellyCallPiPManager.h

43 lines
1.2 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// SellyCallPiPManager.h
// SellyCloudSDK_Example
//
// Created by Caleb on 19/11/25.
// Copyright © 2025 Caleb. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AVKit/AVKit.h>
#import <SellyCloudSDK/SellyCloudManager.h>
NS_ASSUME_NONNULL_BEGIN
/// 负责:
/// - 初始化 AVSampleBufferDisplayLayer
/// - 管理 AVPictureInPictureController
/// - 接收业务层传入的 SellyRTCVideoFrame 并送入 PiP
@interface SellyCallPiPManager : NSObject
<AVPictureInPictureControllerDelegate, AVPictureInPictureSampleBufferPlaybackDelegate>
/// 是否当前设备/系统支持自定义 PiP
@property (nonatomic, assign, readonly) BOOL pipPossible;
/// 方便外界知道当前是否在 PiP
@property (nonatomic, assign, readonly) BOOL pipActive;
/// 指定在哪个 view 里显示App 内)这条 PiP 的画面(可选)
- (instancetype)initWithRenderView:(UIView *)renderView;
/// 初始化 / 配置 PiP通常在 viewDidLoad 调一次
- (void)setupIfNeeded;
/// 外界点按钮时调用:开启 / 关闭 PiP
- (void)togglePiP;
/// 外界在收到远端视频帧回调时调用
- (void)feedVideoFrame:(SellyRTCVideoFrame *)frame;
@end
NS_ASSUME_NONNULL_END