Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename FrameCompositor implementations' files #7

Merged
merged 1 commit into from
Aug 9, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ defmodule Membrane.VideoCompositor.FFMPEG do
alias Membrane.VideoCompositor.FFmpeg.Native, as: FFmpeg
alias Membrane.VideoCompositor.FFmpeg.Native.RawVideo, as: NativeRawVideo

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def init(caps) do
{:ok, video} = NativeRawVideo.from_membrane_raw_video(caps)
videos = [video, video]

FFmpeg.init(videos)
end

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def merge_frames(frames, state_of_init_module) do
frames = [frames.first, frames.second]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Membrane.VideoCompositor.FFMPEG.Research do
alias Membrane.VideoCompositor.FFmpeg.Native, as: FFmpeg
alias Membrane.VideoCompositor.FFmpeg.Native.RawVideo, as: NativeRawVideo

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def init(caps) do
{:ok, video} = NativeRawVideo.from_membrane_raw_video(caps)

Expand All @@ -17,7 +17,7 @@ defmodule Membrane.VideoCompositor.FFMPEG.Research do
{:ok, %{state: internal_state, iter: 1, raw_video: video}}
end

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def merge_frames(frames, state_of_init_module) do
%{state: internal_state, iter: iter} = state_of_init_module

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ defmodule Membrane.VideoCompositor.Nx do
"""
@behaviour Membrane.VideoCompositor.FrameCompositor

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def init(caps) do
{:ok, caps}
end

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def merge_frames(frames, internal_state) do
first_frame_nxtensor = Nx.from_binary(frames.first, {:u, 8})
second_frame_nxtensor = Nx.from_binary(frames.second, {:u, 8})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ defmodule Membrane.VideoCompositor.OpenGL do

@behaviour Membrane.VideoCompositor.FrameCompositor

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def init(_caps) do
{:ok, %{}}
end

@impl Membrane.VideoCompositor.FrameCompositor
@impl true
def merge_frames(frames, internal_state) do
merged_frames_binary = frames.first <> frames.second
{{:ok, merged_frames_binary}, internal_state}
Expand Down