Skip to content

Commit

Permalink
Add OS X build config and fix stuff (#19)
Browse files Browse the repository at this point in the history
* Add OS X build config
* Fix code for ffmpeg forward compatibility
* Fix action runners were using wrong ox
  • Loading branch information
DaWelter authored Dec 27, 2022
1 parent 223c4e4 commit b2d9f12
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 14 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,40 +13,47 @@ on:
jobs:
build:
if: github.event.pull_request.draft == false
runs-on: [ "ubuntu-18.04" ]
strategy:
fail-fast: false
matrix:
include:
- os: "ubuntu-18"
- os: "ubuntu-18.04"
python-version: "3.6"
- os: "ubuntu-20"
- os: "ubuntu-20.04"
python-version: "3.8"
- os: "ubuntu-latest"
python-version: "3.11"
- os: "macos-latest"
python-version: "3.11"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies

- name: Install dependencies Ubuntu
if: ${{ contains(matrix.os,'ubuntu') }}
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install -r requirements.txt
sudo apt-get update -y
sudo apt-get install -y libavcodec-dev libavutil-dev libswscale-dev
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install dependencies OS X
if: ${{ contains(matrix.os,'macos') }}
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install -r requirements.txt
brew install ffmpeg@5 cmake
- name: Build And Install
run: |
python -m pip install -e .
- name: Test with pytest
run: |
pytest test/test.py
python -m pytest test/test.py
4 changes: 2 additions & 2 deletions src/h264decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ typedef unsigned char ubyte;
H264Decoder::H264Decoder()
: pkt_{std::make_unique<AVPacket>()}
{
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
avcodec_register_all();

//av_log_set_level(AV_LOG_VERBOSE);
#endif

codec = avcodec_find_decoder(AV_CODEC_ID_H264);
if (!codec)
Expand Down
2 changes: 1 addition & 1 deletion src/h264decoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class H264Decoder
/* Persistent things here, using RAII for cleanup. */
AVCodecContext *context;
AVFrame *frame;
AVCodec *codec;
const AVCodec *codec;
AVCodecParserContext *parser;
/* In the documentation example on the github master branch, the
packet is put on the heap. This is done here to store the pointers
Expand Down

0 comments on commit b2d9f12

Please sign in to comment.