|
1 | | -from libc.limits cimport INT_MAX |
2 | | - |
3 | | -from cpython cimport Py_INCREF, PyTuple_New, PyTuple_SET_ITEM |
4 | | - |
5 | | -from av.plane cimport Plane |
6 | 1 | from av.utils cimport avrational_to_fraction, to_avrational |
7 | 2 |
|
8 | 3 | from fractions import Fraction |
@@ -33,29 +28,6 @@ cdef class Frame(object): |
33 | 28 | self.pts, |
34 | 29 | ) |
35 | 30 |
|
36 | | - cdef _init_planes(self, cls=Plane): |
37 | | - |
38 | | - # We need to detect which planes actually exist, but also contrain |
39 | | - # ourselves to the maximum plane count (as determined only by VideoFrames |
40 | | - # so far), in case the library implementation does not set the last |
41 | | - # plane to NULL. |
42 | | - cdef int max_plane_count = self._max_plane_count() |
43 | | - cdef int plane_count = 0 |
44 | | - while plane_count < max_plane_count and self.ptr.extended_data[plane_count]: |
45 | | - plane_count += 1 |
46 | | - |
47 | | - self.planes = PyTuple_New(plane_count) |
48 | | - for i in range(plane_count): |
49 | | - # We are constructing this tuple manually, but since Cython does |
50 | | - # not understand reference stealing we must manually Py_INCREF |
51 | | - # so that when Cython Py_DECREFs it doesn't release our object. |
52 | | - plane = cls(self, i) |
53 | | - Py_INCREF(plane) |
54 | | - PyTuple_SET_ITEM(self.planes, i, plane) |
55 | | - |
56 | | - cdef int _max_plane_count(self): |
57 | | - return INT_MAX |
58 | | - |
59 | 31 | cdef _copy_internal_attributes(self, Frame source, bint data_layout=True): |
60 | 32 | """Mimic another frame.""" |
61 | 33 | self.index = source.index |
|
0 commit comments