diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 218e36241..04f519a35 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -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"} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b4e1f45d..9cbdb6715 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 }} @@ -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 diff --git a/av/video/reformatter.py b/av/video/reformatter.py index dc898be84..e3e83d2d9 100644 --- a/av/video/reformatter.py +++ b/av/video/reformatter.py @@ -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, diff --git a/include/libswscale/swscale.pxd b/include/libswscale/swscale.pxd index 2d855d95a..ffc0eb6b0 100644 --- a/include/libswscale/swscale.pxd +++ b/include/libswscale/swscale.pxd @@ -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() @@ -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 @@ -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 @@ -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, @@ -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, @@ -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],