@livedesk/client 0.1.97 → 0.1.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,9 +56,9 @@ final class LiveDeskScreenCaptureKitEncoder: NSObject, SCStreamOutput, SCStreamD
56
56
  configuration.width = width
57
57
  configuration.height = height
58
58
  configuration.minimumFrameInterval = CMTime(value: 1, timescale: CMTimeScale(fps))
59
- configuration.queueDepth = 3
59
+ configuration.queueDepth = 8
60
60
  configuration.showsCursor = false
61
- configuration.pixelFormat = kCVPixelFormatType_32BGRA
61
+ configuration.pixelFormat = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
62
62
 
63
63
  let stream = SCStream(filter: filter, configuration: configuration, delegate: self)
64
64
  try stream.addStreamOutput(self, type: .screen, sampleHandlerQueue: queue)
@@ -126,7 +126,7 @@ final class LiveDeskScreenCaptureKitEncoder: NSObject, SCStreamOutput, SCStreamD
126
126
  }
127
127
 
128
128
  sampleCount += 1
129
- guard isCompleteFrame(sampleBuffer) else {
129
+ guard isEncodableFrame(sampleBuffer) else {
130
130
  skippedCount += 1
131
131
  logCaptureProgressIfNeeded()
132
132
  return
@@ -162,13 +162,14 @@ final class LiveDeskScreenCaptureKitEncoder: NSObject, SCStreamOutput, SCStreamD
162
162
  exit(3)
163
163
  }
164
164
 
165
- private func isCompleteFrame(_ sampleBuffer: CMSampleBuffer) -> Bool {
165
+ private func isEncodableFrame(_ sampleBuffer: CMSampleBuffer) -> Bool {
166
166
  guard let attachments = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, createIfNecessary: false) as NSArray?,
167
167
  let first = attachments.firstObject as? NSDictionary,
168
168
  let rawStatus = first[SCStreamFrameInfo.status] as? Int else {
169
169
  return true
170
170
  }
171
171
  return rawStatus == SCFrameStatus.complete.rawValue
172
+ || rawStatus == SCFrameStatus.idle.rawValue
172
173
  }
173
174
 
174
175
  private func logCaptureProgressIfNeeded() {
@@ -56,9 +56,9 @@ final class LiveDeskScreenCaptureKitEncoder: NSObject, SCStreamOutput, SCStreamD
56
56
  configuration.width = width
57
57
  configuration.height = height
58
58
  configuration.minimumFrameInterval = CMTime(value: 1, timescale: CMTimeScale(fps))
59
- configuration.queueDepth = 3
59
+ configuration.queueDepth = 8
60
60
  configuration.showsCursor = false
61
- configuration.pixelFormat = kCVPixelFormatType_32BGRA
61
+ configuration.pixelFormat = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
62
62
 
63
63
  let stream = SCStream(filter: filter, configuration: configuration, delegate: self)
64
64
  try stream.addStreamOutput(self, type: .screen, sampleHandlerQueue: queue)
@@ -126,7 +126,7 @@ final class LiveDeskScreenCaptureKitEncoder: NSObject, SCStreamOutput, SCStreamD
126
126
  }
127
127
 
128
128
  sampleCount += 1
129
- guard isCompleteFrame(sampleBuffer) else {
129
+ guard isEncodableFrame(sampleBuffer) else {
130
130
  skippedCount += 1
131
131
  logCaptureProgressIfNeeded()
132
132
  return
@@ -162,13 +162,14 @@ final class LiveDeskScreenCaptureKitEncoder: NSObject, SCStreamOutput, SCStreamD
162
162
  exit(3)
163
163
  }
164
164
 
165
- private func isCompleteFrame(_ sampleBuffer: CMSampleBuffer) -> Bool {
165
+ private func isEncodableFrame(_ sampleBuffer: CMSampleBuffer) -> Bool {
166
166
  guard let attachments = CMSampleBufferGetSampleAttachmentsArray(sampleBuffer, createIfNecessary: false) as NSArray?,
167
167
  let first = attachments.firstObject as? NSDictionary,
168
168
  let rawStatus = first[SCStreamFrameInfo.status] as? Int else {
169
169
  return true
170
170
  }
171
171
  return rawStatus == SCFrameStatus.complete.rawValue
172
+ || rawStatus == SCFrameStatus.idle.rawValue
172
173
  }
173
174
 
174
175
  private func logCaptureProgressIfNeeded() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/client",
3
- "version": "0.1.97",
3
+ "version": "0.1.99",
4
4
  "description": "LiveDesk local remote client",
5
5
  "type": "module",
6
6
  "bin": {