From e9e6ceab5b3296332d837426a36cb2067edc4462 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 3 Apr 2016 10:19:25 -0400 Subject: [PATCH] linux build --- src/FFmpeg.h | 77 ++++++++++++++++++++++++++-------------------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/src/FFmpeg.h b/src/FFmpeg.h index ae424382b..6c4e562b8 100644 --- a/src/FFmpeg.h +++ b/src/FFmpeg.h @@ -397,39 +397,7 @@ int ufile_fopen(AVIOContext **s, const wxString & name, int flags); int ufile_fopen_input(AVFormatContext **ic_ptr, wxString & name); int ufile_close(AVIOContext *pb); -struct streamContext -{ - bool m_use; // TRUE = this stream will be loaded into Audacity - AVStream *m_stream; // an AVStream * - AVCodecContext *m_codecCtx; // pointer to m_stream->codec - - AVPacket m_pkt; // the last AVPacket we read for this stream - int m_pktValid; // is m_pkt valid? - uint8_t *m_pktDataPtr; // pointer into m_pkt.data - int m_pktRemainingSiz; - - int64_t m_pts; // the current presentation time of the input stream - int64_t m_ptsOffset; // packets associated with stream are relative to this - - int m_frameValid; // is m_decodedVideoFrame/m_decodedAudioSamples valid? - uint8_t *m_decodedAudioSamples; // decoded audio samples stored here - unsigned int m_decodedAudioSamplesSiz; // current size of m_decodedAudioSamples - int m_decodedAudioSamplesValidSiz; // # valid bytes in m_decodedAudioSamples - int m_initialchannels; // number of channels allocated when we begin the importing. Assumes that number of channels doesn't change on the fly. - - int m_samplesize; // input sample size in bytes - AVSampleFormat m_samplefmt; // input sample format - - int m_osamplesize; // output sample size in bytes - sampleFormat m_osamplefmt; // output sample format - - streamContext() { memset(this, 0, sizeof(*this)); } - ~streamContext(); -}; - -using Scs = ArrayOf>; -using ScsPtr = std::shared_ptr; - +struct streamContext; // common utility functions // utility calls that are shared with ImportFFmpeg and ODDecodeFFmpegTask streamContext *import_ffmpeg_read_next_frame(AVFormatContext* formatContext, @@ -862,14 +830,45 @@ extern "C" { }; -inline streamContext::~streamContext() -{ - if (m_decodedAudioSamples) - av_free(m_decodedAudioSamples); -} - #endif +struct streamContext +{ + bool m_use; // TRUE = this stream will be loaded into Audacity + AVStream *m_stream; // an AVStream * + AVCodecContext *m_codecCtx; // pointer to m_stream->codec + + AVPacket m_pkt; // the last AVPacket we read for this stream + int m_pktValid; // is m_pkt valid? + uint8_t *m_pktDataPtr; // pointer into m_pkt.data + int m_pktRemainingSiz; + + int64_t m_pts; // the current presentation time of the input stream + int64_t m_ptsOffset; // packets associated with stream are relative to this + + int m_frameValid; // is m_decodedVideoFrame/m_decodedAudioSamples valid? + uint8_t *m_decodedAudioSamples; // decoded audio samples stored here + unsigned int m_decodedAudioSamplesSiz; // current size of m_decodedAudioSamples + int m_decodedAudioSamplesValidSiz; // # valid bytes in m_decodedAudioSamples + int m_initialchannels; // number of channels allocated when we begin the importing. Assumes that number of channels doesn't change on the fly. + + int m_samplesize; // input sample size in bytes + AVSampleFormat m_samplefmt; // input sample format + + int m_osamplesize; // output sample size in bytes + sampleFormat m_osamplefmt; // output sample format + + streamContext() { memset(this, 0, sizeof(*this)); } + ~streamContext() + { + if (m_decodedAudioSamples) + av_free(m_decodedAudioSamples); + } +}; + +using Scs = ArrayOf>; +using ScsPtr = std::shared_ptr; + #endif // USE_FFMPEG #endif // __AUDACITY_FFMPEG__