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

Merge ign-common3 ➡️ ign-common4 #604

Merged
merged 3 commits into from
May 7, 2024
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
10 changes: 10 additions & 0 deletions av/src/AudioDecoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ void AudioDecoder::Cleanup()
{
// Close the codec
if (this->data->codecCtx)
{
#if LIBAVFORMAT_VERSION_MAJOR < 59
avcodec_close(this->data->codecCtx);
#else
avcodec_free_context(&this->data->codecCtx);
#endif
}

// Close the audio file
if (this->data->formatCtx)
Expand Down Expand Up @@ -157,7 +163,11 @@ bool AudioDecoder::Decode(uint8_t **_outBuffer, unsigned int *_outBufferSize)
// decodedFrame->linesize[0].
int size = decodedFrame->nb_samples *
av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) *
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100)
this->data->codecCtx->ch_layout.nb_channels;
#else
this->data->codecCtx->channels;
#endif
// Resize the audio buffer as necessary
if (*_outBufferSize + size > maxBufferSize)
{
Expand Down
4 changes: 4 additions & 0 deletions av/src/Video.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@ void Video::Cleanup()
avformat_close_input(&this->dataPtr->formatCtx);

// Close the codec
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101)
avcodec_free_context(&this->dataPtr->codecCtx);
#else
avcodec_close(this->dataPtr->codecCtx);
#endif

av_free(this->dataPtr->avFrameDst);
}
Expand Down
7 changes: 7 additions & 0 deletions include/gz/common/EnumIface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ namespace ignition
/// std::cout << "Type++ Name[" << myTypeIface.Str(*i) << "]\n";
/// }
/// \verbatim
#if defined __APPLE__ && defined __clang__
_Pragma("clang diagnostic push")
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#endif
template<typename Enum>
class EnumIterator
: std::iterator<std::bidirectional_iterator_tag, Enum>
Expand Down Expand Up @@ -219,6 +223,9 @@ namespace ignition
/// member value ever used.
private: Enum c;
};
#if defined __APPLE__ && defined __clang__
_Pragma("clang diagnostic pop")
#endif

/// \brief Equality operator
/// \param[in] _e1 First iterator
Expand Down
Loading