Skip to content

Commit

Permalink
add self_delimiting field (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-hek authored Oct 30, 2020
1 parent 8634b27 commit e9558d6
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions lib/membrane_opus.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,30 @@ defmodule Membrane.Opus do
@typedoc """
Number of channels transmitted in the stream.
"""
@type channels_t :: 1 | 2 | nil
@type channels_t :: 1 | 2

@typedoc """
Bitrate used to encode the stream in `bit/s`.
Opus supports all bitrates from `6 kbit/s` to `510 kbit/s`,
so this value has to be in range `6144` to `522240`.
"""
@type bitrate_t :: non_neg_integer | nil
@type bitrate_t :: non_neg_integer

@typedoc """
Determines if stream uses self-delimiting framing.
Self-delimiting framing provides information necessary to parse
uncontainerized Opus stream.
"""
@type self_delimiting_t :: boolean

@type t :: %__MODULE__{
bitrate: bitrate_t,
channels: channels_t
channels: channels_t,
self_delimiting?: self_delimiting_t
}

@enforce_keys [
:bitrate,
:channels
]
defstruct @enforce_keys
@enforce_keys [:bitrate, :channels]
defstruct @enforce_keys ++ [self_delimiting?: false]
end

0 comments on commit e9558d6

Please sign in to comment.