pipelka / vdr-plugin-xvdr

DISCONTINUED - XVDR Plugin for VDR
GNU General Public License v2.0
43 stars 22 forks source link

Compilation Error demuxer_ADTS.cc #98

Closed lebandhe closed 11 years ago

lebandhe commented 11 years ago

Compilation fails for make plugins with latest GIT src

'/usr/local/src/vdr-1.7.18/PLUGINS/src/vdr-plugin-xvdr' g++ -c -DPLUGIN_NAME_I18N='"xvdr"' -DXVDR_VERSION='"0.9.8"' -I./src -o src/demuxer/demuxer_ADTS.o src/demuxer/demuxer_ADTS.c src/demuxer/demuxer_ADTS.c: In member function ‘bool cParserADTS::ParseAudioHeader(uint8t, int&, int&, int&)’: src/demuxer/demuxer_ADTS.c:36:3: error: ‘cBitStream’ was not declared in this scope src/demuxer/demuxer_ADTS.c:36:14: error: expected ‘;’ before ‘bs’ src/demuxer/demuxer_ADTS.c:39:6: error: ‘bs’ was not declared in this scope src/demuxer/demuxerADTS.c:42:3: error: ‘bs’ was not declared in this scope make[1]: ** [src/demuxer/demuxer_ADTS.o] Fehler 1

Any Ideas??

pipelka commented 11 years ago

Please use a newer VDR version. VDR 1.7.18 is simply too old.

ravenclaw78 commented 11 years ago

i built current git for 1.7.21 with the following patch:

diff -rNu vdr-plugin-xvdr/Makefile vdr-plugin-xvdr-patch//Makefile
--- vdr-plugin-xvdr/Makefile    2013-04-12 00:23:48.208455117 +0200
+++ vdr-plugin-xvdr-patch//Makefile     2013-04-11 22:41:33.048537313 +0200
@@ -56,6 +56,7 @@
 OBJS = \
        src/config/config.o \
        src/demuxer/demuxer.o \
+       src/demuxer/bitstream.o \
        src/demuxer/demuxer_ADTS.o \
        src/demuxer/demuxer_LATM.o \
        src/demuxer/demuxer_AC3.o \
diff -rNu vdr-plugin-xvdr/src/demuxer/bitstream.c vdr-plugin-xvdr-patch//src/demuxer/bitstream.c
--- vdr-plugin-xvdr/src/demuxer/bitstream.c     1970-01-01 01:00:00.000000000 +0100
+++ vdr-plugin-xvdr-patch//src/demuxer/bitstream.c      2013-04-11 22:42:18.648536702 +0200
@@ -0,0 +1,113 @@
+/*
+ *      vdr-plugin-xvdr - XVDR server plugin for VDR
+ *
+ *      Copyright (C) 2010 Alwin Esch (Team XBMC)
+ *
+ *      https://github.com/pipelka/vdr-plugin-xvdr
+ *
+ *  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, 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 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
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include <stdio.h>
+#include <inttypes.h>
+#include "bitstream.h"
+
+cBitStream::cBitStream(uint8_t *data, int bits)
+{
+  m_data   = data;
+  m_offset = 0;
+  m_len    = bits;
+}
+
+void cBitStream::setBitStream(uint8_t *data, int bits)
+{
+  m_data   = data;
+  m_offset = 0;
+  m_len    = bits;
+}
+
+void cBitStream::SkipBits(int num)
+{
+  m_offset += num;
+}
+
+unsigned int cBitStream::GetBits(int num)
+{
+  int r = 0;
+
+  while(num > 0)
+  {
+    if(m_offset >= m_len)
+      return 0;
+
+    num--;
+
+    if(m_data[m_offset / 8] & (1 << (7 - (m_offset & 7))))
+      r |= 1 << num;
+
+    m_offset++;
+  }
+  return r;
+}
+
+unsigned int cBitStream::showBits(int num)
+{
+  int r = 0;
+  int offs = m_offset;
+
+  while(num > 0)
+  {
+    if(offs >= m_len)
+      return 0;
+
+    num--;
+
+    if(m_data[offs / 8] & (1 << (7 - (offs & 7))))
+      r |= 1 << num;
+
+    offs++;
+  }
+  return r;
+}
+
+unsigned int cBitStream::remainingBits()
+{
+  return m_len - m_offset;
+}
+
+unsigned int cBitStream::Index()
+{
+  return m_offset;
+}
+
+void cBitStream::putBits(int val, int num)
+{
+  while(num > 0) {
+    if(m_offset >= m_len)
+      return;
+
+    num--;
+
+    if(val & (1 << num))
+      m_data[m_offset / 8] |= 1 << (7 - (m_offset & 7));
+    else
+      m_data[m_offset / 8] &= ~(1 << (7 - (m_offset & 7)));
+
+    m_offset++;
+  }
+}
+
diff -rNu vdr-plugin-xvdr/src/demuxer/bitstream.h vdr-plugin-xvdr-patch//src/demuxer/bitstream.h
--- vdr-plugin-xvdr/src/demuxer/bitstream.h     1970-01-01 01:00:00.000000000 +0100
+++ vdr-plugin-xvdr-patch//src/demuxer/bitstream.h      2013-04-11 22:39:47.452538728 +0200
@@ -0,0 +1,49 @@
+/*
+ *      vdr-plugin-xvdr - XVDR server plugin for VDR
+ *
+ *      Copyright (C) 2010 Alwin Esch (Team XBMC)
+ *
+ *      https://github.com/pipelka/vdr-plugin-xvdr
+ *
+ *  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, 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 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
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#ifndef XVDR_BITSTREAM_H
+#define XVDR_BITSTREAM_H
+
+class cBitStream
+{
+private:
+  uint8_t *m_data;
+  int      m_offset;
+  int      m_len;
+
+public:
+  cBitStream(uint8_t *data, int bits);
+
+  void         setBitStream(uint8_t *data, int bits);
+  void         SkipBits(int num);
+  unsigned int GetBits(int num);
+  unsigned int GetBit() { return GetBits(1); }
+  unsigned int showBits(int num);
+  unsigned int remainingBits();
+  void         putBits(int val, int num);
+  int          Length() { return m_len; }
+  unsigned int Index();
+};
+
+#endif // XVDR_BITSTREAM_H
diff -rNu vdr-plugin-xvdr/src/demuxer/demuxer_AC3.c vdr-plugin-xvdr-patch//src/demuxer/demuxer_AC3.c
--- vdr-plugin-xvdr/src/demuxer/demuxer_AC3.c   2013-04-12 00:20:15.984457960 +0200
+++ vdr-plugin-xvdr-patch//src/demuxer/demuxer_AC3.c    2013-04-11 22:37:52.912540262 +0200
@@ -24,7 +24,7 @@
  */

 #include "demuxer_AC3.h"
-#include "vdr/tools.h"
+#include "bitstream.h"
 #include "ac3common.h"

 cParserAC3::cParserAC3(cTSDemuxer *demuxer) : cParser(demuxer, 64 * 1024, 4096)
diff -rNu vdr-plugin-xvdr/src/demuxer/demuxer_ADTS.c vdr-plugin-xvdr-patch//src/demuxer/demuxer_ADTS.c
--- vdr-plugin-xvdr/src/demuxer/demuxer_ADTS.c  2013-04-12 00:20:15.984457960 +0200
+++ vdr-plugin-xvdr-patch//src/demuxer/demuxer_ADTS.c   2013-04-11 22:37:35.712540493 +0200
@@ -23,7 +23,7 @@
  */

 #include "demuxer_ADTS.h"
-#include "vdr/tools.h"
+#include "bitstream.h"
 #include "aaccommon.h"

 cParserADTS::cParserADTS(cTSDemuxer *demuxer) : cParser(demuxer, 64 * 1024, 8192)
diff -rNu vdr-plugin-xvdr/src/demuxer/demuxer_EAC3.c vdr-plugin-xvdr-patch//src/demuxer/demuxer_EAC3.c
--- vdr-plugin-xvdr/src/demuxer/demuxer_EAC3.c  2013-04-12 00:20:15.984457960 +0200
+++ vdr-plugin-xvdr-patch//src/demuxer/demuxer_EAC3.c   2013-04-11 22:40:15.076538358 +0200
@@ -24,7 +24,7 @@
  */

 #include "demuxer_EAC3.h"
-#include "vdr/tools.h"
+#include "bitstream.h"
 #include "ac3common.h"

 static const uint8_t EAC3Blocks[4] = {
diff -rNu vdr-plugin-xvdr/src/demuxer/demuxer_H264.c vdr-plugin-xvdr-patch//src/demuxer/demuxer_H264.c
--- vdr-plugin-xvdr/src/demuxer/demuxer_H264.c  2013-04-12 00:20:15.984457960 +0200
+++ vdr-plugin-xvdr-patch//src/demuxer/demuxer_H264.c   2013-04-11 22:38:28.052539792 +0200
@@ -23,7 +23,7 @@
  */

 #include "config/config.h"
-#include "vdr/tools.h"
+#include "bitstream.h"
 #include "demuxer_H264.h"

 // pixel aspect ratios
diff -rNu vdr-plugin-xvdr/src/demuxer/demuxer_LATM.c vdr-plugin-xvdr-patch//src/demuxer/demuxer_LATM.c
--- vdr-plugin-xvdr/src/demuxer/demuxer_LATM.c  2013-04-12 00:20:15.984457960 +0200
+++ vdr-plugin-xvdr-patch//src/demuxer/demuxer_LATM.c   2013-04-11 22:38:09.944540034 +0200
@@ -24,7 +24,7 @@
  */

 #include "demuxer_LATM.h"
-#include "vdr/tools.h"
+#include "bitstream.h"
 #include "aaccommon.h"

 static uint32_t LATMGetValue(cBitStream *bs) {
diff -rNu vdr-plugin-xvdr/src/demuxer/demuxer_MPEGVideo.c vdr-plugin-xvdr-patch//src/demuxer/demuxer_MPEGVideo.c
--- vdr-plugin-xvdr/src/demuxer/demuxer_MPEGVideo.c     2013-04-12 00:20:15.984457960 +0200
+++ vdr-plugin-xvdr-patch//src/demuxer/demuxer_MPEGVideo.c      2013-04-11 22:38:51.220539481 +0200
@@ -23,7 +23,7 @@
  */

 #include "demuxer_MPEGVideo.h"
-#include "vdr/tools.h"
+#include "bitstream.h"
 #include "pes.h"

 #define MPEG2_SEQUENCE_START 0x000001B3