diff options
author | Klaus Schmidinger <Klaus (dot) Schmidinger (at) tvdr (dot) de> | 2011-12-04 16:53:00 +0100 |
---|---|---|
committer | Dieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de> | 2011-12-05 20:36:02 +0100 |
commit | 5a28d999363f8ace192489d4f6b13dfeb6cfc20b (patch) | |
tree | 4aa9a419b3e1d45656c66ead7b8a4997665951e2 /PLUGINS/src/dvbhddevice/libhdffcmd/bitbuffer.c | |
parent | 0c96d6b62650790dc83ce6621eb664e51f39719b (diff) | |
download | vdr-patches-5a28d999363f8ace192489d4f6b13dfeb6cfc20b.tar.gz vdr-patches-5a28d999363f8ace192489d4f6b13dfeb6cfc20b.tar.bz2 |
Version 1.7.22
Original announce message:
VDR developer version 1.7.22 is now available at
ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.22.tar.bz2
A 'diff' against the previous version is available at
ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.21-1.7.22.diff
MD5 checksums:
b9c0fe1aac8e653c0d0234bc72c2bb2c vdr-1.7.22.tar.bz2
868bb332342c9a78beda17cc85e0bb93 vdr-1.7.21-1.7.22.diff
WARNING:
========
This is a developer version. Even though I use it in my productive
environment. I strongly recommend that you only use it under controlled
conditions and for testing and debugging.
From the HISTORY file:
- Fixed scaling subtitles in case the primary device's GetVideoSize() function doesn't
return actual values (thanks to Luca Olivetti).
- The DiSEqC codes are now copied in the call to cDiseqc::Execute().
- VDR now supports "Satellite Channel Routing" (SCR) according to EN50494 (based on
the "unicable" patch from Lars Hanisch).
Since "Unicable" is a registered trademark and stands for only one of many
implementations of SCR, the following changes have been made compared to the patch,
which need to be taken into account by people who have set up their system using
the patch:
- The 'U' parameter in the diseqc.conf file has been changed to 'S' ("Scr").
- The configuration file name has been changed from "unicable.conf" to "scr.conf".
- Updated sources.conf (thanks to Arthur Konovalov).
- The SVDRP command LSTC now also accepts channel IDs (thanks to Dominic Evans).
- Fixed handling DVB subtitles and implemented decoding textual DVB subtitles (thanks
to Rolf Ahrenberg).
- Added cap_net_raw to the capabilities that are not dropped (thanks to Dominic Evans).
- Fixed setting the start time of an edited recording (thanks to Christoph Haubrich).
- Temporarily switching free devices to transponders in order to have their running
status updated is now done by marking the devices as "occupied" for a certain
amount of time.
- The new setup options "LNB/Device n connected to sat cable" can be used to define
which DVB-S devices are connected to the same sat cable and are therefore "bonded".
This obsoletes the LNBSHARE patch. Users of the LNBSHARE patch will need to newly
set up their sat devices with the above options.
- Fixed a crash when deleting a recording while cutting it (thanks to Ville Skyttä).
- Fixed several spelling errors (thanks to Ville Skyttä).
- The new SVDRP command UPDR can be used to trigger an update of the list of
recordings (thanks to Lars Hanisch).
- Added generating a pkg-config file to the Makefile (thanks to Ville Skyttä).
- Removed the '.pl' suffix from all scripts (thanks to Ville Skyttä).
- Changed the default location for the LIRC socket to /var/run/lirc/lircd (thanks
to Ville Skyttä).
- Added file name and line number to LOG_ERROR_STR() (thanks to Rolf Ahrenberg).
- Replaced all calls to sleep() with cCondWait::SleepMs() (thanks to Rolf Ahrenberg).
- Fixed a crash with malformed SI data (patch from vdr-portal).
Diffstat (limited to 'PLUGINS/src/dvbhddevice/libhdffcmd/bitbuffer.c')
-rw-r--r-- | PLUGINS/src/dvbhddevice/libhdffcmd/bitbuffer.c | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/PLUGINS/src/dvbhddevice/libhdffcmd/bitbuffer.c b/PLUGINS/src/dvbhddevice/libhdffcmd/bitbuffer.c new file mode 100644 index 0000000..b85990d --- /dev/null +++ b/PLUGINS/src/dvbhddevice/libhdffcmd/bitbuffer.c @@ -0,0 +1,79 @@ +/********************************************************************** + * + * HDFF firmware command interface library + * + * Copyright (C) 2011 Andreas Regel + * + * 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 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + *********************************************************************/ + +#include <string.h> + +#include "bitbuffer.h" + +void BitBuffer_Init(BitBuffer_t * BitBuffer, + uint8_t * Data, uint32_t MaxLength) +{ + memset(Data, 0, MaxLength); + BitBuffer->Data = Data; + BitBuffer->MaxLength = MaxLength * 8; + BitBuffer->BitPos = 0; +} + +void BitBuffer_SetBits(BitBuffer_t * BitBuffer, int NumBits, uint32_t Data) +{ + uint32_t nextBitPos; + uint32_t bytePos; + uint32_t bitsInByte; + int shift; + + if (NumBits <= 0 || NumBits > 32) + return; + + nextBitPos = BitBuffer->BitPos + NumBits; + + if (nextBitPos > BitBuffer->MaxLength) + return; + + bytePos = BitBuffer->BitPos / 8; + bitsInByte = BitBuffer->BitPos % 8; + + BitBuffer->Data[bytePos] &= (uint8_t) (0xFF << (8 - bitsInByte)); + shift = NumBits - (8 - bitsInByte); + if (shift > 0) + BitBuffer->Data[bytePos] |= (uint8_t) (Data >> shift); + else + BitBuffer->Data[bytePos] |= (uint8_t) (Data << (-shift)); + NumBits -= 8 - bitsInByte; + bytePos++; + while (NumBits > 0) + { + shift = NumBits - 8; + if (shift > 0) + BitBuffer->Data[bytePos] = (uint8_t) (Data >> shift); + else + BitBuffer->Data[bytePos] = (uint8_t) (Data << (-shift)); + NumBits -= 8; + bytePos++; + } + BitBuffer->BitPos = nextBitPos; +} + +uint32_t BitBuffer_GetByteLength(BitBuffer_t * BitBuffer) +{ + return (BitBuffer->BitPos + 7) / 8; +} |