Open Rockjan opened 4 years ago
Error also happened on my iPhone X (iOS13.6)...
Finally, I fixed the bug . The problem is type conversion (oc->c++):
The wrong code:
if (encoding.maxBitrateBps != nil) nativeEncoding.max_bitrate_bps = (int)(size_t)encoding.maxBitrateBps;
if (encoding.minBitrateBps != nil) nativeEncoding.min_bitrate_bps = (int)(size_t)encoding.minBitrateBps;
if (encoding.maxFramerate != nil) nativeEncoding.max_framerate = (int)(size_t)encoding.maxFramerate;
if (encoding.numTemporalLayers != nil) nativeEncoding.num_temporal_layers = (int)(size_t)encoding.numTemporalLayers;
if (encoding.scaleResolutionDownBy != nil) nativeEncoding.scale_resolution_down_by = (double)[encoding.scaleResolutionDownBy doubleValue];
and the correct code should be :
if (encoding.maxBitrateBps != nil) nativeEncoding.max_bitrate_bps = absl::make_optional(encoding.maxBitrateBps.intValue);
if (encoding.minBitrateBps != nil) nativeEncoding.min_bitrate_bps = absl::make_optional(encoding.minBitrateBps.intValue);
if (encoding.maxFramerate != nil) nativeEncoding.max_framerate = absl::make_optional(encoding.maxFramerate.doubleValue);
if (encoding.numTemporalLayers != nil) nativeEncoding.num_temporal_layers = absl::make_optional(encoding.numTemporalLayers.intValue);
if (encoding.scaleResolutionDownBy != nil) nativeEncoding.scale_resolution_down_by = absl::make_optional(encoding.scaleResolutionDownBy.doubleValue);
Hello, sorry for the late reply, been busy... If possible could you create a pull request with your fix?
Hi any suggestion regarding group video chat
@ethand91 hey there. Great job on the pod. I was wondering if you by chance could update the pod with the fix @Rockjan suggested. Cause currently latest pod produces same crash when using:
var encodings: Array = Array<RTCRtpEncodingParameters>.init()
encodings.append(RTCUtils.genRtpEncodingParameters(true, maxBitrateBps: 500000, minBitrateBps: 0, maxFramerate: 60, numTemporalLayers: 0, scaleResolutionDownBy: 0))
encodings.append(RTCUtils.genRtpEncodingParameters(true, maxBitrateBps: 1000000, minBitrateBps: 0, maxFramerate: 60, numTemporalLayers: 0, scaleResolutionDownBy: 0))
encodings.append(RTCUtils.genRtpEncodingParameters(true, maxBitrateBps: 1500000, minBitrateBps: 0, maxFramerate: 60, numTemporalLayers: 0, scaleResolutionDownBy: 0))
producer = mediasoupSendTransport.produce(self,
track: videoTrack,
encodings: encodings,
codecOptions: codecOptions,
appData: appData)
Thanks
Hi,
I'm encountering this crash in all my iOS devices, so is there any way to bring this fix into the pod, or some other workaround?
@ethand91 Could you please release the library and update the pod with the latest code so everyone can use it with the bag fixed. Thank you
Hi , sorry to trouble you again. The problem is when I enable simulcast like this :
my test device , a iPhone5s(iOS12.4.8) very easy to crash and report a message: "error creating transceiver", but this problem never happened on other devices (iPhone6 or above).