Intel® Collaboration Suite for WebRTC
Community support and discussions on the Intel® Collaboration Suite for WebRTC (Intel® CS for WebRTC).

Crash publishing encoded stream from C++ p2p 4.0 sdk

Mark_S_1
Beginner
724 Views

I am trying to publish an ics::base::LocalStream that was created with ics::base::VideoEncoderInterface from the C++ p2p 4.0 sdk, to the javascript p2p 4.0 sdk.  I can successfully send data from the javascript to the c++ (the OnDataReceived method), but when I try to publish the stream I get a debug assert, and the following error in the console output:

#
# Fatal error in D:\63_sdk\src\talk/ics/sdk/base/nativehandlebuffer.h, line 28
# last system error: 0
# Check failed: false

#

 

In addition, the on_failure callback passed to Publish() is called almost immediately with the exception "The stream is already published".  The C++ sdk then sends an sdp to the javascript, receives a "chats-tracks-added" method in response, then call the on_succeeded method that was passed to the publish method, then receives a message of type "answer" with an sdp in it, and then crashes.

I am calling ics::base::GlobalConfiguration::SetEncodedVideoFrameEnabled(true); before creating the ics::p2p::P2PClient or the ics::base::LocalStream.

Any help resolving this error would be greatly appreciated.

0 Kudos
5 Replies
YanbinZ_Intel
Employee
724 Views

Could you please provide detail reproduce steps and detail test environment ?

0 Kudos
Mark_S_1
Beginner
724 Views

I am using Windows 7, compiling as 32 bit.

Create a P2PClient with the following configuration:

   ics::p2p::P2PClientConfiguration configuration;
   ics::base::VideoEncodingParameters videoParams;
   videoParams.codec.name = ics::base::VideoCodec::kH264;
   videoParams.max_bitrate = 5500000;
   videoParams.hardware_accelerated = true;
   configuration.video_encodings.push_back(videoParams);
   ics::base::AudioEncodingParameters audioParams;
   audioParams.codec.name = ics::base::AudioCodec::kOpus;
   configuration.audio_encodings.push_back(audioParams);

Log into a Peer Server running on the same machine so we don't have to worry about STUN or TURN servers.

Using the provided sample p2p javascript application running on chrome, log into the Peer Server, and then send a message (p2p.send()) to the windows C++ p2p sdk.  This will succsefull establish a chat session between the javascript and the c++ sdks.

Using the windows C++ p2p sdk, create an ics::base::LocalStream that was created with ics::base::VideoEncoderInterface, and publish from the C++ side to the javscript side.  This will crash.

I have found that if I don't send the initial chat message, and start the exchange by publishing the encoded stream, it works.

0 Kudos
YanbinZ_Intel
Employee
724 Views

Hi, Mark 

Where is setEncodedVideoFrameEanbled(true) in your code ?  Please set it before create peer connection ?

Thanks

Yanbin

 

 

0 Kudos
Mark_S_1
Beginner
724 Views

I am calling setEncodedVideoFrameEanbled(true) as one of the first things I do, before I create any other objects.

What I have found is that if I start by publishing the stream, before sending a data message, publishing works, but I then can't send any data messages to that peer.  It just fails to work, rather than crashing or returning an error.  So I can either publish video or send data messages, but not both.  This is annoying, but I can work around it.

The major issue I am running into now, is that once I have published a stream, there is no way to stop it.  I am publishing a stream from the C++ p2p sdk on windows to the javascript p2p sdk running on chrome on the same machine.  If I close the chrome window, the c++ p2p sdk crashes with "Debug Assertion Failed" in _CrtIsValidHeapPointer(block).  The stack trace just has "[External Code]" in it.  I have tried:

Send a "chat-closed" message from the javascript to the c++.  That instantly crashes.

Send no message.  After about 16 seconds the C++ sends a "chat-closed" message and crashes.

On the C++ side call one of the following methods, all of which result in an immediate crash

   P2PPubliction.Close()

   P2PClient.Stop()

   P2PClient.RemoveAllowedRemoteID()

 

Any insight would be greatly appreciated.

0 Kudos
DINH__Anh_Minh
Beginner
724 Views

Dear Mark,

I can't even create a C++ p2pclient as it is not in the latest ics-debug, release.lib. Can you show me the code for making an p2pclient in c++, windows? I just need p2p chat for now.

Thanks in advance,

Minh

0 Kudos
Reply