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 missing stub in av.sidedata #1308

Merged
merged 3 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions av/sidedata/motionvectors.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from typing import Any, Sequence

import numpy as np

from .sidedata import SideData

class _MotionVector(SideData):
Copy link
Member

Choose a reason for hiding this comment

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

_MotionVector is not supposed to be part of the Public API, so it's attributes should be merged with MotionVector

def __getitem__(self, index: int) -> MotionVector: ...
def __len__(self) -> int: ...
def to_ndarray(self) -> np.ndarray[Any, Any]: ...

class MotionVectors(_MotionVector, Sequence[Any]): ...

class MotionVector:
parent: _MotionVector
source: int
w: int
h: int
src_x: int
src_y: int
dst_x: int
dst_y: int
motion_x: int
motion_y: int
motion_scale: int
33 changes: 33 additions & 0 deletions av/sidedata/sidedata.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from collections.abc import Mapping

from av.buffer import Buffer
from av.enum import EnumItem
from av.frame import Frame

class Type(EnumItem):
PANSCAN: int
A53_CC: int
STEREO3D: int
MATRIXENCODING: int
DOWNMIX_INFO: int
REPLAYGAIN: int
DISPLAYMATRIX: int
AFD: int
MOTION_VECTORS: int
SKIP_SAMPLES: int
AUDIO_SERVICE_TYPE: int
MASTERING_DISPLAY_METADATA: int
GOP_TIMECODE: int
SPHERICAL: int
CONTENT_LIGHT_LEVEL: int
ICC_PROFILE: int
SEI_UNREGISTERED: int

class SideData(Buffer):
type: Type
DISPLAYMATRIX: int

class _SideDataContainer:
Copy link
Member

Choose a reason for hiding this comment

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

Same applies here

frame: Frame

class SideDataContainer(_SideDataContainer, Mapping[str, int]): ...
Loading