| 1 |
import cython |
| 2 |
from cython.cimports.av.packet import Packet |
| 3 |
from cython.cimports.av.stream import Stream |
| 4 |
|
| 5 |
|
| 6 |
@cython.final |
| 7 |
@cython.cclass |
| 8 |
class SubtitleStream(Stream): |
| 9 |
def __getattr__(self, name): |
| 10 |
return getattr(self.codec_context, name) |
| 11 |
|
| 12 |
@cython.ccall |
| 13 |
def decode(self, packet: Packet | None = None): |
| 14 |
""" |
| 15 |
Decode a :class:`.Packet` and returns a subtitle object. |
| 16 |
|
| 17 |
:rtype: list[AssSubtitle] | list[BitmapSubtitle] |
| 18 |
|
| 19 |
.. seealso:: This is a passthrough to :meth:`.CodecContext.decode`. |
| 20 |
""" |
| 21 |
if not packet: |
| 22 |
packet = Packet() |
| 23 |
|
| 24 |
return self.codec_context.decode(packet) |