Audacity  2.2.0
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 #include "../Experimental.h"
13 #include "../MemoryX.h"
14 
15 #ifdef EXPERIMENTAL_OD_FFMPEG
16 
17 #ifndef __ODDECODEFFMPEGTASK__
18 #define __ODDECODEFFMPEGTASK__
19 
20 #include <vector>
21 #include "ODDecodeTask.h"
22 #include "ODTaskThread.h"
23 
24 struct FFmpegContext;
25 class ODFileDecoder;
26 class WaveTrack;
28 class ODDecodeFFmpegTask final : public ODDecodeTask
29 {
30 public:
31  using Channels = std::vector < WaveTrack* >;
32  using Streams = std::vector < Channels >;
33 
34  static Streams FromList(const std::list<TrackHolders> &channels);
35 
37  ODDecodeFFmpegTask(const ScsPtr &scs, Streams &&channels, const std::shared_ptr<FFmpegContext> &context, int streamIndex);
38  virtual ~ODDecodeFFmpegTask();
39 
40  movable_ptr<ODTask> Clone() const override;
42  ODFileDecoder* CreateFileDecoder(const wxString & fileName) override;
43 
46  unsigned int GetODType() override {return eODFFMPEG;}
47 
48 protected:
49  // non-owning pointers to WaveTracks:
50  Streams mChannels;
51 
52  ScsPtr mScs;
53  std::shared_ptr<FFmpegContext> mContext;
54  int mStreamIndex;
55 };
56 #endif //__ODDECODEFFMPEGTASK__
57 
58 #endif //EXPERIMENTAL_OD_FFMPEG
std::unique_ptr< T > movable_ptr
Definition: MemoryX.h:683
virtual movable_ptr< ODTask > Clone() const =0
class to decode a particular file (one per file). Saves info such as filename and length (after the h...
Definition: ODDecodeTask.h:100
A Track that contains audio waveform data.
Definition: WaveTrack.h:76
unsigned int GetODType() override
Subclasses should override to return respective type.
Definition: ODDecodeTask.h:60
A class representing a modular task to be used with the On-Demand structures.
Definition: ODDecodeTask.h:41
Definition: ODTask.h:46
virtual ODFileDecoder * CreateFileDecoder(const wxString &fileName)=0
Creates an ODFileDecoder that decodes a file of filetype the subclass handles.