Skip to content

Commit ecc6602

Browse files
committed
Add missing consts for Ubuntu
1 parent 56aca85 commit ecc6602

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

.github/workflows/smoke.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
matrix:
3737
config:
3838
- {os: ubuntu-24.04, python: "3.12", ffmpeg: "8.0.1", extras: true}
39+
- {os: ubuntu-24.04, python: "3.10", ffmpeg: "8.0.1"}
3940
- {os: ubuntu-24.04, python: "pypy3.11", ffmpeg: "8.0.1"}
4041
- {os: macos-14, python: "3.11", ffmpeg: "8.0.1"}
4142

.github/workflows/tests.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ jobs:
1616
pip install -U cython setuptools
1717
python scripts/fetch-vendor.py --config-file scripts/ffmpeg-latest.json /tmp/vendor
1818
PKG_CONFIG_PATH=/tmp/vendor/lib/pkgconfig python setup.py sdist
19-
- name: Publish to PyPI
20-
if: github.event_name == 'release' && github.event.action == 'published'
21-
uses: pypa/gh-action-pypi-publish@release/v1
19+
- name: Upload source package
20+
uses: actions/upload-artifact@v6
2221
with:
23-
user: __token__
24-
password: ${{ secrets.PYPI_TOKEN }}
22+
name: dist-source
23+
path: dist/
2524

2625
package-wheel:
2726
runs-on: ${{ matrix.os }}
@@ -73,20 +72,29 @@ jobs:
7372
cibuildwheel --output-dir dist
7473
shell: bash
7574
- name: Upload wheels
76-
uses: actions/upload-artifact@v4
75+
uses: actions/upload-artifact@v6
7776
with:
7877
name: dist-${{ matrix.os }}-${{ matrix.arch }}
7978
path: dist/
8079

8180
publish:
8281
runs-on: ubuntu-latest
83-
needs: [package-wheel]
82+
needs: [package-source, package-wheel]
8483
steps:
8584
- uses: actions/checkout@v6
86-
- uses: actions/download-artifact@v4
85+
- uses: actions/download-artifact@v7
8786
with:
8887
merge-multiple: true
8988
path: dist/
89+
90+
- name: Publish to GitHub
91+
if: github.event_name == 'release'
92+
uses: softprops/action-gh-release@v1
93+
with:
94+
files: dist/*
95+
env:
96+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97+
9098
- name: Publish to PyPI
9199
if: github.event_name == 'release' && github.event.action == 'published'
92100
uses: pypa/gh-action-pypi-publish@release/v1

av/video/reformatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def _reformat(
234234
with cython.nogil:
235235
lib.sws_scale(
236236
self.ptr,
237-
frame.ptr.data,
238-
frame.ptr.linesize,
237+
cython.cast("const unsigned char *const *", frame.ptr.data),
238+
cython.cast("const int *", frame.ptr.linesize),
239239
0, # slice Y
240240
frame.ptr.height,
241241
new_frame.ptr.data,

include/libswscale/swscale.pxd

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
from libc.stdint cimport uint8_t
12

23
cdef extern from "libswscale/swscale.h" nogil:
3-
44
cdef int swscale_version()
55
cdef char* swscale_configuration()
66
cdef char* swscale_license()
@@ -13,7 +13,6 @@ cdef extern from "libswscale/swscale.h" nogil:
1313
cdef struct SwsFilter:
1414
pass
1515

16-
# Flags.
1716
cdef int SWS_FAST_BILINEAR
1817
cdef int SWS_BILINEAR
1918
cdef int SWS_BICUBIC
@@ -25,7 +24,6 @@ cdef extern from "libswscale/swscale.h" nogil:
2524
cdef int SWS_SINC
2625
cdef int SWS_LANCZOS
2726
cdef int SWS_SPLINE
28-
2927
cdef int SWS_CS_ITU709
3028
cdef int SWS_CS_FCC
3129
cdef int SWS_CS_ITU601
@@ -36,16 +34,14 @@ cdef extern from "libswscale/swscale.h" nogil:
3634

3735
cdef int sws_scale(
3836
SwsContext *ctx,
39-
const unsigned char *const *src_slice,
37+
const uint8_t *const *src_slice,
4038
const int *src_stride,
4139
int src_slice_y,
4240
int src_slice_h,
4341
unsigned char *const *dst_slice,
44-
int *dst_stride,
42+
const int *dst_stride,
4543
)
46-
4744
cdef void sws_freeContext(SwsContext *ctx)
48-
4945
cdef SwsContext *sws_getCachedContext(
5046
SwsContext *context,
5147
int src_width,
@@ -59,9 +55,7 @@ cdef extern from "libswscale/swscale.h" nogil:
5955
SwsFilter *dst_filter,
6056
double *param,
6157
)
62-
63-
cdef int* sws_getCoefficients(int colorspace)
64-
58+
cdef const int* sws_getCoefficients(int colorspace)
6559
cdef int sws_getColorspaceDetails(
6660
SwsContext *context,
6761
int **inv_table,
@@ -72,7 +66,6 @@ cdef extern from "libswscale/swscale.h" nogil:
7266
int *contrast,
7367
int *saturation
7468
)
75-
7669
cdef int sws_setColorspaceDetails(
7770
SwsContext *context,
7871
const int inv_table[4],

0 commit comments

Comments
 (0)