Skip to content
/ sdp Public

A parser and emitter for the Session Description Protocol (SDP) as described by RFC 4566.

Notifications You must be signed in to change notification settings

nogden/sdp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdp

A Clojure parser and emitter for the Session Description Protocol (SDP) as described by RFC 4566.

Installation

Available on Clojars:

Clojars Project

Documentation

Full API and implementation documentation is available here.

Usage

(ns example
  (:require [multimedia.streaming.sdp :refer :all])

;; Parse an SDP string
(def description (parse example-sdp-string))

;; Resulting structure is a simple set of nested maps
(:name description) ;; => "SDP Seminar"
(get-in description [:media-descriptions 0 :media-type]) ;; => "audio"
(get-in description [:media-descriptions 0 :port]) ;; => 49170

;; Overridable parsers allow for integration with custom types
;; E.g. To parse all ports as strings
(use-custom-parsers!
  {:port identity})

(get-in (parse example-sdp-string) [:media-descriptions 0 :port]) ;; => "49170"

Still to Come

  1. Optional representation of instants and durations using java.time or JodaTime
  2. Pluggable attribute parsing
  3. Emitting

License

Copyright © 2015 Nick Ogden

Distributed under the Eclipse Public License, the same as Clojure.

About

A parser and emitter for the Session Description Protocol (SDP) as described by RFC 4566.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published