versatica / libmediasoupclient

mediasoup client side C++ library
https://mediasoup.org
ISC License
291 stars 178 forks source link

RTCMediaStreamTrack into webrtc: : MediaStreamTrackInterface error #97

Closed 435129214 closed 4 years ago

435129214 commented 4 years ago

I'm in the process of converting this project to a MAC version, but I have a problem。 in SendTransport.mm -(Producer )produce:(id)listener track:(RTCMediaStreamTrack )track encodings:(NSArray )encodings codecOptions:(NSString )codecOptions appData:(NSString *)appData { NSUInteger nativeTrack = track.hash;

NSLog(@"kind:%@:%lud",track.kind);//video

Producer *producer = [TransportWrapper nativeProduce:self._nativeTransport listener:listener track:nativeTrack encodings:encodings codecOptions:codecOptions appData:appData];

return producer; }

but in TransportWrapper.mm +(::Producer )nativeProduce:(NSValue )nativeTransport listener:(id)listener track:(NSUInteger)mediaTrack encodings:(NSArray )encodings codecOptions:(NSString )codecOptions appData:(NSString )appData auto mediaStreamTrack = reinterpret_cast<webrtc::MediaStreamTrackInterface >(mediaTrack);

NSLog(@"1111kind:%s",mediaStreamTrack->kind().c_str());// ideo

Kind went from video to IDEO, which is wrong. At the same time, I found that the output conversion of audio fails and crashes directly.

Is there a better way to do this type conversion? what's the problem? Thank you very much.

ibc commented 4 years ago

Please use the forum for questions.