SIPSorcery.Net.RTPChannel.SetFrameType C# (CSharp) Method

SetFrameType() public method

Video frames use a header at the start of the RTP payload in order to break up a single video frame into multiple RTP packets. The RTP channel will need to know the type of header being used in order to determine when a full frame has been received.
public SetFrameType ( FrameTypesEnum frameType ) : void
frameType FrameTypesEnum
return void
        public void SetFrameType(FrameTypesEnum frameType)
        {
            _frameType = frameType;
        }

Usage Example

コード例 #1
0
ファイル: RTPManager.cs プロジェクト: Dawn2Yuan/sipsorcery
        public RTPManager(bool includeAudio, bool includeVideo)
        {
            if (includeAudio)
            {
                // Create a UDP socket to use for sending and receiving RTP audio packets.
                _rtpAudioChannel = new RTPChannel();
                _rtpAudioChannel.SetFrameType(FrameTypesEnum.Audio);
                _rtpAudioChannel.ReservePorts(DEFAULT_START_RTP_PORT, DEFAULT_END_RTP_PORT);
                _rtpAudioChannel.OnFrameReady += AudioFrameReady;
            }

            if (includeVideo)
            {
                _rtpVideoChannel = new RTPChannel();
                _rtpVideoChannel.SetFrameType(FrameTypesEnum.VP8);
                _rtpVideoChannel.ReservePorts(DEFAULT_START_RTP_PORT, DEFAULT_END_RTP_PORT);
                _rtpVideoChannel.OnFrameReady += VideoFrameReady;
                _rtpVideoChannel.OnRTPSocketDisconnected += () => { };
            }
        }