@@ -9,7 +9,7 @@ defmodule Boombox do
9
9
10
10
alias Membrane.RTP
11
11
12
- @ type enforce_transcoding_value ( ) :: boolean ( ) | :audio | :video
12
+ @ type force_transcoding_value ( ) :: boolean ( ) | :audio | :video
13
13
14
14
@ type webrtc_signaling :: Membrane.WebRTC.Signaling . t ( ) | String . t ( )
15
15
@ type in_stream_opts :: [
@@ -66,7 +66,7 @@ defmodule Boombox do
66
66
| { :address , :inet . ip_address ( ) | String . t ( ) }
67
67
| { :port , :inet . port_number ( ) }
68
68
| { :target , String . t ( ) }
69
- | { :enforce_transcoding , enforce_transcoding_value ( ) }
69
+ | { :force_transcoding , force_transcoding_value ( ) }
70
70
]
71
71
72
72
@ type input ::
@@ -82,12 +82,12 @@ defmodule Boombox do
82
82
@ type output ::
83
83
( path_or_uri :: String . t ( ) )
84
84
| { :mp4 , location :: String . t ( ) }
85
- | { :mp4 , location :: String . t ( ) , [ { :enforce_transcoding , enforce_transcoding_value ( ) } ] }
85
+ | { :mp4 , location :: String . t ( ) , [ { :force_transcoding , force_transcoding_value ( ) } ] }
86
86
| { :webrtc , webrtc_signaling ( ) }
87
- | { :webrtc , webrtc_signaling ( ) , [ { :enforce_transcoding , enforce_transcoding_value ( ) } ] }
87
+ | { :webrtc , webrtc_signaling ( ) , [ { :force_transcoding , force_transcoding_value ( ) } ] }
88
88
| { :whip , uri :: String . t ( ) , [ { :token , String . t ( ) } | { bandit_option :: atom ( ) , term ( ) } ] }
89
89
| { :hls , location :: String . t ( ) }
90
- | { :hls , location :: String . t ( ) , [ { :enforce_transcoding , enforce_transcoding_value ( ) } ] }
90
+ | { :hls , location :: String . t ( ) , [ { :force_transcoding , force_transcoding_value ( ) } ] }
91
91
| { :rtp , out_rtp_opts ( ) }
92
92
| { :stream , out_stream_opts ( ) }
93
93
@@ -135,7 +135,7 @@ defmodule Boombox do
135
135
opts
136
136
|> Keyword . validate! ( @ endpoint_opts )
137
137
|> Map . new ( fn { key , value } -> { key , parse_endpoint_opt! ( key , value ) } end )
138
- |> resolve_enforce_transcoding ( )
138
+ |> resolve_force_transcoding ( )
139
139
140
140
:ok = maybe_log_transcoding_related_warning ( opts )
141
141
@@ -275,11 +275,11 @@ defmodule Boombox do
275
275
@ spec maybe_log_transcoding_related_warning ( opts_map ( ) ) :: :ok
276
276
def maybe_log_transcoding_related_warning ( opts ) do
277
277
if is_webrtc_endpoint ( opts . output ) and not is_webrtc_endpoint ( opts . input ) and
278
- opts . enforce_transcoding not in [ true , :video ] do
278
+ opts . force_transcoding not in [ true , :video ] do
279
279
Logger . warning ( """
280
280
Boombox output protocol is WebRTC, while Boombox input doesn't support keyframe requests. This \
281
281
might lead to issues with the output video if the output stream isn't sent only by localhost. You \
282
- can solve this by setting `:enforce_transcoding ` output option to `true` or `:video`, but be aware \
282
+ can solve this by setting `:force_transcoding ` output option to `true` or `:video`, but be aware \
283
283
that it will increase Boombox CPU usage.
284
284
""" )
285
285
end
@@ -421,17 +421,17 @@ defmodule Boombox do
421
421
end
422
422
end
423
423
424
- defp resolve_enforce_transcoding ( opts ) do
424
+ defp resolve_force_transcoding ( opts ) do
425
425
maybe_keyword =
426
426
opts . output
427
427
|> Tuple . to_list ( )
428
428
|> List . last ( )
429
429
430
- enforce_transcoding =
431
- Keyword . keyword? ( maybe_keyword ) && Keyword . get ( maybe_keyword , :enforce_transcoding , false )
430
+ force_transcoding =
431
+ Keyword . keyword? ( maybe_keyword ) && Keyword . get ( maybe_keyword , :force_transcoding , false )
432
432
433
433
opts
434
- |> Map . put ( :enforce_transcoding , enforce_transcoding )
434
+ |> Map . put ( :force_transcoding , force_transcoding )
435
435
|> Map . update! ( :output , fn
436
436
{ :webrtc , signaling , _opts } -> { :webrtc , signaling }
437
437
{ :hls , location , _opts } -> { :hls , location }
0 commit comments