MythTV  master
mythdeinterlacer.h
Go to the documentation of this file.
1 #ifndef MYTHDEINTERLACER_H
2 #define MYTHDEINTERLACER_H
3 
4 // Qt
5 #include <QSize>
6 
7 // MythTV
8 #include "videoouttypes.h"
9 #include "mythavutil.h"
10 #include "videodisplayprofile.h"
11 
12 extern "C" {
13 #include "libavfilter/avfilter.h"
14 #include "libswscale/swscale.h"
15 }
16 
18 {
19  public:
20  MythDeinterlacer() = default;
22 
23  void Filter (VideoFrame *Frame, FrameScanType Scan,
24  VideoDisplayProfile *Profile, bool Force = false);
25 
26  private:
27  bool Initialise (VideoFrame *Frame, MythDeintType Deinterlacer,
28  bool DoubleRate, bool TopFieldFirst,
29  VideoDisplayProfile *Profile);
30  inline void Cleanup (void);
31 
32  private:
33  Q_DISABLE_COPY(MythDeinterlacer)
34 
36  AVPixelFormat m_inputFmt { AV_PIX_FMT_NONE };
37  int m_width { 0 };
38  int m_height { 0 };
40  bool m_doubleRate { false };
41  bool m_topFirst { true };
43  AVFilterGraph* m_graph { nullptr };
44  AVFilterContext* m_source { nullptr };
45  AVFilterContext* m_sink { nullptr };
46  VideoFrame* m_bobFrame { nullptr };
47  SwsContext* m_swsContext { nullptr };
48  long long m_discontinuityCounter { 0 };
49  bool m_autoFieldOrder { false };
50  long long m_lastFieldChange { 0 };
51 };
52 
53 #endif // MYTHDEINTERLACER_H
FrameScanType
Definition: videoouttypes.h:78
VideoFrameType
Definition: mythframe.h:23
VideoFrame * m_bobFrame
long long m_discontinuityCounter
MythDeintType
Definition: mythframe.h:120
MythAVFrame m_frame
AVFilterContext * m_source
long long m_lastFieldChange
SwsContext * m_swsContext
void Filter(VideoFrame *Frame, FrameScanType Scan, VideoDisplayProfile *Profile, bool Force=false)
Deinterlace Frame if needed.
Handles software based deinterlacing of video frames.
AVFilterContext * m_sink
bool Initialise(VideoFrame *Frame, MythDeintType Deinterlacer, bool DoubleRate, bool TopFieldFirst, VideoDisplayProfile *Profile)
Initialise deinterlacing using the given MythDeintType.
AVFilterGraph * m_graph
MythDeintType m_deintType
AVPixelFormat m_inputFmt
MythAVFrame little utility class that act as a safe way to allocate an AVFrame which can then be allo...
Definition: mythavutil.h:42
MythDeinterlacer()=default
VideoFrameType m_inputType