idk why there isn't built in lib for watch RTSP stream on iOS of apple framework list, even though rtsp is popular. Can i built my own with swift,? have any tutorial for this purpose, i did try many framework like VLCMobileKit,.. it work but I can't understand why it so many enomous files and account for 400mb to 1.7gb for installed pod and have so many bug i cannot fix when usage (so hard to maintain). Can you suggest for me how to built my own with swift.
As my knowledge our camera only support for RTSP so I'm not using HTTP Live Stream, it is true? can I use HTTP Live Streaming for this purpose.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have a array of contacts (about 1 millions elements), i must compare many of times the id of a contact to find out contact i need (the list was order by id so i'm using binary search). It did crash, this is my code and backtrace:
struct Contact {
let blIdContact: String
let timeStamp: Int64
}
func binarySearch(in contacts: [Contact], for value: String) -> Int? {
var left = 0
var right = contacts.count - 1
while left <= right {
let middle = Int(floor(Double(left + right) / 2.0))
if contacts[middle].blIdContact < value {
left = middle + 1
} else if contacts[middle].blIdContact > value {
right = middle - 1
} else {
return middle
}
}
return nil
}
This is backtrace at crashed thread:
Thread 25 Crashed:
0 libobjc.A.dylib 0x00000001b38771c8 objc_msgSend + 8
1 libswiftCore.dylib 0x00000001a2b1a464 _foreignNormalize(readIndex:endIndex:guts:outputBuffer:icuInputBuffer:icuOutputBuffer:) + 236 (StringBridge.swift:159)
2 libswiftCore.dylib 0x00000001a2b231cc _StringGutsSlice._slowCompare(with:expecting:) + 3464 (StringComparison.swift:375)
3 libswiftCore.dylib 0x00000001a2b2115c _stringCompareInternal(_:_:expecting:) + 308 (StringComparison.swift:185)
4 Bluezone 0x00000001023f1450 binarySearch(in:for:) + 37968 (Utils.swift:46)
This is full backtrace:
2021-07-30_22-25-18.6439_+0700-35c69dd5f3150833c617797438762310e264d319.crash
This is code block lead to crash to my app, the array of contacts is about 1 million elements, how can i solve this, thank you all:
struct Contact {
let blIdContact: String
let timeStamp: Int64
}
func binarySearch(in contacts: [Contact], for value: String) -> Int? {
var left = 0
var right = contacts.count - 1
while left <= right {
let middle = Int(floor(Double(left + right) / 2.0))
if contacts[middle].blIdContact < value {
left = middle + 1
} else if contacts[middle].blIdContact > value {
right = middle - 1
} else {
return middle
}
}
return nil
}
I have a crash with backtrace:
2021-07-30_22-15-21.6924_+0700-305aeaa984c3dc2f37a08a6502834d0c4cb0e4cb.crash