Coder Social home page Coder Social logo

packetjyushinmaru's Introduction

PacketJyushinMaru

An RTP packet receiver written in Elixir. Doesn't do much.

Usage

## Create a server at port 4000 and convert the packets to a stream.
iex> stream = PacketJyushinMaru.stream(4000)

#Function<54.100999549/2 in Stream.resource/3>

## Get the packets
iex> stream |> Enum.take(3)

[
  ok: {"123456789012", {{127, 0, 0, 1}, 43730}},
  ok: {"123456789012", {{127, 0, 0, 1}, 43730}},
  ok: {"123456789012", {{127, 0, 0, 1}, 43730}}
]

## A simple RTP parser is included.
iex> stream
...> |> Stream.map(&PacketJyushinMaru.parse_packet/1)
...> |> Enum.take(3)

[
  ok: %PacketJyushinMaru.RTP{
    csrc_count: 1,
    extension: 1,
    marker: 0,
    padding: 1,
    payload: "",
    payload_type: 50,
    sequence_number: 13108,
    ssrc: 959459634,
    timestamp: 892745528,
    version: 0
  },
  ok: %PacketJyushinMaru.RTP{
    csrc_count: 1,
    extension: 1,
    marker: 0,
    padding: 1,
    payload: "",
    payload_type: 50,
    sequence_number: 13108,
    ssrc: 959459634,
    timestamp: 892745528,
    version: 0
  },
  ok: %PacketJyushinMaru.RTP{
    csrc_count: 1,
    extension: 1,
    marker: 0,
    padding: 1,
    payload: "",
    payload_type: 50,
    sequence_number: 13108,
    ssrc: 959459634,
    timestamp: 892745528,
    version: 0
  }
]

packetjyushinmaru's People

Contributors

ndac-todoroki avatar

Stargazers

Graham McIntire avatar Sean Stevens avatar TenTakano avatar Robert May avatar Erik Zenker avatar

Watchers

Erik Zenker avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.