private void Instance_OnAddRemoteStream(MediaStreamEvent evt)
        {
            RunOnUiThread(() =>
            {
                System.Diagnostics.Debug.WriteLine("Conductor_OnAddRemoteStream()");

                _peerVideoTrack = evt.Stream.GetVideoTracks().FirstOrDefault();
                if (_peerVideoTrack != null)
                {
                    System.Diagnostics.Debug.WriteLine(
                        "Conductor_OnAddRemoteStream() - GetVideoTracks: {0}",
                        evt.Stream.GetVideoTracks().Count);
                    // Raw Video from VP8 Encoded Sender
                    // H264 Encoded Stream does not trigger this event

                    // TODO:  Switch between RAW or ENCODED Frame
#if HACK_VP8
                    rawVideo = Media.CreateMedia().CreateRawVideoSource(_peerVideoTrack);
                    rawVideo.OnRawVideoFrame += Source_OnRawVideoFrame;
#else
                    encodedVideo = Media.CreateMedia().CreateDecodedVideoSource(_peerVideoTrack);
                    encodedVideo.OnDecodedVideoFrame += EncodedVideo_OnEncodedVideoFrame;
#endif
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Conductor_OnAddRemoteStream() - peerVideoTrack NULL");
                }
                _webRtcControl.IsReadyToDisconnect = true;
            }
                          );
        }
Ejemplo n.º 2
0
 private void Conductor_OnAddRemoteStream(MediaStreamEvent evt)
 {
     _peerVideoTrack = evt.Stream.GetVideoTracks().FirstOrDefault();
     if (_peerVideoTrack != null)
     {
         _decodedVideo = Media.CreateMedia().CreateDecodedVideoSource(_peerVideoTrack);
         _decodedVideo.OnDecodedVideoFrame += Source_OnDecodedVideoFrame;
     }
 }
    private void Conductor_OnAddRemoteStream(MediaStreamEvent evt)
    {
        System.Diagnostics.Debug.WriteLine("Conductor_OnAddRemoteStream()");
        _peerVideoTrack = evt.Stream.GetVideoTracks().FirstOrDefault();
        if (_peerVideoTrack != null)
        {
            System.Diagnostics.Debug.WriteLine(
                "Conductor_OnAddRemoteStream() - GetVideoTracks: {0}",
                evt.Stream.GetVideoTracks().Count);

            decodedVideo = Media.CreateMedia().CreateDecodedVideoSource(_peerVideoTrack);
            decodedVideo.OnDecodedVideoFrame += DecodedVideo_OnDecodedVideoFrame;
        }
        else
        {
            System.Diagnostics.Debug.WriteLine("Conductor_OnAddRemoteStream() - peerVideoTrack NULL");
        }
        _webRtcControl.IsReadyToDisconnect = true;
    }