MythTV  master
mythavframe.h
Go to the documentation of this file.
1 #ifndef MYTHAVFRAME_H
2 #define MYTHAVFRAME_H
3 
4 #include "mythexp.h"
5 
6 extern "C" {
7 #include "libavcodec/avcodec.h"
8 }
27 {
28  public:
29  MythAVFrame(void) : m_frame(av_frame_alloc()) {}
31  {
32  av_frame_free(&m_frame);
33  }
34  bool operator !() const
35  {
36  return m_frame == nullptr;
37  }
39  {
40  return m_frame;
41  }
42  AVFrame& operator*() const
43  {
44  return *m_frame;
45  }
46  operator AVFrame*() const
47  {
48  return m_frame;
49  }
50  operator const AVFrame*() const
51  {
52  return m_frame;
53  }
54 
55  private:
56  AVFrame *m_frame {nullptr};
57 };
58 
59 #endif // MYTHAVFRAME_H
MPUBLIC
#define MPUBLIC
Definition: mythexp.h:10
MythAVFrame::operator*
AVFrame & operator*() const
Definition: mythavframe.h:42
mythexp.h
MythAVFrame
MythAVFrame little utility class that act as a safe way to allocate an AVFrame which can then be allo...
Definition: mythavframe.h:26
MythAVFrame::operator->
AVFrame * operator->() const
Definition: mythavframe.h:38
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
MythAVFrame::~MythAVFrame
~MythAVFrame(void)
Definition: mythavframe.h:30
MythAVFrame::MythAVFrame
MythAVFrame(void)
Definition: mythavframe.h:29