Skip to content

Commit

Permalink
Merge pull request #82 from membraneframework/release-fix
Browse files Browse the repository at this point in the history
Release fix
  • Loading branch information
mat-hek authored Feb 7, 2023
2 parents 492a513 + f7e2724 commit 18273f8
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 26 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/membrane_video_compositor_plugin) -->
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/membraneframework-labs/membrane_video_compositor_plugin/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/membraneframework-labs/membrane_video_compositor_plugin/tree/master)

Membrane plugin that accepts multiple video inputs, transforms them according to provided transformations and composes them into a single output video.

It is part of [Membrane Multimedia Framework](https://membraneframework.org).

## Installation
Expand Down
20 changes: 9 additions & 11 deletions lib/membrane/video_compositor/compositor_element.ex
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
defmodule Membrane.VideoCompositor.CompositorElement do
@moduledoc """
The element responsible for composing frames.
@moduledoc false
# The element responsible for composing frames.

It is capable of operating in one of two modes:
# It is capable of operating in one of two modes:

* offline compositing:
The compositor will wait for all videos to have a recent enough frame available and then perform the compositing.
# * offline compositing:
# The compositor will wait for all videos to have a recent enough frame available and then perform the compositing.

* real-time compositing:
In this mode, if the compositor will start a timer ticking every spf (seconds per frame). The timer is reset every time a frame is produced.
If the compositor doesn't have all frames ready by the time the timer ticks, it will produce a frame anyway, using old frames as fallback in cases when a current frame is not available.
If the frames arrive later, they will be dropped. The newest dropped frame will become the new fallback frame.
"""
# * real-time compositing:
# In this mode, if the compositor will start a timer ticking every spf (seconds per frame). The timer is reset every time a frame is produced.
# If the compositor doesn't have all frames ready by the time the timer ticks, it will produce a frame anyway, using old frames as fallback in cases when a current frame is not available.
# If the frames arrive later, they will be dropped. The newest dropped frame will become the new fallback frame.

use Membrane.Filter
alias Membrane.Buffer
Expand Down
5 changes: 2 additions & 3 deletions lib/membrane/video_compositor/rust_structs/raw_video.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
defmodule Membrane.VideoCompositor.RustStructs.RawVideo do
@moduledoc """
A RawVideo struct describing the video format for use with the rust-based compositor.
"""
@moduledoc false
# A RawVideo struct describing the video format for use with the rust-based compositor.

@typedoc """
Pixel format of the video
Expand Down
7 changes: 3 additions & 4 deletions lib/membrane/video_compositor/video_compositor.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ defmodule Membrane.VideoCompositor do
use Membrane.Bin
alias Membrane.FramerateConverter
alias Membrane.Pad
alias Membrane.RawVideo
alias Membrane.VideoCompositor.CompositorElement
alias Membrane.VideoCompositor.RustStructs.BaseVideoPlacement
alias Membrane.VideoCompositor.VideoTransformations
Expand All @@ -24,7 +23,7 @@ defmodule Membrane.VideoCompositor do
{:update_transformations, [{Membrane.Pad.ref_t(), VideoTransformations.t()}]}

def_options stream_format: [
spec: RawVideo.t(),
spec: Membrane.RawVideo.t(),
description: "Stream format for the output video of the compositor"
],
real_time: [
Expand All @@ -34,7 +33,7 @@ defmodule Membrane.VideoCompositor do
]

def_input_pad :input,
accepted_format: %RawVideo{pixel_format: :I420},
accepted_format: %Membrane.RawVideo{pixel_format: :I420},
availability: :on_request,
options: [
initial_placement: [
Expand All @@ -57,7 +56,7 @@ defmodule Membrane.VideoCompositor do
]

def_output_pad :output,
accepted_format: %RawVideo{pixel_format: :I420},
accepted_format: %Membrane.RawVideo{pixel_format: :I420},
availability: :always

@impl true
Expand Down
6 changes: 3 additions & 3 deletions lib/membrane/video_compositor/wgpu/native.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Membrane.VideoCompositor.Wgpu.Native do
@moduledoc """
Module with Rust NIFs - direct Rust communication.
"""
@moduledoc false
# Module with Rust NIFs - direct Rust communication.

use Rustler,
otp_app: :membrane_video_compositor_plugin,
crate: "membrane_videocompositor"
Expand Down
4 changes: 1 addition & 3 deletions lib/membrane/video_compositor/wgpu/wgpu_adapter.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
defmodule Membrane.VideoCompositor.WgpuAdapter do
@moduledoc """
This module implements video composition in wgpu
"""
@moduledoc false

alias Membrane.VideoCompositor.RustStructs
alias Membrane.VideoCompositor.VideoTransformations
Expand Down
18 changes: 16 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ defmodule Membrane.VideoCompositor.Mixfile do
links: %{
"GitHub" => @github_url,
"Membrane Framework Homepage" => "https://membraneframework.org"
}
},
files:
["lib", "mix.exs", "README*", "LICENSE*", ".formatter.exs"] ++
Enum.map(
["src", ".cargo/config", "Cargo.toml", "Cargo.lock"],
&"native/membrane_videocompositor/#{&1}"
)
]
end

Expand All @@ -88,7 +94,15 @@ defmodule Membrane.VideoCompositor.Mixfile do
extras: ["README.md", "LICENSE"],
formatters: ["html"],
source_ref: "v#{@version}",
nest_modules_by_prefix: [Membrane.VideoCompositor]
nest_modules_by_prefix: [
Membrane.VideoCompositor,
Membrane.VideoCompositor.VideoTransformations
],
groups_for_modules: [
"Video transformations": [
~r/^Membrane\.VideoCompositor\.VideoTransformations($|\.)/
]
]
]
end
end

0 comments on commit 18273f8

Please sign in to comment.