Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Membrane.Time API #494

Merged
merged 7 commits into from
Dec 20, 2022
Merged

Update Membrane.Time API #494

merged 7 commits into from
Dec 20, 2022

Conversation

FelonEkonom
Copy link
Member

@FelonEkonom FelonEkonom commented Dec 8, 2022

@FelonEkonom FelonEkonom self-assigned this Dec 8, 2022
@FelonEkonom FelonEkonom marked this pull request as ready for review December 8, 2022 14:51
@@ -229,16 +229,16 @@ defmodule Membrane.Time do
end

@doc """
Returns timestamp in timebase units. Rounded to the nearest integer.
Divides timestamp by timebase. Rounded to the nearest integer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Divides timestamp by timebase. Rounded to the nearest integer.
Divides timestamp by a timebase. The result is rounded to the nearest integer.

Comment on lines 273 to 276
Returns time in #{unit.plural}. If second argument is not provided
or is equal to `:exact`, result is represented as a rational number.
If second argument is equal to `:round`, result is rounded to the
nearest integer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid the statement if second argument is not provided and instead I would stick to saying that "the default value of the second argument is :exact"

Comment on lines 273 to 276
Returns time in #{unit.plural}. The default value of the second argument
is `:exact`. If the second argument is equal to `:exact`, the result is
represented as a rational number. Otherwise, if the second argument is
equal to `:round`, the result is rounded to the nearest integer.
Copy link
Member

@mat-hek mat-hek Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Returns time in #{unit.plural}. The default value of the second argument
is `:exact`. If the second argument is equal to `:exact`, the result is
represented as a rational number. Otherwise, if the second argument is
equal to `:round`, the result is rounded to the nearest integer.
Returns time in #{unit.plural}.
If the `mode` argument is set to `:exact` (default), the result is
represented as a rational number. Otherwise, if the `mode` is
`:round`, the result is rounded to the nearest integer.

"""
@spec unquote(as_fun_name)(t) :: integer | Ratio.t()
@spec unquote(as_fun_name)(t, :round | :exact) :: integer | Ratio.t()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@spec unquote(as_fun_name)(t, :round | :exact) :: integer | Ratio.t()
@spec unquote(as_fun_name)(t, mode :: :round | :exact) :: integer | Ratio.t()

## 0.11.0
* Separate element_name and pad arguments in handle_element_{start, end}_of_stream signature [#219](https://github.com/membraneframework/membrane_core/issues/219)
* Refine communication between parent and its children [#270](https://github.com/membraneframework/membrane_core/issues/270)
* Add `handle_call/3` callback in the pipeline, as well as a `:reply` and `:reply_to` actions. Rename `handle_other/3` callback into `handle_info/3` [#334](https://github.com/membraneframework/membrane_core/issues/334)
* Add `Membrane.FilterAggregator` that allows to run multiple filters sequentially within one process. [#355](https://github.com/membraneframework/membrane_core/pull/355)
* Log info about element's playback state change as debug, not as debug_verbose. [#430](https://github.com/membraneframework/membrane_core/pull/430)
* Rename `Membrane.Time.to_<unit name>/1` into `Membrane.Time.round_to_<unit name>/1` to indicate that the result will be rounded. Make `Membrane.Time.<plural unit name>/1` accept `%Ratio{}` as an argument. Add `Membrane.Time.round_to_timebase/2` function.
* Rename `Membrane.Time.to_<unit name>/1` into `Membrane.Time.round_to_<unit name>/1` to indicate that the result will be rounded. Make `Membrane.Time.<plural unit name>/1` accept `%Ratio{}` as an argument. Add `Membrane.Time.round_to_timebase` function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you modifying 0.11.0 changelog? The Membrane.Time.round_to_timebase/2 was in fact added then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FelonEkonom FelonEkonom merged commit 48b197b into master Dec 20, 2022
@FelonEkonom FelonEkonom deleted the update-time-api branch December 20, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants