Hello,
i build camera app from this guide : https://developer.dji.com/mobile-sdk/documentation/ios-tutorials/index.html
and write averything in swift .
Can someone help to convert this to swift ?
[color=rgba(0, 0, 0, 0.85098)] -(void)videoFeedDJIVideoFeed *)videoFeed didUpdateVideoDataNSData *)videoData { [color=rgba(0, 0, 0, 0.85098)] [[DJIVideoPreviewer instance] pushuint8_t *)videoData.bytes lengthint)videoData.length]; [color=rgba(0, 0, 0, 0.85098)]}
when i convert this to swift like this :
[color=rgba(0, 0, 0, 0.85098)]func videoFeed(_ videoFeed: DJIVideoFeed, didUpdateVideoData videoData: Data) { [color=rgba(0, 0, 0, 0.85098)] DJIVideoPreviewer.instance().push(UInt8(videoData?.bytes ?? 0), length: (videoData?.count ?? 0)) [color=rgba(0, 0, 0, 0.85098)] }
i got errors:
Cannot convert value of type 'UInt8' to expected argument type 'UnsafeMutablePointer<UInt8>?'
Cannot convert value of type 'UnsafeRawPointer' to expected argument type 'Int?'
Please help.
This is the stackoverflow : https://stackoverflow.com/questions/63739868/swift-convert-from-objc
|