From b9a4f605a750cf27b6ff835e9cf8a294726ee953 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20B=C5=82aszk=C3=B3w?= Date: Mon, 21 Feb 2022 23:01:15 +0100 Subject: [PATCH] dims -> dimensions --- lib/membrane_raw_video.ex | 6 +++--- test/membrane_raw_video_test.exs | 36 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) 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