Skip to content

Commit dd60c19

Browse files
mat-hekConnorRigby
authored andcommitted
fix filter caps, add moduledoc
1 parent 6c8db9e commit dd60c19

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

lib/turbojpeg/filter.ex

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
defmodule Turbojpeg.Filter do
2+
@moduledoc """
3+
Membrane filter converting raw video frames to JPEG.
4+
"""
25
use Membrane.Filter
36
alias Membrane.Buffer
47

58
def_input_pad :input, demand_unit: :buffers, caps: Membrane.Caps.Video.Raw
6-
def_output_pad :output, caps: Membrane.Caps.Video.Raw
9+
# TODO: implement JPEG caps
10+
def_output_pad :output, caps: :any
711

812
def_options quality: [
913
type: :integer,
1014
spec: Turbojpeg.quality(),
11-
default: 80,
15+
default: 100,
1216
description: "Jpeg encoding quality"
1317
]
1418

@@ -17,6 +21,11 @@ defmodule Turbojpeg.Filter do
1721
{{:ok, demand: {:input, size}}, state}
1822
end
1923

24+
@impl true
25+
def handle_caps(:input, _caps, _ctx, state) do
26+
{:ok, state}
27+
end
28+
2029
@impl true
2130
def handle_process(:input, buffer, ctx, state) do
2231
%{caps: caps} = ctx.pads.input

0 commit comments

Comments
 (0)