Skip to content
Closed

add sei #1907

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
workflow_dispatch:
jobs:
package-source:
runs-on: ubuntu-24.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
python-version: "3.12"
- name: Build source package
run: |
pip install -U --pre cython setuptools
Expand All @@ -28,32 +28,32 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-14
arch: arm64
- os: macos-13
arch: x86_64
- os: ubuntu-24.04-arm
arch: aarch64
- os: ubuntu-24.04
arch: i686
#- os: macos-14
# arch: arm64
#- os: macos-13
# arch: x86_64
#- os: ubuntu-24.04-arm
# arch: aarch64
#- os: ubuntu-24.04
# arch: i686
- os: ubuntu-24.04
arch: x86_64
- os: windows-latest
arch: AMD64
#- os: windows-latest
# arch: AMD64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install packages
if: matrix.os == 'macos-13'
run: |
brew update
brew install pkg-config
- name: Set Minimum MacOS Target
if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=12.0" >> $GITHUB_ENV
python-version: "3.12"
# - name: Install packages
# if: matrix.os == 'macos-13'
# run: |
# brew update
# brew install pkg-config
# - name: Set Minimum MacOS Target
# if: matrix.os == 'macos-13' || matrix.os == 'macos-14'
# run: |
# echo "MACOSX_DEPLOYMENT_TARGET=12.0" >> $GITHUB_ENV
- name: Build wheels
env:
CIBW_ARCHS: ${{ matrix.arch }}
Expand Down
16 changes: 16 additions & 0 deletions av/sidedata/sidedata.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ from collections.abc import Mapping
from enum import Enum

from av.sidedata.motionvectors import MotionVectors
from libc.string cimport memcpy

from av.bytesource cimport ByteSource, bytesource

cdef object _cinit_bypass_sentinel = object()

Expand Down Expand Up @@ -110,6 +112,20 @@ cdef class _SideDataContainer:
if isinstance(key, str):
return self._by_type[Type[key]]
return self._by_type[key]

def add(self,buffer,type):
# Add Frame side data
cdef ByteSource source = bytesource(buffer)
i = self.frame.ptr.nb_side_data
lib.av_frame_make_writable(self.frame.ptr)
ptr = lib.av_frame_new_side_data(self.frame.ptr, type, source.length)

memcpy(ptr.data, source.ptr, source.length)

# Update side data
cdef SideData data = wrap_side_data(self.frame, i)
self._by_index.append(data)
self._by_type[data.type] = data


class SideDataContainer(_SideDataContainer, Mapping):
Expand Down
1 change: 1 addition & 0 deletions include/libavutil/frame.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ cdef extern from "libavutil/frame.h" nogil:
cdef int av_frame_copy(AVFrame *dst, const AVFrame *src)
cdef int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
cdef AVFrameSideData* av_frame_get_side_data(AVFrame *frame, AVFrameSideDataType type)
cdef AVFrameSideData * av_frame_new_side_data(AVFrame *frame, AVFrameSideDataType type, int size)
Loading