屏幕共享fix

This commit is contained in:
Caleb
2025-12-12 17:23:52 +08:00
parent b85cee5d0d
commit 1e084c43f3
42 changed files with 1505 additions and 110 deletions

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.broadcast-services-upload</string>
<key>NSExtensionPrincipalClass</key>
<string>SampleHandler</string>
<key>RPBroadcastProcessMode</key>
<string>RPBroadcastProcessModeSampleBuffer</string>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
//
// SampleHandler.h
// ScreenShareUploader
//
// Created by Caleb on 12/8/25.
// Copyright © 2025 Caleb. All rights reserved.
//
#import <ReplayKit/ReplayKit.h>
#import <SellyCloudSDK/SellyCloudManager.h>
@interface SampleHandler : SellyRTCReplayKitHandler
@end

View File

@@ -0,0 +1,68 @@
//
// 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