Audacity  3.0.3
ODDecodeFFmpegTask.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4  Audacity(R) is copyright (c) 1999-2012 Audacity Team.
5  License: GPL v2. See License.txt.
6 
7  ODDecodeFFmpegTask.h
8  Michael Chinen
9 
10 ******************************************************************/
11 
12 #ifndef __ODDECODEFFMPEGTASK__
13 #define __ODDECODEFFMPEGTASK__
14 
15 #ifdef EXPERIMENTAL_OD_FFMPEG
16 
17 #include <vector>
18 #include "ODDecodeTask.h"
19 
20 struct streamContext;
22 using ScsPtr = std::shared_ptr<Scs>;
23 
24 struct FFmpegContext;
25 class ODFileDecoder;
26 class WaveTrack;
27 using NewChannelGroup = std::vector< std::shared_ptr<WaveTrack> >;
28 using TrackHolders = std::vector< NewChannelGroup >;
29 
31 class ODDecodeFFmpegTask final : public ODDecodeTask
32 {
33 public:
34  using Channels = std::vector < WaveTrack* >;
35  using Streams = std::vector < Channels >;
36 
37  static Streams FromList( const TrackHolders &channels );
38 
40  ODDecodeFFmpegTask(const ScsPtr &scs, Streams &&channels, const std::shared_ptr<FFmpegContext> &context, int streamIndex);
41  virtual ~ODDecodeFFmpegTask();
42 
43  std::unique_ptr<ODTask> Clone() const override;
45  ODFileDecoder* CreateFileDecoder(const wxString & fileName) override;
46 
49  unsigned int GetODType() override {return eODFFMPEG;}
50 
51 protected:
52  // non-owning pointers to WaveTracks:
53  Streams mChannels;
54 
55  ScsPtr mScs;
56  std::shared_ptr<FFmpegContext> mContext;
57  int mStreamIndex;
58 };
59 #endif //__ODDECODEFFMPEGTASK__
60 
61 #endif //EXPERIMENTAL_OD_FFMPEG
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
streamContext
Definition: FFmpeg.h:1007
TrackHolders
std::vector< std::vector< std::shared_ptr< WaveTrack > > > TrackHolders
Definition: Import.h:39
ODDecodeTask::CreateFileDecoder
virtual ODFileDecoder * CreateFileDecoder(const wxString &fileName)=0
Creates an ODFileDecoder that decodes a file of filetype the subclass handles.
ODTask::Clone
virtual std::unique_ptr< ODTask > Clone() const =0
ScsPtr
std::shared_ptr< Scs > ScsPtr
Definition: FFmpeg.h:1038
ODTask::eODFFMPEG
@ eODFFMPEG
Definition: ODTask.h:46
ODDecodeTask
A class representing a modular task to be used with the On-Demand structures.
Definition: ODDecodeTask.h:41
FFmpegContext
Definition: FFmpeg.h:380
ODFileDecoder
class to decode a particular file (one per file). Saves info such as filename and length (after the h...
Definition: ODDecodeBlockFile.h:194
ODDecodeTask.h
NewChannelGroup
std::vector< std::shared_ptr< WaveTrack > > NewChannelGroup
Definition: Import.cpp:62
ODDecodeTask::GetODType
unsigned int GetODType() override
Subclasses should override to return respective type.
Definition: ODDecodeTask.h:59
ArrayOf
Memory.h template class for making an array of float, bool, etc.
Definition: MemoryX.h:27