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

Add more type definitions for AudioFormat and AudioCodecContext #1436

Merged
merged 3 commits into from
Jun 21, 2024

Conversation

jlaine
Copy link
Member

@jlaine jlaine commented Jun 21, 2024

No description provided.

The docstrings contained examples referring to erroneous class names
instead of `AudioFormat`.
The `encode`, `encode_lazy` and `decode` methods were missing type
definitions.
It does not make sense to special-case the `Packet` class concerning
buffer protocol support, we have multiple classes inhering our `Buffer`
class:

- `Packet`
- `Plane` and its subclasses `AudioPlane` and `VideoPlane`
- `SideData`

We cannot use `collection.abc.Buffer`, yet as this is only available in
Python 3.12 and up. We do however want to declare that `bytes(foo)` is
available, so declare a `__bytes__` method in `Buffer`.
@jlaine jlaine merged commit 5c5e31b into PyAV-Org:main Jun 21, 2024
7 checks passed
@jlaine jlaine deleted the typing branch June 21, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant