Skip to content
Merged
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
1 change: 1 addition & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
matrix:
config:
- {os: ubuntu-24.04, python: "3.12", ffmpeg: "8.0.1", extras: true}
- {os: ubuntu-24.04, python: "3.10", ffmpeg: "8.0.1"}
- {os: ubuntu-24.04, python: "pypy3.11", ffmpeg: "8.0.1"}
- {os: macos-14, python: "3.11", ffmpeg: "8.0.1"}

Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ jobs:
pip install -U cython setuptools
python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor
PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig python setup.py sdist
- name: Publish to PyPI
if: github.event_name == 'release' && github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
- name: Upload source package
uses: actions/upload-artifact@v6
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
name: dist-source
path: dist/

package-wheel:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -73,20 +72,29 @@ jobs:
cibuildwheel --output-dir dist
shell: bash
- name: Upload wheels
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: dist-${{ matrix.os }}-${{ matrix.arch }}
path: dist/

publish:
runs-on: ubuntu-latest
needs: [package-wheel]
needs: [package-source, package-wheel]
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v7
with:
merge-multiple: true
path: dist/

- name: Publish to GitHub
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to PyPI
if: github.event_name == 'release' && github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
4 changes: 2 additions & 2 deletions av/video/reformatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ def _reformat(
with cython.nogil:
lib.sws_scale(
self.ptr,
frame.ptr.data,
frame.ptr.linesize,
cython.cast("const unsigned char *const *", frame.ptr.data),
cython.cast("const int *", frame.ptr.linesize),
0, # slice Y
frame.ptr.height,
new_frame.ptr.data,
Expand Down
15 changes: 4 additions & 11 deletions include/libswscale/swscale.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from libc.stdint cimport uint8_t

cdef extern from "libswscale/swscale.h" nogil:

cdef int swscale_version()
cdef char* swscale_configuration()
cdef char* swscale_license()
Expand All @@ -13,7 +13,6 @@ cdef extern from "libswscale/swscale.h" nogil:
cdef struct SwsFilter:
pass

# Flags.
cdef int SWS_FAST_BILINEAR
cdef int SWS_BILINEAR
cdef int SWS_BICUBIC
Expand All @@ -25,7 +24,6 @@ cdef extern from "libswscale/swscale.h" nogil:
cdef int SWS_SINC
cdef int SWS_LANCZOS
cdef int SWS_SPLINE

cdef int SWS_CS_ITU709
cdef int SWS_CS_FCC
cdef int SWS_CS_ITU601
Expand All @@ -36,16 +34,14 @@ cdef extern from "libswscale/swscale.h" nogil:

cdef int sws_scale(
SwsContext *ctx,
const unsigned char *const *src_slice,
const uint8_t *const *src_slice,
const int *src_stride,
int src_slice_y,
int src_slice_h,
unsigned char *const *dst_slice,
int *dst_stride,
const int *dst_stride,
)

cdef void sws_freeContext(SwsContext *ctx)

cdef SwsContext *sws_getCachedContext(
SwsContext *context,
int src_width,
Expand All @@ -59,9 +55,7 @@ cdef extern from "libswscale/swscale.h" nogil:
SwsFilter *dst_filter,
double *param,
)

cdef int* sws_getCoefficients(int colorspace)

cdef const int* sws_getCoefficients(int colorspace)
cdef int sws_getColorspaceDetails(
SwsContext *context,
int **inv_table,
Expand All @@ -72,7 +66,6 @@ cdef extern from "libswscale/swscale.h" nogil:
int *contrast,
int *saturation
)

cdef int sws_setColorspaceDetails(
SwsContext *context,
const int inv_table[4],
Expand Down
Loading