File: stream.py

package info (click to toggle)
python-av 16.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,684 kB
  • sloc: python: 7,607; sh: 182; ansic: 174; makefile: 135
file content (23 lines) | stat: -rw-r--r-- 631 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import cython
from cython.cimports.av.packet import Packet
from cython.cimports.av.stream import Stream


@cython.cclass
class SubtitleStream(Stream):
    def __getattr__(self, name):
        return getattr(self.codec_context, name)

    @cython.ccall
    def decode(self, packet: Packet | None = None):
        """
        Decode a :class:`.Packet` and returns a subtitle object.

        :rtype: list[AssSubtitle] | list[BitmapSubtitle]

        .. seealso:: This is a passthrough to :meth:`.CodecContext.decode`.
        """
        if not packet:
            packet = Packet()

        return self.codec_context.decode(packet)