diff --git a/README.md b/README.md index f007ab3..f575787 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ reason, just add the following line to your `deps` in the `mix.exs` and run `mix deps.get`. ```elixir -{:membrane_raw_video_format, "~> 0.3.0"} +{:membrane_raw_video_format, "~> 0.4.0"} ``` ## Copyright and License diff --git a/lib/membrane_native/raw_video.ex b/lib/membrane_native/raw_video.ex index bd6df6a..95852df 100644 --- a/lib/membrane_native/raw_video.ex +++ b/lib/membrane_native/raw_video.ex @@ -9,21 +9,21 @@ defmodule Membrane.Native.RawVideo do A numerator of the number of frames per second. To avoid using tuple type, it is described by 2 separate integers number. """ - @type framerate_num_t :: non_neg_integer + @type framerate_num :: non_neg_integer @typedoc """ The denominator of the number of frames per second. To avoid using tuple type, it is described by 2 separate integers number. The default value is 1. """ - @type framerate_den_t :: pos_integer + @type framerate_den :: pos_integer @type t :: %__MODULE__{ - width: Membrane.RawVideo.width_t(), - height: Membrane.RawVideo.height_t(), - pixel_format: Membrane.RawVideo.pixel_format_t(), - framerate_num: framerate_num_t(), - framerate_den: framerate_den_t(), - aligned: Membrane.RawVideo.aligned_t() + width: Membrane.RawVideo.width(), + height: Membrane.RawVideo.height(), + pixel_format: Membrane.RawVideo.pixel_format(), + framerate_num: framerate_num(), + framerate_den: framerate_den(), + aligned: Membrane.RawVideo.aligned() } @enforce_keys [:width, :height, :pixel_format, :framerate_num, :aligned] defstruct width: nil, diff --git a/lib/membrane_raw_video.ex b/lib/membrane_raw_video.ex index 44a96b4..cb41e8b 100644 --- a/lib/membrane_raw_video.ex +++ b/lib/membrane_raw_video.ex @@ -9,12 +9,12 @@ defmodule Membrane.RawVideo do @typedoc """ Width of single frame in pixels. """ - @type width_t :: pos_integer() + @type width :: pos_integer() @typedoc """ Height of single frame in pixels. """ - @type height_t :: pos_integer() + @type height :: pos_integer() @typedoc """ Number of frames per second. To avoid using floating point numbers, @@ -22,25 +22,25 @@ defmodule Membrane.RawVideo do For example, NTSC's framerate of ~29.97 fps is represented by `{30_000, 1001}` """ - @type framerate_t :: {frames :: non_neg_integer, seconds :: pos_integer} + @type framerate :: {frames :: non_neg_integer, seconds :: pos_integer} @typedoc """ Format used to encode the color of every pixel in each video frame. """ - @type pixel_format_t :: + @type pixel_format :: :I420 | :I422 | :I444 | :RGB | :BGRA | :RGBA | :NV12 | :NV21 | :YV12 | :AYUV | :YUY2 @typedoc """ Determines, whether buffers are aligned i.e. each buffer contains one frame. """ - @type aligned_t :: boolean() + @type aligned :: boolean() @type t :: %__MODULE__{ - width: width_t(), - height: height_t(), - framerate: framerate_t(), - pixel_format: pixel_format_t(), - aligned: aligned_t() + width: width(), + height: height(), + framerate: framerate(), + pixel_format: pixel_format(), + aligned: aligned() } @enforce_keys [:width, :height, :framerate, :pixel_format, :aligned] @@ -76,7 +76,7 @@ defmodule Membrane.RawVideo do It may result in error when dimensions don't fulfill requirements for the given format (e.g. I420 requires both dimensions to be divisible by 2). """ - @spec frame_size(pixel_format_t(), width_t(), height_t()) :: + @spec frame_size(pixel_format(), width(), height()) :: {:ok, pos_integer()} | {:error, reason} when reason: :invalid_dimensions | :invalid_pixel_format def frame_size(format, width, height) diff --git a/mix.exs b/mix.exs index 07a3d29..dfbe49b 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Membrane.RawVideo.Mixfile do use Mix.Project - @version "0.3.0" + @version "0.4.0" @github_url "https://github.com/membraneframework/membrane_raw_video_format" def project do diff --git a/mix.lock b/mix.lock index 334044a..e438b69 100644 --- a/mix.lock +++ b/mix.lock @@ -1,7 +1,7 @@ %{ "bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"}, "credo": {:hex, :credo, "1.6.7", "323f5734350fd23a456f2688b9430e7d517afb313fbd38671b8a4449798a7854", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "41e110bfb007f7eda7f897c10bf019ceab9a0b269ce79f015d54b0dcf4fc7dd3"}, - "dialyxir": {:hex, :dialyxir, "1.2.0", "58344b3e87c2e7095304c81a9ae65cb68b613e28340690dfe1a5597fd08dec37", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "61072136427a851674cab81762be4dbeae7679f85b1272b6d25c3a839aff8463"}, + "dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"}, "earmark_parser": {:hex, :earmark_parser, "1.4.29", "149d50dcb3a93d9f3d6f3ecf18c918fb5a2d3c001b5d3305c926cddfbd33355b", [:mix], [], "hexpm", "4902af1b3eb139016aed210888748db8070b8125c2342ce3dcae4f38dcc63503"}, "erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"}, "ex_doc": {:hex, :ex_doc, "0.29.0", "4a1cb903ce746aceef9c1f9ae8a6c12b742a5461e6959b9d3b24d813ffbea146", [:mix], [{:earmark_parser, "~> 1.4.19", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "f096adb8bbca677d35d278223361c7792d496b3fc0d0224c9d4bc2f651af5db1"},