1 /** *************************************************************************
2 \fn dummyVideoFilter.cpp
3 \brief simplest of all video filters, it does nothing
4
5 copyright : (C) 2009 by mean
6
7 ***************************************************************************/
8
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18 #include "ADM_default.h"
19 #include "ADM_coreVideoFilter.h"
20
21 /**
22 \class dummyVideoFilter
23 */
24 class dummyVideoFilter : public ADM_coreVideoFilter
25 {
26 public:
27 dummyVideoFilter(ADM_coreVideoFilter *previous,CONFcouple *conf);
28 ~dummyVideoFilter();
29
30 virtual const char *getConfiguration(void); /// Return current configuration as a human readable string
31 virtual bool getNextFrame(uint32_t *frameNumner,ADMImage *image); /// Return the next image
32 // virtual FilterInfo *getInfo(void); /// Return picture parameters after this filter
33 virtual bool getCoupledConf(CONFcouple **couples) ; /// Return the current filter configuration
34 virtual void setCoupledConf(CONFcouple *couples);
configure(void)35 virtual bool configure(void) {return true;} /// Start graphical user interface
36 };
37
38 // Add the hook to make it valid plugin
39 DECLARE_VIDEO_FILTER( dummyVideoFilter, // Class
40 1,0,0, // Version
41 ADM_UI_ALL, // UI
42 VF_MISC, // Category
43 "dummy", // internal name (must be uniq!)
44 QT_TRANSLATE_NOOP("dummy","Dummy"), // Display name
45 QT_TRANSLATE_NOOP("dummy","Null filter, it does nothing at all.") // Description
46 );
47
48 // Now implements the interesting parts
49 /**
50 \fn dummyVideoFilter
51 \brief constructor
52 */
dummyVideoFilter(ADM_coreVideoFilter * in,CONFcouple * setup)53 dummyVideoFilter::dummyVideoFilter( ADM_coreVideoFilter *in,CONFcouple *setup) : ADM_coreVideoFilter(in,setup)
54 {
55 UNUSED_ARG(setup);
56
57 // By default the info field contains the output of previous filter
58 // Tweak it here if you change fps, duration, width,...
59 }
60 /**
61 \fn dummyVideoFilter
62 \brief destructor
63 */
~dummyVideoFilter()64 dummyVideoFilter::~dummyVideoFilter()
65 {
66
67 }
68 /**
69 \fn getFrame
70 \brief Get a processed frame
71 */
getNextFrame(uint32_t * fn,ADMImage * image)72 bool dummyVideoFilter::getNextFrame(uint32_t *fn,ADMImage *image)
73 {
74 // since we do nothing, just get the output of previous filter
75 return previousFilter->getNextFrame(fn,image);
76 }
77 /**
78 \fn getCoupledConf
79 \brief Return our current configuration as couple name=value
80 */
getCoupledConf(CONFcouple ** couples)81 bool dummyVideoFilter::getCoupledConf(CONFcouple **couples)
82 {
83 *couples=new CONFcouple(0); // Even if we dont have configuration we must allocate one
84 return true;
85 }
86
setCoupledConf(CONFcouple * couples)87 void dummyVideoFilter::setCoupledConf(CONFcouple *couples)
88 {
89 }
90
91 /**
92 \fn getConfiguration
93 \brief Return current setting as a string
94 */
getConfiguration(void)95 const char *dummyVideoFilter::getConfiguration(void)
96 {
97
98 return "Dummy Filter.";
99 }
100 // Normally not needed :virtual FilterInfo *getInfo(void)
101 //EOF
102