Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions lib/ex_webrtc/rtp/h264/nal_formats/fu/header.ex
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
defmodule ExWebRTC.RTP.H264.FU.Header do
@moduledoc """
Defines a structure representing Fragmentation Unit (FU) header
which is defined in [RFC6184](https://tools.ietf.org/html/rfc6184#page-31)

```
+---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|S|E|R| Type |
+---------------+
```
"""
@moduledoc false
# Defines a structure representing Fragmentation Unit (FU) header
# which is defined in [RFC6184](https://tools.ietf.org/html/rfc6184#page-31)
#
#
# +---------------+
# |0|1|2|3|4|5|6|7|
# +-+-+-+-+-+-+-+-+
# |S|E|R| Type |
# +---------------+
#

alias ExWebRTC.RTP.H264.NAL

Expand Down
47 changes: 22 additions & 25 deletions lib/ex_webrtc/rtp/h264/nal_formats/stap_a.ex
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
defmodule ExWebRTC.RTP.H264.StapA do
@moduledoc """
Module responsible for parsing Single Time Agregation Packets type A.

Documented in [RFC6184](https://tools.ietf.org/html/rfc6184#page-22)

```
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RTP Header |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|STAP-A NAL HDR | NALU 1 Size | NALU 1 HDR |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NALU 1 Data |
: :
+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| | NALU 2 Size | NALU 2 HDR |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NALU 2 Data |
: :
| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| :...OPTIONAL RTP padding |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
```
"""
@moduledoc false
# Module responsible for parsing Single Time Agregation Packets type A.
#
# Documented in [RFC6184](https://tools.ietf.org/html/rfc6184#page-22)
#
# 0 1 2 3
# 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | RTP Header |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# |STAP-A NAL HDR | NALU 1 Size | NALU 1 HDR |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | NALU 1 Data |
# : :
# + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | | NALU 2 Size | NALU 2 HDR |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | NALU 2 Data |
# : :
# | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
# | :...OPTIONAL RTP padding |
# +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

@spec parse(binary()) :: {:ok, [binary()]} | {:error, :packet_malformed}
def parse(data) do
Expand Down
25 changes: 12 additions & 13 deletions lib/ex_webrtc/rtp/h264/nal_header.ex
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
defmodule ExWebRTC.RTP.H264.NAL.Header do
@moduledoc """
Defines a structure representing Network Abstraction Layer Unit Header

Defined in [RFC 6184](https://tools.ietf.org/html/rfc6184#section-5.3)

```
+---------------+
|0|1|2|3|4|5|6|7|
+-+-+-+-+-+-+-+-+
|F|NRI| Type |
+---------------+
```
"""
@moduledoc false
# Defines a structure representing Network Abstraction Layer Unit Header
#
# Defined in [RFC 6184](https://tools.ietf.org/html/rfc6184#section-5.3)
#
#
# +---------------+
# |0|1|2|3|4|5|6|7|
# +-+-+-+-+-+-+-+-+
# |F|NRI| Type |
# +---------------+
#

@typedoc """
NRI stands for nal_ref_idc. This value represents importance of
Expand Down
Loading