@@ -30,8 +30,6 @@ @implementation XCWPrivateSimulatorSession {
3030 NSData *_latestKeyFrameDecoderConfig;
3131 CGSize _latestKeyFrameDimensions;
3232 NSUInteger _latestKeyFrameSequenceValue;
33- NSUInteger _displayFrameCount;
34- NSUInteger _manualRefreshFrameCount;
3533 BOOL _displayReadyValue;
3634 BOOL _didSignalReadiness;
3735}
@@ -143,55 +141,6 @@ - (BOOL)waitForFirstEncodedFrameWithTimeout:(NSTimeInterval)timeout {
143141 return hasFrame;
144142}
145143
146- - (NSDictionary *)sessionInfoRepresentation {
147- __block NSDictionary *representation = nil ;
148- dispatch_sync (_stateQueue, ^{
149- NSMutableDictionary *payload = [@{
150- @" displayReady" : @(self->_displayReadyValue ),
151- @" displayStatus" : self->_displayStatusValue ?: @" " ,
152- @" displayWidth" : @(self->_displaySizeValue .width ),
153- @" displayHeight" : @(self->_displaySizeValue .height ),
154- @" frameSequence" : @(self->_encodedFrameSequenceValue ),
155- @" displayFrameCount" : @(self->_displayFrameCount ),
156- @" manualRefreshFrameCount" : @(self->_manualRefreshFrameCount ),
157- @" encoder" : [self ->_videoEncoder statsRepresentation ],
158- } mutableCopy];
159- if (self->_latestKeyFrameCodec .length > 0 ) {
160- payload[@" latestKeyFrameCodec" ] = self->_latestKeyFrameCodec ;
161- }
162- if (self->_latestKeyFrameDecoderConfig .length > 0 ) {
163- payload[@" latestDecoderConfigBytes" ] = @(self->_latestKeyFrameDecoderConfig .length );
164- }
165- representation = payload;
166- });
167- return representation;
168- }
169-
170- - (nullable NSDictionary *)latestEncodedKeyFrameRepresentation {
171- __block NSDictionary *representation = nil ;
172- dispatch_sync (_stateQueue, ^{
173- if (self->_latestKeyFrameData .length == 0 ) {
174- return ;
175- }
176-
177- NSMutableDictionary *payload = [@{
178- @" sampleData" : self->_latestKeyFrameData ,
179- @" frameSequence" : @(self->_latestKeyFrameSequenceValue ),
180- @" timestampUs" : @(self->_latestKeyFrameTimestampUs ),
181- @" width" : @(self->_latestKeyFrameDimensions .width ),
182- @" height" : @(self->_latestKeyFrameDimensions .height ),
183- } mutableCopy];
184- if (self->_latestKeyFrameCodec .length > 0 ) {
185- payload[@" codec" ] = self->_latestKeyFrameCodec ;
186- }
187- if (self->_latestKeyFrameDecoderConfig .length > 0 ) {
188- payload[@" decoderConfig" ] = self->_latestKeyFrameDecoderConfig ;
189- }
190- representation = payload;
191- });
192- return representation;
193- }
194-
195144- (void )refreshCurrentFrame {
196145 CVPixelBufferRef pixelBuffer = [_displayBridge copyPixelBuffer ];
197146 if (pixelBuffer == nil ) {
@@ -200,7 +149,6 @@ - (void)refreshCurrentFrame {
200149
201150 CGSize displaySize = CGSizeMake ((CGFloat)CVPixelBufferGetWidth (pixelBuffer), (CGFloat)CVPixelBufferGetHeight (pixelBuffer));
202151 dispatch_async (_stateQueue, ^{
203- self->_manualRefreshFrameCount += 1 ;
204152 self->_displaySizeValue = displaySize;
205153 self->_displayReadyValue = YES ;
206154 self->_displayStatusValue = [NSString stringWithFormat: @" Private display ready (%.0f x%.0f )" , displaySize.width, displaySize.height];
@@ -363,7 +311,6 @@ - (void)disconnect {
363311- (void )privateSimulatorDisplayBridge : (DFPrivateSimulatorDisplayBridge *)bridge didUpdateFrame : (CVPixelBufferRef)pixelBuffer {
364312 CGSize displaySize = CGSizeMake ((CGFloat)CVPixelBufferGetWidth (pixelBuffer), (CGFloat)CVPixelBufferGetHeight (pixelBuffer));
365313 dispatch_async (_stateQueue, ^{
366- self->_displayFrameCount += 1 ;
367314 self->_displaySizeValue = displaySize;
368315 self->_displayReadyValue = YES ;
369316 self->_displayStatusValue = [NSString stringWithFormat: @" Private display ready (%.0f x%.0f )" , displaySize.width, displaySize.height];
@@ -393,7 +340,6 @@ - (void)primeStateFromBridge {
393340 if (pixelBuffer != nil ) {
394341 CGSize displaySize = CGSizeMake ((CGFloat)CVPixelBufferGetWidth (pixelBuffer), (CGFloat)CVPixelBufferGetHeight (pixelBuffer));
395342 dispatch_async (_stateQueue, ^{
396- self->_manualRefreshFrameCount += 1 ;
397343 self->_displaySizeValue = displaySize;
398344 self->_displayReadyValue = YES ;
399345 self->_displayStatusValue = [NSString stringWithFormat: @" Private display ready (%.0f x%.0f )" , displaySize.width, displaySize.height];
0 commit comments