summaryrefslogtreecommitdiff
path: root/liboutput/encode.h
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2005-07-19 15:09:05 +0000
committerAndreas Brachold <vdr07@deltab.de>2005-07-19 15:09:05 +0000
commitf897f2aa7055c493db6391c50c8d19da970078e8 (patch)
treed13a515b24c149d7da4e9828cc9e9c73d4916f00 /liboutput/encode.h
downloadvdr-plugin-image-f897f2aa7055c493db6391c50c8d19da970078e8.tar.gz
vdr-plugin-image-f897f2aa7055c493db6391c50c8d19da970078e8.tar.bz2
Initial import with release 0.2.3
Diffstat (limited to 'liboutput/encode.h')
-rw-r--r--liboutput/encode.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/liboutput/encode.h b/liboutput/encode.h
new file mode 100644
index 0000000..0491927
--- /dev/null
+++ b/liboutput/encode.h
@@ -0,0 +1,92 @@
+/***************************************************************************
+ * encode.h
+ *
+ * (C) Copyright 2004 Andreas Brachold <vdr04-at-deltab.de>
+ * Created: Thu Aug 5 2004
+ *
+ ****************************************************************************/
+
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _ENCODE_H
+#define _ENCODE_H
+
+extern "C"
+{
+#ifdef HAVE_FFMPEG_STATIC
+# include <libavcodec/avcodec.h>
+#else
+# include <ffmpeg/avcodec.h>
+//#include <libavcodec/avcodec.h>
+#endif
+}
+
+//#define TESTCODE
+
+class cEncode
+{
+ AVCodec *m_pavCodec;
+ unsigned int m_nMaxMPEGSize;
+ uint8_t *m_pImageFilled;
+ uint8_t *m_pImageYUV;
+protected:
+ const unsigned int m_nFrames;
+ unsigned int m_nData;
+ uint8_t *m_pMPEG;
+ uint8_t *m_pImageRGB;
+ bool m_bUsePAL;
+ unsigned int m_nWidth;
+ unsigned int m_nHeight;
+ unsigned int* m_pFramesSize;
+
+#ifndef HAVE_FFMPEG_STATIC
+private:
+ static void *m_hLibAvcodec;
+protected:
+ static bool InitLibAVCodec(void);
+ static void CloseLibAVCodec(void);
+#endif
+ bool m_bLoaded;
+public:
+ cEncode();
+ virtual ~cEncode();
+
+ /*Load Shared Library and Register Codec*/
+ static bool Register();
+ /*UnLoad Shared*/
+ static void UnRegister();
+
+ bool Encode();
+ inline const uint8_t *Data() const { return m_pMPEG; }
+ inline unsigned int Size() const { return m_nData; }
+ inline unsigned int GetFrames() const { return m_nFrames; }
+ inline unsigned int GetFrameRate() const { return m_bUsePAL?25:30; }
+
+ inline unsigned int GetHeight() const { return m_nHeight; }
+ inline unsigned int GetWidth() const { return m_nWidth; }
+ inline unsigned int GetBorderHeight() const { return 16; }
+ inline unsigned int GetBorderWidth() const { return 16; }
+
+ inline uint8_t *GetRGBMem() { return m_pImageRGB; }
+#ifdef TESTCODE
+ bool Load(const char* szFileName);
+ bool Save(const char* szFileName) const;
+#endif
+ void ClearRGBMem ();
+};
+
+#endif /* _ENCODE_H */