forked from PyAV-Org/PyAV
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
291 additions
and
1,823 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "12.0.4" | ||
__version__ = "12.0.5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
from av.packet cimport Packet | ||
from av.stream cimport Stream | ||
|
||
from .frame cimport AudioFrame | ||
|
||
|
||
cdef class AudioStream(Stream): | ||
pass | ||
cpdef encode(self, AudioFrame frame=?) | ||
cpdef decode(self, Packet packet=?) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,40 @@ | ||
from av.packet cimport Packet | ||
|
||
from .frame cimport AudioFrame | ||
|
||
|
||
cdef class AudioStream(Stream): | ||
def __repr__(self): | ||
form = self.format.name if self.format else None | ||
return ( | ||
f"<av.{self.__class__.__name__} #{self.index} {self.name} at {self.rate}Hz," | ||
f"<av.AudioStream #{self.index} {self.name} at {self.rate}Hz," | ||
f" {self.layout.name}, {form} at 0x{id(self):x}>" | ||
) | ||
|
||
cpdef encode(self, AudioFrame frame=None): | ||
""" | ||
Encode an :class:`.AudioFrame` and return a list of :class:`.Packet`. | ||
:rtype: list[Packet] | ||
.. seealso:: This is mostly a passthrough to :meth:`.CodecContext.encode`. | ||
""" | ||
|
||
packets = self.codec_context.encode(frame) | ||
cdef Packet packet | ||
for packet in packets: | ||
packet._stream = self | ||
packet.ptr.stream_index = self.ptr.index | ||
|
||
return packets | ||
|
||
cpdef decode(self, Packet packet=None): | ||
""" | ||
Decode a :class:`.Packet` and return a list of :class:`.AudioFrame`. | ||
:rtype: list[AudioFrame] | ||
.. seealso:: This is a passthrough to :meth:`.CodecContext.decode`. | ||
""" | ||
|
||
return self.codec_context.decode(packet) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,4 +33,4 @@ class TextSubtitle(Subtitle): | |
|
||
class AssSubtitle(Subtitle): | ||
type: Literal[b"ass"] | ||
ass: str | ||
ass: bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.