MythTV  master
mythavformatbuffer.h
Go to the documentation of this file.
1 #ifndef AVFRINGBUFFER_H
2 #define AVFRINGBUFFER_H
3 
4 // MythTV
5 #include "io/mythmediabuffer.h"
6 
7 // FFmpeg
8 extern "C" {
9 #include "libavformat/avformat.h"
10 #include "libavformat/url.h"
11 }
12 
14 {
15  public:
16  explicit MythAVFormatBuffer(MythMediaBuffer *Buffer = nullptr);
18  MythMediaBuffer* GetBuffer (void);
19  static URLProtocol* GetURLProtocol (void);
20  static int WritePacket (void* Context, uint8_t *Buffer, int Size);
21  static int ReadPacket (void* Context, uint8_t *Buffer, int Size);
22  static int64_t SeekPacket (void* Context, int64_t Offset, int Whence);
23  static int Open (URLContext* Context, const char *Filename, int Flags);
24  static int Read (URLContext* Context, uint8_t *Buffer, int Size);
25  static int Write (URLContext* Context, const uint8_t *Buffer, int Size);
26  static int64_t Seek (URLContext* Context, int64_t Offset, int Whence);
27  static int Close (URLContext* /*Context*/);
28  void SetInInit (bool State);
29  bool IsInInit (void) const;
30 
31  private:
32  MythMediaBuffer *m_buffer { nullptr };
33  bool m_initState { true };
34  static URLProtocol s_avfrURL;
35 };
36 #endif
MythAVFormatBuffer::Seek
static int64_t Seek(URLContext *Context, int64_t Offset, int Whence)
Definition: mythavformatbuffer.cpp:50
MythAVFormatBuffer::s_avfrURL
static URLProtocol s_avfrURL
Definition: mythavformatbuffer.h:34
MythMediaBuffer
Definition: mythmediabuffer.h:50
MythAVFormatBuffer::Write
static int Write(URLContext *Context, const uint8_t *Buffer, int Size)
Definition: mythavformatbuffer.cpp:41
MythAVFormatBuffer::Read
static int Read(URLContext *Context, uint8_t *Buffer, int Size)
Definition: mythavformatbuffer.cpp:28
MythAVFormatBuffer::GetBuffer
MythMediaBuffer * GetBuffer(void)
Definition: mythavformatbuffer.cpp:17
MythAVFormatBuffer::Open
static int Open(URLContext *Context, const char *Filename, int Flags)
Definition: mythavformatbuffer.cpp:22
MythAVFormatBuffer::Close
static int Close(URLContext *)
Definition: mythavformatbuffer.cpp:65
State
State
Definition: zmserver.h:68
MythAVFormatBuffer::IsInInit
bool IsInInit(void) const
Definition: mythavformatbuffer.cpp:124
MythAVFormatBuffer::WritePacket
static int WritePacket(void *Context, uint8_t *Buffer, int Size)
Definition: mythavformatbuffer.cpp:70
MythAVFormatBuffer::GetURLProtocol
static URLProtocol * GetURLProtocol(void)
Definition: mythavformatbuffer.cpp:91
MythAVFormatBuffer::m_initState
bool m_initState
Definition: mythavformatbuffer.h:33
MythAVFormatBuffer::m_buffer
MythMediaBuffer * m_buffer
Definition: mythavformatbuffer.h:32
MythAVFormatBuffer::SeekPacket
static int64_t SeekPacket(void *Context, int64_t Offset, int Whence)
Definition: mythavformatbuffer.cpp:84
MythAVFormatBuffer::SetBuffer
void SetBuffer(MythMediaBuffer *Buffer)
Definition: mythavformatbuffer.cpp:12
mythmediabuffer.h
Buffer
Definition: MythExternControl.h:36
MythAVFormatBuffer::SetInInit
void SetInInit(bool State)
Definition: mythavformatbuffer.cpp:118
MythAVFormatBuffer::ReadPacket
static int ReadPacket(void *Context, uint8_t *Buffer, int Size)
Definition: mythavformatbuffer.cpp:77
MythAVFormatBuffer::MythAVFormatBuffer
MythAVFormatBuffer(MythMediaBuffer *Buffer=nullptr)
Definition: mythavformatbuffer.cpp:7
MythAVFormatBuffer
Definition: mythavformatbuffer.h:13