From dbf38b7c68911187b6a48688b738c31612d35984 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 14 Oct 2007 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.5.10=20-=20Implemented=20handling=20DVB=20s?= =?UTF-8?q?ubtitles=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler,=20and=20?= =?UTF-8?q?also=20to=20=20=20Pekka=20Virtanen=20for=20writing=20the=20subt?= =?UTF-8?q?itle=20plugin,=20which=20helped=20in=20implementing=20=20=20sub?= =?UTF-8?q?title=20handling=20in=20VDR).=20-=20The=20new=20remote=20contro?= =?UTF-8?q?l=20key=20"Subtitles"=20can=20be=20used=20to=20bring=20up=20the?= =?UTF-8?q?=20list=20=20=20of=20available=20subtitles.=20-=20The=20new=20s?= =?UTF-8?q?etup=20option=20"DVB/Subtitle=20languages"=20can=20be=20used=20?= =?UTF-8?q?to=20define=20the=20=20=20preferred=20languages=20for=20subtitl?= =?UTF-8?q?es.=20-=20Fixed=20selecting=20the=20audio=20track=20when=20pres?= =?UTF-8?q?sing=20Ok=20in=20the=20Audio=20menu=20(thanks=20=20=20to=20Marc?= =?UTF-8?q?o=20Schl=C3=BC=C3=9Fler).=20-=20Implemented=20display=20of=20DV?= =?UTF-8?q?B=20subtitles=20in=20live=20viewing=20mode.=20-=20Implemented?= =?UTF-8?q?=20subtitle=20track=20selection.=20-=20Implemented=20bitmap=20c?= =?UTF-8?q?olor=20reduction=20and=20shrinking=20to=20display=20subtitles?= =?UTF-8?q?=20even=20=20=20on=20devices=20that=20can't=20display=20the=20n?= =?UTF-8?q?ecessary=20number=20of=20colors.=20-=20Added=20compatibility=20?= =?UTF-8?q?mode=20for=20playback=20of=20recordings=20made=20with=20the=20s?= =?UTF-8?q?ubtitles=20=20=20plugin=20(with=20some=20help=20from=20Rolf=20A?= =?UTF-8?q?hrenberg).=20-=20The=20new=20setup=20option=20"DVB/Subtitle=20o?= =?UTF-8?q?ffset"=20can=20be=20used=20to=20shift=20the=20location=20=20=20?= =?UTF-8?q?of=20the=20subtitles=20in=20the=20vertical=20direction.=20-=20T?= =?UTF-8?q?he=20new=20setup=20options=20"DVB/Subtitle=20foreground/backgro?= =?UTF-8?q?und=20transparency"=20=20=20define=20an=20additional=20level=20?= =?UTF-8?q?of=20transparency=20for=20the=20foreground=20and=20background?= =?UTF-8?q?=20=20=20color=20of=20subtitles.=20-=20Existing=20recordings=20?= =?UTF-8?q?made=20with=20the=20subtitle=20plugin=20can=20be=20given=20an?= =?UTF-8?q?=20'X'=20record=20=20=20in=20their=20info.vdr=20file,=20so=20th?= =?UTF-8?q?at=20subtitles=20can=20be=20automatically=20selected=20upon=20?= =?UTF-8?q?=20=20replay,=20according=20to=20the=20preferred=20language=20s?= =?UTF-8?q?etup,=20as=20in=20=20=20X=203=2003=20ger=20deutsch=20=20=20(see?= =?UTF-8?q?=20vdr.5).=20Note=20that=20these=20entries=20need=20to=20be=20a?= =?UTF-8?q?dded=20in=20the=20proper=20sequence,=20=20=20so=20that=20they?= =?UTF-8?q?=20correspond=20with=20the=20actual=20track=20languages=20in=20?= =?UTF-8?q?the=20recording.=20-=20Now=20generating=20translation=20files?= =?UTF-8?q?=20without=20line=20numbers=20to=20avoid=20unnecessarily=20=20?= =?UTF-8?q?=20large=20diffs.=20Plugin=20authors=20may=20want=20to=20replac?= =?UTF-8?q?e=20the=20-F=20option=20with=20=20=20--no-location=20in=20the?= =?UTF-8?q?=20xgettext=20and=20msgmerge=20calls=20in=20their=20Makefiles.?= =?UTF-8?q?=20-=20Updated=20the=20Finnish=20OSD=20texts=20(thanks=20to=20R?= =?UTF-8?q?olf=20Ahrenberg).=20-=20Added=20a=20missing=20Channels.SetModif?= =?UTF-8?q?ied(true)=20call=20when=20deleting=20or=20moving=20a=20=20=20ch?= =?UTF-8?q?annel=20in=20the=20Channels=20menu=20(reported=20by=20Halim=20S?= =?UTF-8?q?ahin).=20-=20Fixed=20a=20missing=20'-'=20at=20the=20next=20to?= =?UTF-8?q?=20last=20line=20of=20SVDRP=20help=20texts=20(reported=20by=20?= =?UTF-8?q?=20=20Denis=20Knauf).=20-=20Added=20a=20missing=20SetVolumeDevi?= =?UTF-8?q?ce()=20call=20in=20cDevice::SetPrimaryDevice()=20(reported=20?= =?UTF-8?q?=20=20by=20Reinhard=20Nissl).=20-=20Fixed=20a=20crash=20when=20?= =?UTF-8?q?pressing=20Left=20while=20at=20the=20first=20character=20of=20a?= =?UTF-8?q?=20cMenuEditStrItem=20=20=20(thanks=20to=20Christian=20Wieninge?= =?UTF-8?q?r).=20-=20Only=20creating=20a=20new=20cDvbOsdProvider=20in=20cD?= =?UTF-8?q?vbDevice::MakePrimaryDevice()=20if=20'On'=20=20=20is=20true=20(?= =?UTF-8?q?i.e.=20this=20device=20is=20being=20made=20the=20primary=20devi?= =?UTF-8?q?ce).=20-=20Updated=20the=20Italian=20OSD=20texts=20(thanks=20to?= =?UTF-8?q?=20Diego=20Pierotto).=20-=20Fixed=20handling=20reallocated=20me?= =?UTF-8?q?mory=20in=20cCharSetConv::Convert()=20(reported=20by=20Udo=20?= =?UTF-8?q?=20=20Richter).=20-=20Fixed=20a=20new[]/delete=20mismatch=20in?= =?UTF-8?q?=20cMenuEditStrItem::LeaveEditMode()=20(thanks=20to=20=20=20Udo?= =?UTF-8?q?=20Richter).=20-=20Implemented=20sending=20all=20frames=20to=20?= =?UTF-8?q?devices=20that=20can=20handle=20them=20in=20fast=20forward=20?= =?UTF-8?q?=20=20trick=20speeds=20(thanks=20to=20Timo=20Eskola).=20-=20Upd?= =?UTF-8?q?ated=20the=20Hungarian=20language=20texts=20(thanks=20to=20Thom?= =?UTF-8?q?as=20G=C3=BCnther).=20-=20Fixed=20description=20of=20DeviceSetA?= =?UTF-8?q?vailableTrack()=20and=20cReceiver(),=20and=20added=20an=20=20?= =?UTF-8?q?=20example=20~cMyReceiver()=20in=20PLUGINS.html=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Improved=20the=20descrip?= =?UTF-8?q?tion=20of=20where=20logging=20goes=20in=20the=20INSTALL=20file?= =?UTF-8?q?=20(thanks=20to=20=20=20Elias=20Luttinen).=20-=20Added=20a=20no?= =?UTF-8?q?te=20about=20how=20to=20initiate=20internationalization=20suppo?= =?UTF-8?q?rt=20to=20the=20=20=20README.i18n=20file.=20The=20Makefile=20ge?= =?UTF-8?q?nerated=20by=20the=20'newplugin'=20script=20now=20has=20the=20?= =?UTF-8?q?=20=20'i18n'=20target=20automatically=20create=20an=20initial?= =?UTF-8?q?=20'po/pluginname.pot'=20file.=20=20=20Plugin=20authors=20may?= =?UTF-8?q?=20want=20to=20add=20the=20'$(I18Npot)'=20dependency=20to=20the?= =?UTF-8?q?=20'i18n'=20=20=20target=20in=20their=20Makefiles,=20as=20in=20?= =?UTF-8?q?=20=20i18n:=20$(I18Npot)=20$(I18Nmo)=20=20=20(based=20on=20a=20?= =?UTF-8?q?suggestion=20by=20Torsten=20Kunkel).=20-=20Removed=20a=20duplic?= =?UTF-8?q?ate=20','=20from=20the=20ca=5FES.po=20file=20(thanks=20to=20Tho?= =?UTF-8?q?mas=20G=C3=BCnther).=20-=20Added=20the=20'=C3=9F'=20character?= =?UTF-8?q?=20to=20the=20"allowed=20characters"=20in=20the=20de=5FDE.po=20?= =?UTF-8?q?file=20=20=20(suggested=20by=20Thomas=20G=C3=BCnther).=20-=20Ma?= =?UTF-8?q?de=20the=20default=20copy=20ctor=20of=20cRecording=20private=20?= =?UTF-8?q?(thanks=20to=20Markus=20Hahn).=20=20=20Same=20for=20the=20assig?= =?UTF-8?q?n=20operator.=20-=20Added=20cRecording::Undelete()=20(based=20o?= =?UTF-8?q?n=20a=20patch=20from=20Markus=20Hahn).=20-=20Added=20cDevice::C?= =?UTF-8?q?loseFilter()=20to=20allow=20a=20device=20to=20have=20complete?= =?UTF-8?q?=20control=20over=20=20=20both=20opening=20and=20closing=20sect?= =?UTF-8?q?ion=20filters=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Some=20?= =?UTF-8?q?fixes=20to=20PLUGINS.html=20(thanks=20to=20Rolf=20Ahrenberg).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device.h | 46 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'device.h') diff --git a/device.h b/device.h index e74c884..825aadf 100644 --- a/device.h +++ b/device.h @@ -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 -- cgit v1.2.3