diff --git a/lib/membrane_raw_video.ex b/lib/membrane_raw_video.ex index a7fb768..b92b5f7 100644 --- a/lib/membrane_raw_video.ex +++ b/lib/membrane_raw_video.ex @@ -51,7 +51,7 @@ defmodule Membrane.RawVideo do in bytes for the given caps. """ @spec frame_size(t()) :: {:ok, pos_integer()} | {:error, reason} - when reason: :invalid_dims | :invalid_pixel_format + when reason: :invalid_dimensions | :invalid_pixel_format def frame_size(%__MODULE__{pixel_format: format, width: width, height: height}) do frame_size(format, width, height) end @@ -64,7 +64,7 @@ defmodule Membrane.RawVideo do """ @spec frame_size(pixel_format_t(), width_t(), height_t()) :: {:ok, pos_integer()} | {:error, reason} - when reason: :invalid_dims | :invalid_pixel_format + when reason: :invalid_dimensions | :invalid_pixel_format def frame_size(format, width, height) when format in [:I420, :YV12, :NV12, :NV21] and Integer.is_even(width) and Integer.is_even(height) do @@ -92,7 +92,7 @@ defmodule Membrane.RawVideo do end def frame_size(format, _width, _height) when format in @supported_pixel_formats do - {:error, :invalid_dims} + {:error, :invalid_dimensions} end def frame_size(_format, _width, _height) do diff --git a/test/membrane_raw_video_test.exs b/test/membrane_raw_video_test.exs index 1def7f0..9043bb6 100644 --- a/test/membrane_raw_video_test.exs +++ b/test/membrane_raw_video_test.exs @@ -15,22 +15,22 @@ defmodule Membrane.RawVideo.Test do test "frame_size for :I420 format" do format = :I420 assert @module.frame_size(format, 10, 20) == {:ok, 300} - assert @module.frame_size(format, 9, 20) == {:error, :invalid_dims} - assert @module.frame_size(format, 10, 19) == {:error, :invalid_dims} + assert @module.frame_size(format, 9, 20) == {:error, :invalid_dimensions} + assert @module.frame_size(format, 10, 19) == {:error, :invalid_dimensions} assert @module.frame_size(format_struct(format, 10, 20)) == {:ok, 300} - assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dims} - assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dims} + assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dimensions} + assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dimensions} end test "frame_size for :I422 format" do format = :I422 assert @module.frame_size(format, 10, 20) == {:ok, 400} - assert @module.frame_size(format, 9, 20) == {:error, :invalid_dims} + assert @module.frame_size(format, 9, 20) == {:error, :invalid_dimensions} assert @module.frame_size(format, 10, 19) == {:ok, 380} assert @module.frame_size(format_struct(format, 10, 20)) == {:ok, 400} - assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dims} + assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dimensions} assert @module.frame_size(format_struct(format, 10, 19)) == {:ok, 380} end @@ -81,34 +81,34 @@ defmodule Membrane.RawVideo.Test do test "frame_size for :NV12 format" do format = :NV12 assert @module.frame_size(format, 10, 20) == {:ok, 300} - assert @module.frame_size(format, 9, 20) == {:error, :invalid_dims} - assert @module.frame_size(format, 10, 19) == {:error, :invalid_dims} + assert @module.frame_size(format, 9, 20) == {:error, :invalid_dimensions} + assert @module.frame_size(format, 10, 19) == {:error, :invalid_dimensions} assert @module.frame_size(format_struct(format, 10, 20)) == {:ok, 300} - assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dims} - assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dims} + assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dimensions} + assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dimensions} end test "frame_size for :NV21 format" do format = :NV21 assert @module.frame_size(format, 10, 20) == {:ok, 300} - assert @module.frame_size(format, 9, 20) == {:error, :invalid_dims} - assert @module.frame_size(format, 10, 19) == {:error, :invalid_dims} + assert @module.frame_size(format, 9, 20) == {:error, :invalid_dimensions} + assert @module.frame_size(format, 10, 19) == {:error, :invalid_dimensions} assert @module.frame_size(format_struct(format, 10, 20)) == {:ok, 300} - assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dims} - assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dims} + assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dimensions} + assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dimensions} end test "frame_size for :YV12 format" do format = :YV12 assert @module.frame_size(format, 10, 20) == {:ok, 300} - assert @module.frame_size(format, 9, 20) == {:error, :invalid_dims} - assert @module.frame_size(format, 10, 19) == {:error, :invalid_dims} + assert @module.frame_size(format, 9, 20) == {:error, :invalid_dimensions} + assert @module.frame_size(format, 10, 19) == {:error, :invalid_dimensions} assert @module.frame_size(format_struct(format, 10, 20)) == {:ok, 300} - assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dims} - assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dims} + assert @module.frame_size(format_struct(format, 9, 20)) == {:error, :invalid_dimensions} + assert @module.frame_size(format_struct(format, 10, 19)) == {:error, :invalid_dimensions} end test "frame_size for :AYUV format" do