MythTV  0.26-pre
filtermanager.h
Go to the documentation of this file.
00001 #ifndef FILTERMANAGER
00002 #define FILTERMANAGER
00003 
00004 extern "C" {
00005 #include "filter.h"
00006 #include "frame.h"
00007 }
00008 
00009 // C++ headers
00010 #include <vector>
00011 #include <map>
00012 using namespace std;
00013 
00014 // Qt headers
00015 #include <QString>
00016 
00017 typedef map<QString,void*>       library_map_t;
00018 typedef map<QString,FilterInfo*> filter_map_t;
00019 
00020 #include "videoouttypes.h"
00021 
00022 class FilterChain
00023 {
00024   public:
00025     FilterChain() { }
00026     virtual ~FilterChain();
00027 
00028     void ProcessFrame(VideoFrame *Frame, FrameScanType scan = kScan_Ignore);
00029 
00030     void Append(VideoFilter *f) { filters.push_back(f); }
00031 
00032   private:
00033     vector<VideoFilter*> filters;
00034 };
00035 
00036 class FilterManager
00037 {
00038   public:
00039     FilterManager();
00040    ~FilterManager();
00041 
00042     VideoFilter *LoadFilter(const FilterInfo *Filt, VideoFrameType inpixfmt,
00043                             VideoFrameType outpixfmt, int &width,
00044                             int &height, const char *opts,
00045                             int max_threads);
00046 
00047     FilterChain *LoadFilters(QString filters, VideoFrameType &inpixfmt,
00048                              VideoFrameType &outpixfmt, int &width,
00049                              int &height, int &bufsize,
00050                              int max_threads = 1);
00051 
00052   private:
00053     bool LoadFilterLib(const QString &path);
00054     const FilterInfo *GetFilterInfo(const QString &name) const;
00055 
00056     library_map_t dlhandles;
00057     filter_map_t  filters;
00058 };
00059 
00060 #endif // #ifndef FILTERMANAGER
00061 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends