69 lines
1.9 KiB
Objective-C
69 lines
1.9 KiB
Objective-C
//
|
||
// SampleHandler.m
|
||
// ScreenShareUploader
|
||
//
|
||
// Created by Caleb on 12/8/25.
|
||
//
|
||
|
||
#import "SampleHandler.h"
|
||
#import <ReplayKit/ReplayKit.h>
|
||
#import <SellyCloudSDK/SellyCloudManager.h>
|
||
|
||
#define kSellyRTCMessagePortName CFSTR("com.sellycloud.screenshare.port")
|
||
|
||
@interface SampleHandler ()
|
||
|
||
@end
|
||
|
||
@implementation SampleHandler
|
||
|
||
#pragma mark - Broadcast lifecycle
|
||
|
||
- (void)broadcastStartedWithSetupInfo:(NSDictionary<NSString *,NSObject *> *)setupInfo {
|
||
// User has requested to start the broadcast. Setup info from the UI extension can be supplied but optional.
|
||
[super broadcastStartedWithSetupInfo:setupInfo];
|
||
}
|
||
|
||
- (void)broadcastPaused {
|
||
// User has requested to pause the broadcast. Samples will stop being delivered.
|
||
NSLog(@"broadcastPaused");
|
||
[super broadcastPaused];
|
||
}
|
||
|
||
- (void)broadcastResumed {
|
||
// User has requested to resume the broadcast. Samples delivery will resume.
|
||
NSLog(@"broadcastResumed");
|
||
[super broadcastResumed];
|
||
}
|
||
|
||
- (void)broadcastFinished {
|
||
// User has requested to finish the broadcast.
|
||
NSLog(@"broadcastFinished");
|
||
[super broadcastFinished];
|
||
}
|
||
|
||
- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer withType:(RPSampleBufferType)sampleBufferType {
|
||
[super processSampleBuffer:sampleBuffer withType:sampleBufferType];
|
||
}
|
||
|
||
#pragma mark - Sample Buffer Handling
|
||
|
||
/// ReplayKit 每来一帧屏幕数据,就会回调这里
|
||
//- (void)processSampleBuffer:(CMSampleBufferRef)sampleBuffer
|
||
// withType:(RPSampleBufferType)sampleBufferType {
|
||
//
|
||
// if (sampleBufferType != RPSampleBufferTypeVideo) {
|
||
// return; // SellyRTC 目前我们只推视频帧
|
||
// }
|
||
//
|
||
// CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
|
||
// if (!pixelBuffer) return;
|
||
//
|
||
// // 需要 Retain,因为传递给主 App 后需要使用
|
||
// CVPixelBufferRetain(pixelBuffer);
|
||
//
|
||
//
|
||
//}
|
||
|
||
@end
|