diff options
author | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-10-14 18:00:00 +0200 |
---|---|---|
committer | Klaus Schmidinger <kls (at) cadsoft (dot) de> | 2007-10-14 18:00:00 +0200 |
commit | dbf38b7c68911187b6a48688b738c31612d35984 (patch) | |
tree | 4cc72f28e78f4a8dd63a63c5236bcbb77502073b /device.h | |
parent | 46c882c04d5200cc97262b15db2e4841b305664d (diff) | |
download | vdr-patch-lnbsharing-dbf38b7c68911187b6a48688b738c31612d35984.tar.gz vdr-patch-lnbsharing-dbf38b7c68911187b6a48688b738c31612d35984.tar.bz2 |
Version 1.5.10vdr-1.5.10
- Implemented handling DVB subtitles (thanks to Marco Schlüßler, and also to
Pekka Virtanen for writing the subtitle plugin, which helped in implementing
subtitle handling in VDR).
- The new remote control key "Subtitles" can be used to bring up the list
of available subtitles.
- The new setup option "DVB/Subtitle languages" can be used to define the
preferred languages for subtitles.
- Fixed selecting the audio track when pressing Ok in the Audio menu (thanks
to Marco Schlüßler).
- Implemented display of DVB subtitles in live viewing mode.
- Implemented subtitle track selection.
- Implemented bitmap color reduction and shrinking to display subtitles even
on devices that can't display the necessary number of colors.
- Added compatibility mode for playback of recordings made with the subtitles
plugin (with some help from Rolf Ahrenberg).
- The new setup option "DVB/Subtitle offset" can be used to shift the location
of the subtitles in the vertical direction.
- The new setup options "DVB/Subtitle foreground/background transparency"
define an additional level of transparency for the foreground and background
color of subtitles.
- Existing recordings made with the subtitle plugin can be given an 'X' record
in their info.vdr file, so that subtitles can be automatically selected upon
replay, according to the preferred language setup, as in
X 3 03 ger deutsch
(see vdr.5). Note that these entries need to be added in the proper sequence,
so that they correspond with the actual track languages in the recording.
- Now generating translation files without line numbers to avoid unnecessarily
large diffs. Plugin authors may want to replace the -F option with
--no-location in the xgettext and msgmerge calls in their Makefiles.
- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
- Added a missing Channels.SetModified(true) call when deleting or moving a
channel in the Channels menu (reported by Halim Sahin).
- Fixed a missing '-' at the next to last line of SVDRP help texts (reported by
Denis Knauf).
- Added a missing SetVolumeDevice() call in cDevice::SetPrimaryDevice() (reported
by Reinhard Nissl).
- Fixed a crash when pressing Left while at the first character of a cMenuEditStrItem
(thanks to Christian Wieninger).
- Only creating a new cDvbOsdProvider in cDvbDevice::MakePrimaryDevice() if 'On'
is true (i.e. this device is being made the primary device).
- Updated the Italian OSD texts (thanks to Diego Pierotto).
- Fixed handling reallocated memory in cCharSetConv::Convert() (reported by Udo
Richter).
- Fixed a new[]/delete mismatch in cMenuEditStrItem::LeaveEditMode() (thanks to
Udo Richter).
- Implemented sending all frames to devices that can handle them in fast forward
trick speeds (thanks to Timo Eskola).
- Updated the Hungarian language texts (thanks to Thomas Günther).
- Fixed description of DeviceSetAvailableTrack() and cReceiver(), and added an
example ~cMyReceiver() in PLUGINS.html (thanks to Marco Schlüßler).
- Improved the description of where logging goes in the INSTALL file (thanks to
Elias Luttinen).
- Added a note about how to initiate internationalization support to the
README.i18n file. The Makefile generated by the 'newplugin' script now has the
'i18n' target automatically create an initial 'po/pluginname.pot' file.
Plugin authors may want to add the '$(I18Npot)' dependency to the 'i18n'
target in their Makefiles, as in
i18n: $(I18Npot) $(I18Nmo)
(based on a suggestion by Torsten Kunkel).
- Removed a duplicate ',' from the ca_ES.po file (thanks to Thomas Günther).
- Added the 'ß' character to the "allowed characters" in the de_DE.po file
(suggested by Thomas Günther).
- Made the default copy ctor of cRecording private (thanks to Markus Hahn).
Same for the assign operator.
- Added cRecording::Undelete() (based on a patch from Markus Hahn).
- Added cDevice::CloseFilter() to allow a device to have complete control over
both opening and closing section filters (thanks to Rolf Ahrenberg).
- Some fixes to PLUGINS.html (thanks to Rolf Ahrenberg).
Diffstat (limited to 'device.h')
-rw-r--r-- | device.h | 46 |
1 files changed, 42 insertions, 4 deletions
@@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.h 1.82 2007/07/22 11:20:13 kls Exp $ + * $Id: device.h 1.85 2007/10/14 13:09:12 kls Exp $ */ #ifndef __DEVICE_H @@ -12,6 +12,7 @@ #include "channels.h" #include "ci.h" +#include "dvbsubtitle.h" #include "eit.h" #include "filter.h" #include "nit.h" @@ -70,16 +71,15 @@ enum eTrackType { ttNone, ttDolby, ttDolbyFirst = ttDolby, ttDolbyLast = ttDolbyFirst + 15, // MAXDPIDS - 1 - /* future... ttSubtitle, ttSubtitleFirst = ttSubtitle, - ttSubtitleLast = ttSubtitleFirst + 7, // MAXSPIDS - 1 - */ + ttSubtitleLast = ttSubtitleFirst + 31, // MAXSPIDS - 1 ttMaxTrackTypes }; #define IS_AUDIO_TRACK(t) (ttAudioFirst <= (t) && (t) <= ttAudioLast) #define IS_DOLBY_TRACK(t) (ttDolbyFirst <= (t) && (t) <= ttDolbyLast) +#define IS_SUBTITLE_TRACK(t) (ttSubtitleFirst <= (t) && (t) <= ttSubtitleLast) struct tTrackId { uint16_t id; // The PES packet id or the PID. @@ -90,10 +90,12 @@ struct tTrackId { class cPlayer; class cReceiver; class cPesAssembler; +class cLiveSubtitle; /// The cDevice class is the base from which actual devices can be derived. class cDevice : public cThread { + friend class cLiveSubtitle; private: static int numDevices; static int useDevice; @@ -185,6 +187,9 @@ public: // SPU facilities +private: + cLiveSubtitle *liveSubtitle; + cDvbSubtitleConverter *dvbSubtitleConverter; public: virtual cSpuDecoder *GetSpuDecoder(void); ///< Returns a pointer to the device's SPU decoder (or NULL, if this @@ -303,6 +308,11 @@ public: ///< Opens a file handle for the given filter data. ///< A derived device that provides section data must ///< implement this function. + virtual void CloseFilter(int Handle); + ///< Closes a file handle that has previously been opened + ///< by OpenFilter(). If this is as simple as calling close(Handle), + ///< a derived class need not implement this function, because this + ///< is done by the default implementation. void AttachFilter(cFilter *Filter); ///< Attaches the given filter to this device. void Detach(cFilter *Filter); @@ -362,8 +372,11 @@ public: private: tTrackId availableTracks[ttMaxTrackTypes]; eTrackType currentAudioTrack; + eTrackType currentSubtitleTrack; cMutex mutexCurrentAudioTrack; + cMutex mutexCurrentSubtitleTrack; int currentAudioTrackMissingCount; + bool autoSelectPreferredSubtitleLanguage; bool pre_1_3_19_PrivateStream; protected: virtual void SetAudioTrackDevice(eTrackType Type); @@ -384,18 +397,33 @@ public: const tTrackId *GetTrack(eTrackType Type); ///< Returns a pointer to the given track id, or NULL if Type is not ///< less than ttMaxTrackTypes. + int NumTracks(eTrackType FirstTrack, eTrackType LastTrack) const; + ///< Returns the number of tracks in the given range that are currently + ///< available. int NumAudioTracks(void) const; ///< Returns the number of audio tracks that are currently available. ///< This is just for information, to quickly find out whether there ///< is more than one audio track. + int NumSubtitleTracks(void) const; + ///< Returns the number of subtitle tracks that are currently available. eTrackType GetCurrentAudioTrack(void) { return currentAudioTrack; } bool SetCurrentAudioTrack(eTrackType Type); ///< Sets the current audio track to the given Type. ///< \return Returns true if Type is a valid audio track, false otherwise. + eTrackType GetCurrentSubtitleTrack(void) { return currentSubtitleTrack; } + bool SetCurrentSubtitleTrack(eTrackType Type, bool Manual = false); + ///< Sets the current subtitle track to the given Type. + ///< IF Manual is true, no automatic preferred subtitle language selection + ///< will be done for the rest of the current replay session, or until + ///< the channel is changed. + ///< \return Returns true if Type is a valid subtitle track, false otherwise. void EnsureAudioTrack(bool Force = false); ///< Makes sure an audio track is selected that is actually available. ///< If Force is true, the language and Dolby Digital settings will ///< be verified even if the current audio track is available. + void EnsureSubtitleTrack(void); + ///< Makes sure one of the preferred language subtitle tracks is selected. + ///< Only has an effect if Setup.DisplaySubtitles is on. // Audio facilities @@ -454,6 +482,13 @@ protected: ///< Length) or not at all (returning 0 or -1 and setting 'errno' to EAGAIN). ///< \return Returns the number of bytes actually taken from Data, or -1 ///< in case of an error. + virtual int PlaySubtitle(const uchar *Data, int Length); + ///< Plays the given data block as a subtitle. + ///< Data points to exactly one complete PES packet of the given Length. + ///< PlaySubtitle() shall process the packet either as a whole (returning + ///< Length) or not at all (returning 0 or -1 and setting 'errno' to EAGAIN). + ///< \return Returns the number of bytes actually taken from Data, or -1 + ///< in case of an error. virtual int PlayPesPacket(const uchar *Data, int Length, bool VideoOnly = false); ///< Plays the single PES packet in Data with the given Length. ///< If VideoOnly is true, only the video will be displayed, @@ -464,6 +499,9 @@ public: ///< Gets the current System Time Counter, which can be used to ///< synchronize audio and video. If this device is unable to ///< provide the STC, -1 will be returned. + virtual bool HasIBPTrickSpeed(void) { return false; } + ///< Returns true if this device can handle all frames in 'fast forward' + ///< trick speeds. virtual void TrickSpeed(int Speed); ///< Sets the device into a mode where replay is done slower. ///< Every single frame shall then be displayed the given number of |