Sha256: f56d785baea5c2eaf48675334d9a10cb6f15aab1f612d0cb05406653913f7aef

Contents?: true

Size: 550 Bytes

Versions: 14

Compression:

Stored size: 550 Bytes

Contents

# encoding: utf-8
require 'packetfu'
require 'sippy_cup/media/rtp_header'

module SippyCup
  class Media
    class RTPPayload
      attr_reader :header

      def initialize(payload_id = 0)
        @header = RTPHeader.new payload_id: payload_id
      end

      def to_bytes
        @header.to_s + media
      end

      def method_missing(method, *args)
        if method.to_s =~ /^rtp_/
          method = method.to_s.sub(/^rtp_/, '').to_sym
          @header.send method, *args
        else
          super
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sippy_cup-0.7.2 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.7.1 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.7.0 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.6.0 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.5.0 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.4.1 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.4.0 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.3.0 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.2.3 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.2.2 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.2.1 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.2.0 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.1.1 lib/sippy_cup/media/rtp_payload.rb
sippy_cup-0.1.0 lib/sippy_cup/media/rtp_payload.rb