Sha256: 35b7e9f6a26ae43a8f07de58f51b0b6cfca13c8019929279479c7c419b90196a

Contents?: true

Size: 1.3 KB

Versions: 7

Compression:

Stored size: 1.3 KB

Contents

require_relative '../spec_helper'
require 'rtsp/transport_parser'

describe RTSP::TransportParser do
  before do
    @parser = RTSP::TransportParser.new
  end

  describe "a basic Transport header" do
    before do
      transport = "RTP/AVP;unicast;client_port=9000-9001"
      @result = @parser.parse transport
    end

    it "extracts the protocol" do
      @result[:streaming_protocol].should == 'RTP'
    end

    it "extracts the profile" do
      @result[:profile].should == 'AVP'
    end

    it "extracts the broadcast type" do
      @result[:broadcast_type].should == 'unicast'
    end

    it "extracts the client RTP port" do
      @result[:client_port][:rtp].should == '9000'
    end

    it "extracts the client RTCP port" do
      @result[:client_port][:rtcp].should == '9001'
    end
  end

  describe "a TCP binary interleaved Transport header" do
    before do
      transport = "RTP/AVP/TCP;unicast;interleaved=0-1"
      @result = @parser.parse transport
    end

    it "extracts the lower transport type" do
      @result[:transport_protocol].should == 'TCP'
    end

    it "extracts the interleaved RTP channel" do
      @result[:interleaved][:rtp_channel].should == '0'
    end

    it "extracts the interleaved RTCP channel" do
      @result[:interleaved][:rtcp_channel].should == '1'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rtsp-0.3.0 spec/rtsp/transport_parser_spec.rb
rtsp-0.2.2 spec/rtsp/transport_parser_spec.rb
rtsp-0.2.1 spec/rtsp/transport_parser_spec.rb
rtsp-0.2.0 spec/rtsp/transport_parser_spec.rb
rtsp-0.1.2 spec/rtsp/transport_parser_spec.rb
rtsp-0.1.1 spec/rtsp/transport_parser_spec.rb
rtsp-0.1.0 spec/rtsp/transport_parser_spec.rb