diff --git a/av/stream.pxd b/av/stream.pxd index 8ebda5704..d39585167 100644 --- a/av/stream.pxd +++ b/av/stream.pxd @@ -21,7 +21,6 @@ cdef class Stream: # Private API. cdef _init(self, Container, lib.AVStream*, CodecContext) cdef _finalize_for_output(self) - cdef _get_side_data(self, lib.AVStream *stream) cdef _set_time_base(self, value) cdef _set_id(self, value) diff --git a/av/stream.pyi b/av/stream.pyi index 212c721a9..89f49c12f 100644 --- a/av/stream.pyi +++ b/av/stream.pyi @@ -20,8 +20,6 @@ class Stream: metadata: dict[str, str] id: int profile: str - nb_side_data: int - side_data: dict[str, str] index: int time_base: Fraction | None average_rate: Fraction | None diff --git a/av/stream.pyx b/av/stream.pyx index 44354b651..19ac8e703 100644 --- a/av/stream.pyx +++ b/av/stream.pyx @@ -85,8 +85,6 @@ cdef class Stream: self.codec_context = codec_context if self.codec_context: self.codec_context.stream_index = stream.index - - self.nb_side_data, self.side_data = self._get_side_data(stream) self.metadata = avdict_to_dict( stream.metadata, @@ -128,20 +126,6 @@ cdef class Stream: # Lets just copy what we want. err_check(lib.avcodec_parameters_from_context(self.ptr.codecpar, self.codec_context.ptr)) - cdef _get_side_data(self, lib.AVStream *stream): - # Get DISPLAYMATRIX SideData from a lib.AVStream object. - # Returns: tuple[int, dict[str, Any]] - - nb_side_data = stream.nb_side_data - side_data = {} - - for i in range(nb_side_data): - # Based on: https://www.ffmpeg.org/doxygen/trunk/dump_8c_source.html#l00430 - if stream.side_data[i].type == lib.AV_PKT_DATA_DISPLAYMATRIX: - side_data["DISPLAYMATRIX"] = lib.av_display_rotation_get(stream.side_data[i].data) - - return nb_side_data, side_data - @property def id(self): """ diff --git a/include/libavformat/avformat.pxd b/include/libavformat/avformat.pxd index 1e16378bf..5fa25043a 100644 --- a/include/libavformat/avformat.pxd +++ b/include/libavformat/avformat.pxd @@ -46,10 +46,6 @@ cdef extern from "libavformat/avformat.h" nogil: AVRational r_frame_rate AVRational sample_aspect_ratio - int nb_side_data - AVPacketSideData *side_data - - # http://ffmpeg.org/doxygen/trunk/structAVIOContext.html cdef struct AVIOContext: unsigned char* buffer diff --git a/include/libavutil/avutil.pxd b/include/libavutil/avutil.pxd index 58dd43922..ed281aeaf 100644 --- a/include/libavutil/avutil.pxd +++ b/include/libavutil/avutil.pxd @@ -4,9 +4,6 @@ from libc.stdint cimport int64_t, uint8_t, uint64_t, int32_t cdef extern from "libavutil/mathematics.h" nogil: pass -cdef extern from "libavutil/display.h" nogil: - cdef double av_display_rotation_get(const int32_t matrix[9]) - cdef extern from "libavutil/rational.h" nogil: cdef int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max) diff --git a/tests/test_streams.py b/tests/test_streams.py index 64bb63c36..b6097d537 100644 --- a/tests/test_streams.py +++ b/tests/test_streams.py @@ -35,15 +35,9 @@ def test_selection(self) -> None: data = container.streams.data[0] assert data == container.streams.best("data") - def test_noside_data(self) -> None: - container = av.open(fate_suite("h264/interlaced_crop.mp4")) - video = container.streams.video[0] - - assert video.nb_side_data == 0 - - def test_side_data(self) -> None: - container = av.open(fate_suite("mov/displaymatrix.mov")) - video = container.streams.video[0] + # def test_side_data(self) -> None: + # container = av.open(fate_suite("mov/displaymatrix.mov")) + # video = container.streams.video[0] - assert video.nb_side_data == 1 - assert video.side_data["DISPLAYMATRIX"] == -90.0 + # assert video.nb_side_data == 1 + # assert video.side_data["DISPLAYMATRIX"] == -90.0