Commit 5a28d999 authored by Klaus Schmidinger's avatar Klaus Schmidinger Committed by Dieter Hametner

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).
parent 0c96d6b6
......@@ -1117,6 +1117,9 @@ Rolf Ahrenberg <rahrenbe@cc.hut.fi>
for making the Audio and Subtitles options available through the Green and Yellow
keys in the Setup/DVB menu
for making the Recordings menu display the length (in hours:minutes) of each recording
for fixing handling DVB subtitles and implementing decoding textual DVB subtitles
for adding file name and line number to LOG_ERROR_STR()
for replacing all calls to sleep() with cCondWait::SleepMs()
Ralf Klueber <ralf.klueber@vodafone.com>
for reporting a bug in cutting a recording if there is only a single editing mark
......@@ -1632,6 +1635,7 @@ Arthur Konovalov <artlov@gmail.com>
for reporting problems with CAMs when checking the CAM status too frequently
for reporting references to old *.vdr file names in MANUAL
for reporting that the video stream type was set to 2 even if the vpid was 0
for updates to 'sources.conf'
Milos Kapoun <m.kapoun@cra.cz>
for suggesting to skip code table info in SI data
......@@ -1868,6 +1872,8 @@ Luca Olivetti <luca@ventoso.org>
"repeat" keypresses very fast
for reporting a broken entry 'A111.1W' in sources.conf
for translating OSD texts to the Spanish and Catalan language
for fixing scaling subtitles in case the primary device's GetVideoSize() function
doesn't return actual values
Mikko Salo <mikko.salo@ppe.inet.fi>
for suggesting to make the setup option "DVB/Video display format" available only
......@@ -1918,6 +1924,11 @@ Ville Skytt
for fixing the Language header of the Serbian translation file
for using pkg-config to get fribidi, freetype and fontconfig cflags and libs
for making the Makefile also install the include files
for fixing a crash when deleting a recording while cutting it
for fixing several spelling errors
for adding generating a pkg-config file to the Makefile
for removing the '.pl' suffix from all scripts (thanks to Ville Skyttä).
for changing the default location for the LIRC socket to /var/run/lirc/lircd
Steffen Beyer <cpunk@reactor.de>
for fixing setting the colored button help after deleting a recording in case the next
......@@ -2244,6 +2255,7 @@ Christoph Haubrich <christoph1.haubrich@arcor.de>
for reporting that Setup.InitialChannel was dereferenced without checking for NULL
for suggesting to implement a function to determine the length of a recording's
index file
for fixing setting the start time of an edited recording
Pekka Mauno <pekka.mauno@iki.fi>
for fixing cSchedule::GetFollowingEvent() in case there is currently no present
......@@ -2659,6 +2671,8 @@ Stephan Austerm
Lars Hanisch <dvb@flensrocker.de>
for suggesting to assign the source character 'V' to "Analog Video"
for a patch that was used to implement SCR (Satellite Channel Routing)
for implementing the SVDRP command 'UPDR'
Alex Lasnier <alex@fepg.org>
for adding tuning support for ATSC devices
......@@ -2774,3 +2788,7 @@ Frank Niederwipper <f.niederwipper@gmail.com>
Chris Mayo <aklhfex@gmail.com>
for reporting a problem with detecting frames on radio channels
Dominic Evans <oldmanuk@gmail.com>
for making the SVDRP command LSTC accepts channel IDs
for adding cap_net_raw to the capabilities that are not dropped
......@@ -6742,3 +6742,41 @@ Video Disk Recorder Revision History
Detecting frames in case the Picture Start Code or Access Unit Delimiter
extends over TS packet boundaries is now done by locally skipping TS packets
in cFrameDetector.
2011-12-04: Version 1.7.22
- 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).
......@@ -386,6 +386,23 @@ accessed using DiSEqC, you have to go to the "Setup" menu and set the "DiSEqC"
parameter to "on". You also need to set up the file 'diseqc.conf' to properly
access your DiSEqC equipment (see man vdr(5) for details).
A special form of DiSEqC is used to connect several receivers to one signal
source using only a single cable. This method, known as "Satellite Channel Routing"
according to EN50494 (aka "Unicable(TM)", "OLT(TM)", "SatCR", "Single Cable
Distribution", "Channel Stacking System" or "Single Cable Interface") uses
the file "scr.conf" to specify which SCR channels use which user band frequency.
If DVB-S devices need to be connected to the same satellite cable, but no
"Satellite Channel Routing" is available, they can be set to be "bonded" in
the Setup/LNB menu. Bonded devices can only be tuned to the same polarization
and frequency band, which reduces the number of potentially receivable channels.
Note that it doesn't make sense to use "Satellite Channel Routing" and
"Device Bonding" at the same time with the same devices. If you use either
of these methods, it is necessary that your devices are always created in the
same sequence when the drivers are loaded. You may need to configure some
proper "udev" rules to make sure this happens.
Running VDR with DVB-C (cable) or DVB-T (terrestrial):
------------------------------------------------------
......
......@@ -732,12 +732,18 @@ Version 1.6
LNB:
Use DiSEqC = no Generally turns DiSEqC support on or off.
SLOF = 11700 The switching frequency (in MHz) between low and
high LOF
Low LNB frequency = 9750 The LNB's low and high local oscillator frequencies
High LNB frequency = 10600 (in MHz, these have no meaning for DVB-C receivers)
Use DiSEqC = no Generally turns DiSEqC support on or off.
Device n connected to sat cable = own
Defines whether DVB-S device n has its own satellite cable,
or is "bonded" with another device. All DVB-S devices that
are connected to the same sat cable must be set to the same
number here.
CAM:
......
......@@ -6,7 +6,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Make.config.template 2.3 2011/03/13 13:41:12 kls Exp $
# $Id: Make.config.template 2.4 2011/12/04 14:41:00 kls Exp $
### The C compiler and options:
......@@ -35,7 +35,7 @@ CONFDIR = $(VIDEODIR)
### The remote control:
LIRC_DEVICE = /dev/lircd
LIRC_DEVICE = /var/run/lirc/lircd
RCU_DEVICE = /dev/ttyS1
## Define if you want vdr to not run as root
......
......@@ -4,7 +4,7 @@
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: Makefile 2.18 2011/05/21 12:21:40 kls Exp $
# $Id: Makefile 2.22 2011/12/04 14:41:00 kls Exp $
.DELETE_ON_ERROR:
......@@ -33,6 +33,8 @@ CONFDIR = $(VIDEODIR)
DOXYGEN = /usr/bin/doxygen
DOXYFILE = Doxyfile
PCDIR ?= $(firstword $(subst :, , ${PKG_CONFIG_PATH}:$(shell pkg-config --variable=pc_path pkg-config):$(PREFIX)/lib/pkgconfig))
include Make.global
-include Make.config
......@@ -60,7 +62,7 @@ DEFINES += -DBIDI
LIBS += $(shell pkg-config --libs fribidi)
endif
LIRC_DEVICE ?= /dev/lircd
LIRC_DEVICE ?= /var/run/lirc/lircd
RCU_DEVICE ?= /dev/ttyS1
DEFINES += -DLIRC_DEVICE=\"$(LIRC_DEVICE)\" -DRCU_DEVICE=\"$(RCU_DEVICE)\"
......@@ -77,7 +79,7 @@ DEFINES += -DLOCDIR=\"$(LOCDIR)\"
VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
all: vdr i18n
all: vdr i18n vdr.pc
# Implicit rules:
......@@ -103,6 +105,25 @@ vdr: $(OBJS) $(SILIB)
$(SILIB):
$(MAKE) -C $(LSIDIR) all
# pkg-config file:
vdr.pc: Makefile Make.global
@echo "bindir=$(BINDIR)" > $@
@echo "includedir=$(INCDIR)" >> $@
@echo "configdir=$(CONFDIR)" >> $@
@echo "videodir=$(VIDEODIR)" >> $@
@echo "plugindir=$(PLUGINLIBDIR)" >> $@
@echo "localedir=$(LOCDIR)" >> $@
@echo "apiversion=$(APIVERSION)" >> $@
@echo "cflags=$(CXXFLAGS) $(DEFINES) -I\$${includedir}" >> $@
@echo "plugincflags=\$${cflags} -fPIC" >> $@
@echo "" >> $@
@echo "Name: VDR" >> $@
@echo "Description: Video Disk Recorder" >> $@
@echo "URL: http://www.tvdr.de/" >> $@
@echo "Version: $(VDRVERSION)" >> $@
@echo "Cflags: \$${cflags}" >> $@
# Internationalization (I18N):
PODIR = po
......@@ -163,13 +184,13 @@ clean-plugins:
# Install the files:
install: install-bin install-conf install-doc install-plugins install-i18n install-includes
install: install-bin install-conf install-doc install-plugins install-i18n install-includes install-pc
# VDR binary:
install-bin: vdr
@mkdir -p $(DESTDIR)$(BINDIR)
@cp --remove-destination vdr svdrpsend.pl $(DESTDIR)$(BINDIR)
@cp --remove-destination vdr svdrpsend $(DESTDIR)$(BINDIR)
# Configuration files:
......@@ -200,6 +221,14 @@ install-includes: include-dir
@mkdir -p $(DESTDIR)$(INCDIR)
@cp -pLR include/vdr include/libsi $(DESTDIR)$(INCDIR)
# pkg-config file:
install-pc: vdr.pc
if [ -n "$(PCDIR)" ] ; then \
mkdir -p $(DESTDIR)$(PCDIR) ; \
cp vdr.pc $(DESTDIR)$(PCDIR) ; \
fi
# Source documentation:
srcdoc:
......@@ -212,7 +241,7 @@ srcdoc:
clean:
$(MAKE) -C $(LSIDIR) clean
-rm -f $(OBJS) $(DEPFILE) vdr core* *~
-rm -f $(OBJS) $(DEPFILE) vdr vdr.pc core* *~
-rm -rf $(LOCALEDIR) $(PODIR)/*.mo $(PODIR)/*.pot
-rm -rf include
-rm -rf srcdoc
......
#
# Makefile for a Video Disk Recorder plugin
#
# $Id: Makefile 1.8 2011/05/21 12:25:33 kls Exp $
# $Id: Makefile 1.9 2011/12/04 15:30:21 kls Exp $
# The official name of this plugin.
# This name will be used in the '-P...' option of VDR to load the plugin.
......@@ -98,8 +98,9 @@ i18n: $(I18Nmsgs) $(I18Npot)
### Targets:
libvdr-$(PLUGIN).so: $(OBJS)
$(CXX) $(CXXFLAGS) -shared $(OBJS) -o $@
libvdr-$(PLUGIN).so: $(OBJS) libhdffcmd
$(MAKE) -C libhdffcmd all
$(CXX) $(CXXFLAGS) -shared $(OBJS) libhdffcmd/libhdffcmd.a -o $@
@cp --remove-destination $@ $(LIBDIR)/$@.$(APIVERSION)
dist: $(I18Npo) clean
......@@ -112,3 +113,4 @@ dist: $(I18Npo) clean
clean:
@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ $(PODIR)/*.mo $(PODIR)/*.pot
$(MAKE) -C libhdffcmd clean
......@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: dvbhdffdevice.c 1.33 2011/08/27 09:32:18 kls Exp $
* $Id: dvbhdffdevice.c 1.35 2011/12/04 15:30:42 kls Exp $
*/
#include "dvbhdffdevice.h"
......@@ -47,18 +47,18 @@ cDvbHdFfDevice::cDvbHdFfDevice(int Adapter, int Frontend)
isHdffPrimary = true;
mHdffCmdIf = new HDFF::cHdffCmdIf(fd_osd);
mHdffCmdIf->CmdAvSetAudioDelay(gHdffSetup.AudioDelay);
mHdffCmdIf->CmdAvSetAudioDownmix((HDFF::eDownmixMode) gHdffSetup.AudioDownmix);
mHdffCmdIf->CmdMuxSetVideoOut((HDFF::eVideoOut) gHdffSetup.AnalogueVideo);
mHdffCmdIf->CmdAvSetAudioDownmix((HdffAudioDownmixMode_t) gHdffSetup.AudioDownmix);
mHdffCmdIf->CmdMuxSetVideoOut((HdffVideoOut_t) gHdffSetup.AnalogueVideo);
mHdffCmdIf->CmdHdmiSetVideoMode(gHdffSetup.GetVideoMode());
HDFF::tHdmiConfig hdmiConfig;
HdffHdmiConfig_t hdmiConfig;
hdmiConfig.TransmitAudio = true;
hdmiConfig.ForceDviMode = false;
hdmiConfig.CecEnabled = gHdffSetup.CecEnabled;
hdmiConfig.VideoModeAdaption = (HDFF::eVideoModeAdaption) gHdffSetup.VideoModeAdaption;
hdmiConfig.VideoModeAdaption = (HdffVideoModeAdaption_t) gHdffSetup.VideoModeAdaption;
mHdffCmdIf->CmdHdmiConfigure(&hdmiConfig);
if (gHdffSetup.CecEnabled)
mHdffCmdIf->CmdHdmiSendCecCommand(HDFF::cecCommandTvOn);
mHdffCmdIf->CmdRemoteSetProtocol((HDFF::eRemoteProtocol) gHdffSetup.RemoteProtocol);
mHdffCmdIf->CmdHdmiSendCecCommand(HDFF_CEC_COMMAND_TV_ON);
mHdffCmdIf->CmdRemoteSetProtocol((HdffRemoteProtocol_t) gHdffSetup.RemoteProtocol);
mHdffCmdIf->CmdRemoteSetAddressFilter(gHdffSetup.RemoteAddress >= 0, gHdffSetup.RemoteAddress);
}
......@@ -109,11 +109,11 @@ void cDvbHdFfDevice::SetVideoDisplayFormat(eVideoDisplayFormat VideoDisplayForma
void cDvbHdFfDevice::SetVideoFormat(bool VideoFormat16_9)
{
HDFF::tVideoFormat videoFormat;
HdffVideoFormat_t videoFormat;
videoFormat.AutomaticEnabled = true;
videoFormat.AfdEnabled = true;
videoFormat.TvFormat = (HDFF::eTvFormat) gHdffSetup.TvFormat;
videoFormat.VideoConversion = (HDFF::eVideoConversion) gHdffSetup.VideoConversion;
videoFormat.TvFormat = (HdffTvFormat_t) gHdffSetup.TvFormat;
videoFormat.VideoConversion = (HdffVideoConversion_t) gHdffSetup.VideoConversion;
mHdffCmdIf->CmdAvSetVideoFormat(0, &videoFormat);
}
......@@ -184,14 +184,14 @@ bool cDvbHdFfDevice::SetPid(cPidHandle *Handle, int Type, bool On)
mHdffCmdIf->CmdAvSetPcrPid(0, Handle->pid);
else if (Type == ptVideo) {
if (Handle->streamType == 0x1B)
mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF::videoStreamH264);
mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF_VIDEO_STREAM_H264);
else
mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF::videoStreamMpeg2);
mHdffCmdIf->CmdAvSetVideoPid(0, Handle->pid, HDFF_VIDEO_STREAM_MPEG2);
}
else if (Type == ptAudio)
mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF::audioStreamMpeg1);
mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_MPEG1);
else if (Type == ptDolby)
mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF::audioStreamAc3);
mHdffCmdIf->CmdAvSetAudioPid(0, Handle->pid, HDFF_AUDIO_STREAM_AC3);
if (!(Type <= ptDolby && Handle->used <= 1)) {
pesFilterParams.pid = Handle->pid;
pesFilterParams.input = DMX_IN_FRONTEND;
......@@ -209,11 +209,11 @@ bool cDvbHdFfDevice::SetPid(cPidHandle *Handle, int Type, bool On)
if (Type == ptPcr)
mHdffCmdIf->CmdAvSetPcrPid(0, 0);
else if (Type == ptVideo)
mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF::videoStreamMpeg2);
mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF_VIDEO_STREAM_MPEG1);
else if (Type == ptAudio)
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF::audioStreamMpeg1);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_MPEG1);
else if (Type == ptDolby)
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF::audioStreamAc3);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_AC3);
//TODO missing setting to 0x1FFF??? see cDvbDevice::SetPid()
close(Handle->handle);
Handle->handle = -1;
......@@ -351,10 +351,13 @@ bool cDvbHdFfDevice::CanReplay(void) const
bool cDvbHdFfDevice::SetPlayMode(ePlayMode PlayMode)
{
if (PlayMode == pmNone) {
mHdffCmdIf->CmdAvSetVideoSpeed(0, 100);
mHdffCmdIf->CmdAvSetAudioSpeed(0, 100);
mHdffCmdIf->CmdAvEnableVideoAfterStop(0, false);
mHdffCmdIf->CmdAvSetPcrPid(0, 0);
mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF::videoStreamMpeg2);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF::audioStreamMpeg1);
mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF_VIDEO_STREAM_MPEG1);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_MPEG1);
ioctl(fd_video, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_DEMUX);
mHdffCmdIf->CmdAvSetDecoderInput(0, 0);
......@@ -374,6 +377,8 @@ bool cDvbHdFfDevice::SetPlayMode(ePlayMode PlayMode)
playAudioPid = -1;
audioCounter = 0;
videoCounter = 0;
freezed = false;
trickMode = false;
mHdffCmdIf->CmdAvSetDecoderInput(0, 2);
ioctl(fd_video, VIDEO_SELECT_SOURCE, VIDEO_SOURCE_MEMORY);
......@@ -405,18 +410,20 @@ int64_t cDvbHdFfDevice::GetSTC(void)
void cDvbHdFfDevice::TrickSpeed(int Speed)
{
freezed = false;
mHdffCmdIf->CmdAvEnableSync(0, false);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF::audioStreamMpeg1);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_MPEG1);
playAudioPid = -1;
if (Speed > 0)
mHdffCmdIf->CmdAvSetVideoSpeed(0, 100 / Speed);
trickMode = true;
}
void cDvbHdFfDevice::Clear(void)
{
CHECK(ioctl(fd_video, VIDEO_CLEAR_BUFFER));
mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF::videoStreamMpeg1);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF::audioStreamMpeg1);
mHdffCmdIf->CmdAvSetVideoPid(0, 0, HDFF_VIDEO_STREAM_MPEG1);
mHdffCmdIf->CmdAvSetAudioPid(0, 0, HDFF_AUDIO_STREAM_MPEG1);
playVideoPid = -1;
playAudioPid = -1;
cDevice::Clear();
......@@ -424,6 +431,8 @@ void cDvbHdFfDevice::Clear(void)
void cDvbHdFfDevice::Play(void)
{
freezed = false;
trickMode = false;
mHdffCmdIf->CmdAvEnableSync(0, true);
mHdffCmdIf->CmdAvSetVideoSpeed(0, 100);
mHdffCmdIf->CmdAvSetAudioSpeed(0, 100);
......@@ -432,6 +441,7 @@ void cDvbHdFfDevice::Play(void)
void cDvbHdFfDevice::Freeze(void)
{
freezed = true;
mHdffCmdIf->CmdAvSetVideoSpeed(0, 0);
mHdffCmdIf->CmdAvSetAudioSpeed(0, 0);
cDevice::Freeze();
......@@ -443,13 +453,13 @@ void cDvbHdFfDevice::Mute(void)
cDevice::Mute();
}
static HDFF::eVideoStreamType MapVideoStreamTypes(int Vtype)
static HdffVideoStreamType_t MapVideoStreamTypes(int Vtype)
{
switch (Vtype) {
case 0x01: return HDFF::videoStreamMpeg1;
case 0x02: return HDFF::videoStreamMpeg2;
case 0x1B: return HDFF::videoStreamH264;
default: return HDFF::videoStreamMpeg2; // fallback to MPEG2
case 0x01: return HDFF_VIDEO_STREAM_MPEG1;
case 0x02: return HDFF_VIDEO_STREAM_MPEG2;
case 0x1B: return HDFF_VIDEO_STREAM_H264;
default: return HDFF_VIDEO_STREAM_MPEG2; // fallback to MPEG2
}
}
......@@ -594,6 +604,8 @@ uint32_t cDvbHdFfDevice::PesToTs(uint8_t * TsBuffer, uint16_t Pid, uint8_t & Cou
int cDvbHdFfDevice::PlayVideo(const uchar *Data, int Length)
{
if (freezed)
return -1;
//TODO: support greater Length
uint8_t tsBuffer[188 * 16];
uint32_t tsLength;
......@@ -603,7 +615,7 @@ int cDvbHdFfDevice::PlayVideo(const uchar *Data, int Length)
if (pid != playVideoPid) {
playVideoPid = pid;
mHdffCmdIf->CmdAvSetVideoPid(0, playVideoPid, HDFF::videoStreamMpeg2, true);
mHdffCmdIf->CmdAvSetVideoPid(0, playVideoPid, HDFF_VIDEO_STREAM_MPEG2, true);
}
if (WriteAllOrNothing(fd_video, tsBuffer, tsLength, 1000, 10) <= 0)
Length = 0;
......@@ -612,39 +624,43 @@ int cDvbHdFfDevice::PlayVideo(const uchar *Data, int Length)
int cDvbHdFfDevice::PlayAudio(const uchar *Data, int Length, uchar Id)
{
if (freezed)
return -1;
if (trickMode)
return Length;
uint8_t streamId;
uint8_t tsBuffer[188 * 16];
uint32_t tsLength;
HDFF::eAudioStreamType streamType = HDFF::audioStreamMpeg1;
HDFF::eAVContainerType containerType = HDFF::avContainerPes;
HdffAudioStreamType_t streamType = HDFF_AUDIO_STREAM_MPEG1;
HdffAvContainerType_t containerType = HDFF_AV_CONTAINER_PES;
int pid;
streamId = Data[3];
if (streamId >= 0xC0 && streamId <= 0xDF)
{
streamType = HDFF::audioStreamMpeg1;
streamType = HDFF_AUDIO_STREAM_MPEG1;
}
else if (streamId == 0xBD)
{
const uint8_t * payload = Data + 9 + Data[8];
if ((payload[0] & 0xF8) == 0xA0)
{
containerType = HDFF::avContainerPesDvd;
streamType = HDFF::audioStreamPcm;
containerType = HDFF_AV_CONTAINER_PES_DVD;
streamType = HDFF_AUDIO_STREAM_PCM;
}
else if ((payload[0] & 0xF8) == 0x88)
{
containerType = HDFF::avContainerPesDvd;
streamType = HDFF::audioStreamDts;
containerType = HDFF_AV_CONTAINER_PES_DVD;
streamType = HDFF_AUDIO_STREAM_DTS;
}
else if ((payload[0] & 0xF8) == 0x80)
{
containerType = HDFF::avContainerPesDvd;
streamType = HDFF::audioStreamAc3;
containerType = HDFF_AV_CONTAINER_PES_DVD;
streamType = HDFF_AUDIO_STREAM_AC3;
}
else
{
streamType = HDFF::audioStreamAc3;
streamType = HDFF_AUDIO_STREAM_AC3;
}
}
pid = 200 + (int) streamType;
......@@ -661,6 +677,8 @@ int cDvbHdFfDevice::PlayAudio(const uchar *Data, int Length, uchar Id)
int cDvbHdFfDevice::PlayTsVideo(const uchar *Data, int Length)
{
if (freezed)
return -1;
int pid = TsPid(Data);
if (pid != playVideoPid) {
PatPmtParser();
......@@ -672,21 +690,25 @@ int cDvbHdFfDevice::PlayTsVideo(const uchar *Data, int Length)
return WriteAllOrNothing(fd_video, Data, Length, 1000, 10);
}
static HDFF::eAudioStreamType MapAudioStreamTypes(int Atype)
static HdffAudioStreamType_t MapAudioStreamTypes(int Atype)
{
switch (Atype) {
case 0x03: return HDFF::audioStreamMpeg1;
case 0x04: return HDFF::audioStreamMpeg2;
case SI::AC3DescriptorTag: return HDFF::audioStreamAc3;
case SI::EnhancedAC3DescriptorTag: return HDFF::audioStreamEAc3;
case 0x0F: return HDFF::audioStreamAac;
case 0x11: return HDFF::audioStreamHeAac;
default: return HDFF::audioStreamMaxValue; // there is no HDFF::audioStreamNone
case 0x03: return HDFF_AUDIO_STREAM_MPEG1;
case 0x04: return HDFF_AUDIO_STREAM_MPEG2;
case SI::AC3DescriptorTag: return HDFF_AUDIO_STREAM_AC3;
case SI::EnhancedAC3DescriptorTag: return HDFF_AUDIO_STREAM_EAC3;
case 0x0F: return HDFF_AUDIO_STREAM_AAC;
case 0x11: return HDFF_AUDIO_STREAM_HE_AAC;
default: return HDFF_AUDIO_STREAM_MPEG1;
}
}
int cDvbHdFfDevice::PlayTsAudio(const uchar *Data, int Length)
{
if (freezed)
return -1;
if (trickMode)
return Length;
int pid = TsPid(Data);
if (pid != playAudioPid) {
playAudioPid = pid;
......
......@@ -3,7 +3,7 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: dvbhdffdevice.h 1.6 2010/03/13 11:18:13 kls Exp $
* $Id: dvbhdffdevice.h 1.7 2011/09/10 10:17:32 kls Exp $
*/
#ifndef __DVBHDFFDEVICE_H
......@@ -79,6 +79,8 @@ protected:
private:
int playVideoPid;
int playAudioPid;
bool freezed;
bool trickMode;
// Pes2Ts conversion stuff
uint8_t videoCounter;
......
......@@ -3,34 +3,15 @@
*
* See the README file for copyright information and how to reach the author.
*
* $Id: hdffcmd.c 1.21 2011/08/27 09:34:18 kls Exp $
* $Id: hdffcmd.c 1.22 2011/12/04 15:31:03 kls Exp $
*/
#include "hdffcmd.h"
#include <linux/dvb/osd.h>
#include "libhdffcmd/hdffcmd.h"
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <vdr/tools.h>
#if !defined OSD_RAW_CMD
typedef struct osd_raw_cmd_s {
const void *cmd_data;
int cmd_len;
void *result_data;
int result_len;
} osd_raw_cmd_t;
typedef struct osd_raw_data_s {
const void *data_buffer;
int data_length;
int data_handle;
} osd_raw_data_t;
#define OSD_RAW_CMD _IOWR('o', 162, osd_raw_cmd_t)
#define OSD_RAW_DATA _IOWR('o', 163, osd_raw_data_t)
#endif
namespace HDFF
{
......@@ -48,1093 +29,347 @@ cHdffCmdIf::~cHdffCmdIf(void)
{
}
void cHdffCmdIf::CmdBuildHeader(cBitBuffer & MsgBuf, eMessageType MsgType, eMessageGroup MsgGroup, eMessageId MsgId)
{
MsgBuf.SetBits(16, 0); // length field will be set later
MsgBuf.SetBits(6, 0); // reserved
MsgBuf.SetBits(2, MsgType);
MsgBuf.SetBits(8, MsgGroup);
MsgBuf.SetBits(16, MsgId);
}
uint32_t cHdffCmdIf::CmdSetLength(cBitBuffer & MsgBuf)
{
uint32_t length;
length = MsgBuf.GetByteLength() - 2;
MsgBuf.SetDataByte(0, (uint8_t) (length >> 8));
MsgBuf.SetDataByte(1, (uint8_t) length);
return length + 2;
}
uint32_t cHdffCmdIf::CmdGetFirmwareVersion(char * pString, uint32_t MaxLength)
{
cBitBuffer cmdBuf(MAX_CMD_LEN);
cBitBuffer resBuf(MAX_CMD_LEN);
osd_raw_cmd_t osd_cmd;
memset(&osd_cmd, 0, sizeof(osd_raw_cmd_t));
osd_cmd.cmd_data = cmdBuf.GetData();
osd_cmd.result_data = resBuf.GetData();
osd_cmd.result_len = resBuf.GetMaxLength();
CmdBuildHeader(cmdBuf, msgTypeCommand, msgGroupGeneric, msgGenGetFirmwareVersion);
osd_cmd.cmd_len = CmdSetLength(cmdBuf);
ioctl(mOsdDev, OSD_RAW_CMD, &osd_cmd);
if (osd_cmd.result_len > 0)
{
uint8_t * result = resBuf.GetData();
uint8_t textLength = result[9];
if (textLength >= MaxLength)
textLength = MaxLength - 1;
memcpy(pString, &result[10], textLength);
pString[textLength] = 0;
return (result[6] << 16) | (result[7] << 8) | result[8];
}
uint32_t version;
int err;
err = HdffCmdGetFirmwareVersion(mOsdDev, &version, pString, MaxLength);
if (err == 0)
return version;
return 0;
}
uint32_t cHdffCmdIf::CmdGetInterfaceVersion(char * pString, uint32_t MaxLength)
{
cBitBuffer cmdBuf(MAX_CMD_LEN);
cBitBuffer resBuf(MAX_CMD_LEN);
osd_raw_cmd_t osd_cmd;
memset(&osd_cmd, 0, sizeof(osd_raw_cmd_t));
osd_cmd.cmd_data = cmdBuf.GetData();
osd_cmd.result_data = resBuf.GetData();
osd_cmd.result_len = resBuf.GetMaxLength();
CmdBuildHeader(cmdBuf, msgTypeCommand, msgGroupGeneric, msgGenGetInterfaceVersion);
osd_cmd.cmd_len = CmdSetLength(cmdBuf);
ioctl(mOsdDev, OSD_RAW_CMD, &osd_cmd);
if (osd_cmd.result_len > 0)
{
uint8_t * result = resBuf.GetData();
uint8_t textLength = result[9];
if (textLength >= MaxLength)
textLength = <