Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI for Mac OS #2078

Merged
merged 2 commits into from May 14, 2024
Merged

Fix CI for Mac OS #2078

merged 2 commits into from May 14, 2024

Conversation

dforsi
Copy link
Contributor

@dforsi dforsi commented Apr 20, 2024

This PR tries to work around missing a build failure in the CI for Mac:

/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:282:46: error: no member named 'channels' in 'AVCodecContext'
    m_metaData.Channels = m_videoDecoderCtx->channels;
                          ~~~~~~~~~~~~~~~~~  ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:308:48: error: no member named 'channels' in 'AVCodecContext'
        << " channels: " << m_audioDecoderCtx->channels
                            ~~~~~~~~~~~~~~~~~  ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:309:54: error: no member named 'channel_layout' in 'AVCodecContext'
        << " channel_layout: " << m_audioDecoderCtx->channel_layout
                                  ~~~~~~~~~~~~~~~~~  ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:628:72: error: no member named 'channels' in 'AVCodecContext'
    av_opt_set_int(m_audioSWR, "in_channel_count",  m_audioDecoderCtx->channels, 0);
                                                    ~~~~~~~~~~~~~~~~~  ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:630:73: error: no member named 'channel_layout' in 'AVCodecContext'
    av_opt_set_int(m_audioSWR, "in_channel_layout",  m_audioDecoderCtx->channel_layout, 0);
                                                     ~~~~~~~~~~~~~~~~~  ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:640:57: error: no member named 'channels' in 'AVCodecContext'
        << " in_channel_count: " <<  m_audioDecoderCtx->channels
                                     ~~~~~~~~~~~~~~~~~  ^
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:642:58: error: no member named 'channel_layout' in 'AVCodecContext'
        << " in_channel_layout: " <<  m_audioDecoderCtx->channel_layout
                                      ~~~~~~~~~~~~~~~~~  ^
7 errors generated.```

An alternative that could be tested is disabling the plugins that use libavcodec
-DENABLE_CHANNELRX_DEMODDATV=OFF
-DENABLE_CHANNELTX_MODDATV=OFF

@srcejon
Copy link
Collaborator

srcejon commented Apr 20, 2024

The problem needs to be fixed, not hidden. The point of this build is to identify problems.

Presumably something has changed in the latest ffmpeg.

@srcejon
Copy link
Collaborator

srcejon commented Apr 20, 2024

Yeah - ffmpeg API has changed, so this code needs to be updated to work with more recent versions.

Build ffmpeg as external project to work around missing includes:
/Users/runner/work/sdrangel/sdrangel/plugins/channelrx/demoddatv/datvideorender.cpp:282:46: error: no member named 'channels' in 'AVCodecContext'
(and similar)
This is a temporary workaround to make CI succeed until the plugins code
is modified to be compatible with a newer version of ffmpeg.
@f4exb
Copy link
Owner

f4exb commented Apr 28, 2024

I've searched around and it seems the following are replacements:
channels -> ch_layout.nb_channels
channel_layout -> ch_layout.u.mask
Ref: HandBrake/HandBrake@5e86b74

However FFMPEG v5 and < v5 are incompatible.

I think Ubuntu 24.04 to be released very soon is shipped with ffmpeg v6 so maybe we could wait a little bit. But we will have to upgrade for Windows too.

@f4exb
Copy link
Owner

f4exb commented Apr 29, 2024

Apparently one may also define FF_API_OLD_CHANNEL_LAYOUT

@f4exb f4exb merged commit 20af5cc into f4exb:master May 14, 2024
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants