File: pyio.pxd

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 (24 lines) | stat: -rw-r--r-- 729 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
cimport libav as lib
from libc.stdint cimport int64_t, uint8_t


cdef int pyio_read(void *opaque, uint8_t *buf, int buf_size) noexcept nogil
cdef int pyio_write(void *opaque, const uint8_t *buf, int buf_size) noexcept nogil
cdef int64_t pyio_seek(void *opaque, int64_t offset, int whence) noexcept nogil
cdef int pyio_close_gil(lib.AVIOContext *pb)
cdef int pyio_close_custom_gil(lib.AVIOContext *pb)

cdef class PyIOFile:
    # File-like source.
    cdef readonly object file
    cdef object fread
    cdef object fwrite
    cdef object fseek
    cdef object ftell
    cdef object fclose

    # Custom IO for above.
    cdef lib.AVIOContext *iocontext
    cdef unsigned char *buffer
    cdef long pos
    cdef bint pos_is_valid