Files
SellyCloudSDK_demo/Example/SellyCloudSDK/Live/AVVideoConfiguration.h
2026-04-07 18:20:16 +08:00

72 lines
1.9 KiB
Objective-C
Raw Permalink 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.
//
// AVVideoConfiguration.h
// AVDemo
//
// 自定义视频配置类,继承自 SellyLiveVideoConfiguration
// 添加业务相关的属性和方法
//
#import <Foundation/Foundation.h>
#import "SellyCloudSDK/SellyCloudManager.h"
#import "AVConstants.h"
NS_ASSUME_NONNULL_BEGIN
/// 自定义视频配置类
/// @discussion 继承自 SellyLiveVideoConfiguration添加了业务相关的属性
@interface AVVideoConfiguration : SellyLiveVideoConfiguration
// ============ 业务属性 ============
/// 用户昵称
@property (nonatomic, copy) NSString *nickname;
/// 流 ID
@property (nonatomic, copy) NSString *streamId;
/// 视频编码器H.264/H.265
@property (nonatomic, assign) AVVideoCodec codec;
/// XOR 加密密钥(十六进制字符串,如 @"AABBCCDD"),为空则不加密
@property (nonatomic, copy, nullable) NSString *xorKey;
// ============ 工厂方法 ============
/// 创建默认配置
+ (instancetype)defaultConfiguration;
/// 创建指定分辨率的配置
/// @param resolution 分辨率
+ (instancetype)configurationWithResolution:(AVVideoResolution)resolution;
// ============ 便利方法 ============
/// 设置分辨率(采集和输出相同)
/// @param resolution 分辨率
- (void)setResolution:(AVVideoResolution)resolution;
/// 分别设置采集和输出分辨率(高级用法)
/// @param captureResolution 采集分辨率
/// @param outputResolution 输出分辨率
- (void)setCaptureResolution:(AVVideoResolution)captureResolution
outputResolution:(AVVideoResolution)outputResolution;
/// 获取当前输出分辨率
- (AVVideoResolution)currentResolution;
/// 获取当前采集分辨率
- (AVVideoResolution)currentCaptureResolution;
/// 获取当前输出分辨率
- (AVVideoResolution)currentOutputResolution;
/// 获取最大码率kbps
- (NSInteger)maxBitrateKbps;
/// 获取最小码率kbps
- (NSInteger)minBitrateKbps;
@end
NS_ASSUME_NONNULL_END