Skip to content

Commit 42be5f9

Browse files
committed
support remote stream with vp8
1 parent f40c4de commit 42be5f9

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

,

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2025 feliks
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+

lib/transcoder/video.ex

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ defmodule Membrane.Transcoder.Video do
33

44
import Membrane.ChildrenSpec
55
require Membrane.Logger
6-
alias Membrane.{ChildrenSpec, H264, H265, RawVideo, VP8}
6+
alias Membrane.{ChildrenSpec, H264, H265, RawVideo, RemoteStream, VP8}
77

88
@type video_stream_format :: VP8.t() | H264.t() | H265.t() | RawVideo.t()
99

1010
defguard is_video_format(format)
11-
when is_struct(format) and format.__struct__ in [VP8, H264, H265, RawVideo]
11+
when is_struct(format) and
12+
(format.__struct__ in [VP8, H264, H265, RawVideo] or
13+
(format.__struct__ == RemoteStream and format.content_format == VP8 and
14+
format.type == :packetized))
1215

1316
@spec plug_video_transcoding(
1417
ChildrenSpec.builder(),
@@ -69,6 +72,13 @@ defmodule Membrane.Transcoder.Video do
6972
builder |> child(:vp8_decoder, %VP8.Decoder{})
7073
end
7174

75+
defp maybe_plug_parser_and_decoder(builder, %RemoteStream{
76+
content_format: VP8,
77+
type: :packetized
78+
}) do
79+
builder |> child(:vp8_decoder, %VP8.Decoder{})
80+
end
81+
7282
defp maybe_plug_parser_and_decoder(builder, %RawVideo{}) do
7383
builder
7484
end

0 commit comments

Comments
 (0)