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 docstrings for vpush and vpull #1444

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all 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
2 changes: 2 additions & 0 deletions av/filter/graph.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ cdef class Graph:
ctx.push(frame)

def vpush(self, VideoFrame frame):
"""Like `push`, but only for VideoFrames."""
for ctx in self._context_by_type.get("buffer", []):
ctx.push(frame)

Expand All @@ -194,6 +195,7 @@ cdef class Graph:
return (vsinks or asinks)[0].pull()

def vpull(self):
"""Like `pull`, but only for VideoFrames."""
vsinks = self._context_by_type.get("buffersink", [])
nsinks = len(vsinks)
if nsinks != 1:
Expand Down
Loading