From 616adfc77dc1d08f3bfcd79991a78c6350e4e2f6 Mon Sep 17 00:00:00 2001 From: lvw Date: Fri, 28 May 2004 15:29:19 +0000 Subject: Merged player branch back on HEAD branch. git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@98 e10066b5-e1e2-0310-b819-94efdf66514b --- vdr_decoder.h | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 vdr_decoder.h (limited to 'vdr_decoder.h') diff --git a/vdr_decoder.h b/vdr_decoder.h new file mode 100644 index 0000000..74b200e --- /dev/null +++ b/vdr_decoder.h @@ -0,0 +1,158 @@ +/*! + * \file vdr_decoder.h + * \brief A generic decoder for a VDR media plugin (muggle) + * + * \version $Revision: 1.2 $ + * \date $Date: 2004/05/28 15:29:18 $ + * \author Ralf Klueber, Lars von Wedel, Andreas Kellner + * \author Responsible author: $Author: lvw $ + * + * $Id: vdr_decoder.h,v 1.2 2004/05/28 15:29:18 lvw Exp $ + * + * Adapted from + * MP3/MPlayer plugin to VDR (C++) + * (C) 2001,2002 Stefan Huelswitt + */ + +#ifndef ___DECODER_H +#define ___DECODER_H + +#include + +#include +#include + +#define DEC_ID(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) + +// --------From decoder_core.h ------------------------------------ + +/*! + * \brief The current status of the decoder + */ +enum eDecodeStatus + { + dsOK=0, dsPlay, dsSkip, dsEof, dsError, dsSoftError + }; + +// ---------------------------------------------------------------- + +/*! + * \brief A data structure to put decoded PCM data + */ +struct mgDecode +{ + eDecodeStatus status; + int index; + struct mad_pcm *pcm; +}; + +// ---------------------------------------------------------------- + +/*! + * \brief Information about ??? + */ +class mgPlayInfo +{ +public: + int m_index, m_total; +}; + +// ---------------------------------------------------------------- + +/*! + * \brief Media types + */ +enum mgMediaType +{ + MT_MP3, MT_MP3_STREAM, MT_OGG, MT_FLAC +}; + +/*! + * \brief A generic decoder class to handle conversion into PCM format + */ +class mgDecoder +{ +protected: + + /*! \brief The currently playing file */ + std::string m_filename; + + /*! \brief Mutexes to coordinate threads */ + cMutex m_lock, m_locklock; + int m_locked; + bool m_urgentLock; + + /*! \brief Whether the decoder is currently active */ + bool m_playing; + + /*! \brief ??? */ + mgPlayInfo m_playinfo; + + /*! \brief Place a lock */ + virtual void lock( bool urgent = false ); + + /*! \brief Release a lock */ + virtual void unlock(void); + + /*! \brief Try to obtain a lock */ + virtual bool tryLock(void); + +public: + + /*! \brief The constructor */ + mgDecoder( std::string filename ); + + /*! \brief The destructor */ + virtual ~mgDecoder(); + + /*! \brief Whether a decoder instance is able to play the given file */ + virtual bool valid() = 0; + + /*! \brief Whether a stream (i.e. from the network is being decoded */ + virtual bool isStream() + { + return false; + } + + /*! \brief Start decoding */ + virtual bool start() = 0; + + /*! \brief Stop decoding */ + virtual bool stop() = 0; + + /*! \brief Skip an amount of time. Impossible by default */ + virtual bool skip( int seconds, int avail, int rate) + { + return false; + } + + /*! \brief Return decoded data */ + virtual struct mgDecode *decode() = 0; + + /*! \brief Information about the current playback status */ + virtual mgPlayInfo *playInfo() + { + return 0; + } +}; + +// ---------------------------------------------------------------- + +/*! + * \brief A generic decoder manager class to handle different decoders + */ +class mgDecoders +{ +public: + + /*! \brief Try to find a valid decoder for a file + */ + static mgDecoder *findDecoder( std::string filename ); + + /*! \brief determine the media type for a given source + */ + static mgMediaType getMediaType( std::string filename ); + +}; + +#endif //___DECODER_H -- cgit v1.2.3 From 653ca204d10b3481670a80769baa3d768bb5f64a Mon Sep 17 00:00:00 2001 From: lvw Date: Tue, 7 Sep 2004 17:40:47 +0000 Subject: Merged ogg vorbis player to trunk git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@148 e10066b5-e1e2-0310-b819-94efdf66514b --- vdr_decoder.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'vdr_decoder.h') diff --git a/vdr_decoder.h b/vdr_decoder.h index 74b200e..a673cbc 100644 --- a/vdr_decoder.h +++ b/vdr_decoder.h @@ -1,13 +1,14 @@ /*! * \file vdr_decoder.h * \brief A generic decoder for a VDR media plugin (muggle) + * \ingroup vdr * * \version $Revision: 1.2 $ - * \date $Date: 2004/05/28 15:29:18 $ + * \date $Date$ * \author Ralf Klueber, Lars von Wedel, Andreas Kellner - * \author Responsible author: $Author: lvw $ + * \author Responsible author: $Author$ * - * $Id: vdr_decoder.h,v 1.2 2004/05/28 15:29:18 lvw Exp $ + * $Id$ * * Adapted from * MP3/MPlayer plugin to VDR (C++) @@ -24,10 +25,13 @@ #define DEC_ID(a,b,c,d) (((a)<<24)+((b)<<16)+((c)<<8)+(d)) +class mgContentItem; + // --------From decoder_core.h ------------------------------------ /*! * \brief The current status of the decoder + * \ingroup vdr */ enum eDecodeStatus { @@ -38,6 +42,7 @@ enum eDecodeStatus /*! * \brief A data structure to put decoded PCM data + * \ingroup vdr */ struct mgDecode { @@ -50,6 +55,7 @@ struct mgDecode /*! * \brief Information about ??? + * \ingroup vdr */ class mgPlayInfo { @@ -61,19 +67,24 @@ public: /*! * \brief Media types + * \ingroup vdr */ enum mgMediaType { - MT_MP3, MT_MP3_STREAM, MT_OGG, MT_FLAC + MT_MP3, MT_MP3_STREAM, MT_OGG, MT_FLAC, MT_UNKNOWN }; /*! * \brief A generic decoder class to handle conversion into PCM format + * \ingroup vdr */ class mgDecoder { protected: + /*! \brief database handle to the track being decoded */ + mgContentItem *m_item; + /*! \brief The currently playing file */ std::string m_filename; @@ -99,11 +110,13 @@ protected: public: + //@{ /*! \brief The constructor */ - mgDecoder( std::string filename ); + mgDecoder( mgContentItem *item ); /*! \brief The destructor */ virtual ~mgDecoder(); + //@} /*! \brief Whether a decoder instance is able to play the given file */ virtual bool valid() = 0; @@ -147,7 +160,7 @@ public: /*! \brief Try to find a valid decoder for a file */ - static mgDecoder *findDecoder( std::string filename ); + static mgDecoder *findDecoder( mgContentItem *item ); /*! \brief determine the media type for a given source */ -- cgit v1.2.3 From 0756ae40d68d403082c86adef042a4c0daba219f Mon Sep 17 00:00:00 2001 From: LarsAC Date: Fri, 7 Jan 2005 18:43:03 +0000 Subject: Merged branch osd_extensions back to main trunk git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@324 e10066b5-e1e2-0310-b819-94efdf66514b --- vdr_decoder.h | 153 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 76 insertions(+), 77 deletions(-) (limited to 'vdr_decoder.h') diff --git a/vdr_decoder.h b/vdr_decoder.h index a673cbc..ee943ce 100644 --- a/vdr_decoder.h +++ b/vdr_decoder.h @@ -10,7 +10,7 @@ * * $Id$ * - * Adapted from + * Adapted from * MP3/MPlayer plugin to VDR (C++) * (C) 2001,2002 Stefan Huelswitt */ @@ -29,143 +29,142 @@ class mgContentItem; // --------From decoder_core.h ------------------------------------ -/*! +/*! * \brief The current status of the decoder * \ingroup vdr */ enum eDecodeStatus - { - dsOK=0, dsPlay, dsSkip, dsEof, dsError, dsSoftError - }; +{ + dsOK = 0, dsPlay, dsSkip, dsEof, dsError, dsSoftError +}; // ---------------------------------------------------------------- -/*! +/*! * \brief A data structure to put decoded PCM data * \ingroup vdr */ struct mgDecode { - eDecodeStatus status; - int index; - struct mad_pcm *pcm; + eDecodeStatus status; + int index; + struct mad_pcm *pcm; }; // ---------------------------------------------------------------- -/*! +/*! * \brief Information about ??? * \ingroup vdr */ class mgPlayInfo { -public: - int m_index, m_total; + public: + int m_index, m_total; }; // ---------------------------------------------------------------- -/*! +/*! * \brief Media types * \ingroup vdr */ enum mgMediaType { - MT_MP3, MT_MP3_STREAM, MT_OGG, MT_FLAC, MT_UNKNOWN + MT_MP3, MT_MP3_STREAM, MT_OGG, MT_FLAC, MT_UNKNOWN }; -/*! +/*! * \brief A generic decoder class to handle conversion into PCM format * \ingroup vdr */ class mgDecoder { -protected: + protected: - /*! \brief database handle to the track being decoded */ - mgContentItem *m_item; +/*! \brief database handle to the track being decoded */ + mgContentItem * m_item; - /*! \brief The currently playing file */ - std::string m_filename; +/*! \brief The currently playing file */ + std::string m_filename; - /*! \brief Mutexes to coordinate threads */ - cMutex m_lock, m_locklock; - int m_locked; - bool m_urgentLock; - - /*! \brief Whether the decoder is currently active */ - bool m_playing; +/*! \brief Mutexes to coordinate threads */ + cMutex m_lock, m_locklock; + int m_locked; + bool m_urgentLock; - /*! \brief ??? */ - mgPlayInfo m_playinfo; +/*! \brief Whether the decoder is currently active */ + bool m_playing; - /*! \brief Place a lock */ - virtual void lock( bool urgent = false ); +/*! \brief ??? */ + mgPlayInfo m_playinfo; - /*! \brief Release a lock */ - virtual void unlock(void); +/*! \brief Place a lock */ + virtual void lock (bool urgent = false); - /*! \brief Try to obtain a lock */ - virtual bool tryLock(void); +/*! \brief Release a lock */ + virtual void unlock (void); -public: +/*! \brief Try to obtain a lock */ + virtual bool tryLock (void); - //@{ - /*! \brief The constructor */ - mgDecoder( mgContentItem *item ); + public: - /*! \brief The destructor */ - virtual ~mgDecoder(); - //@} +//@{ +/*! \brief The constructor */ + mgDecoder (mgContentItem * item); - /*! \brief Whether a decoder instance is able to play the given file */ - virtual bool valid() = 0; +/*! \brief The destructor */ + virtual ~ mgDecoder (); +//@} - /*! \brief Whether a stream (i.e. from the network is being decoded */ - virtual bool isStream() - { - return false; - } +/*! \brief Whether a decoder instance is able to play the given file */ + virtual bool valid () = 0; - /*! \brief Start decoding */ - virtual bool start() = 0; +/*! \brief Whether a stream (i.e. from the network is being decoded */ + virtual bool isStream () + { + return false; + } - /*! \brief Stop decoding */ - virtual bool stop() = 0; +/*! \brief Start decoding */ + virtual bool start () = 0; - /*! \brief Skip an amount of time. Impossible by default */ - virtual bool skip( int seconds, int avail, int rate) - { - return false; - } +/*! \brief Stop decoding */ + virtual bool stop () = 0; - /*! \brief Return decoded data */ - virtual struct mgDecode *decode() = 0; +/*! \brief Skip an amount of time. Impossible by default */ + virtual bool skip (int seconds, int avail, int rate) + { + return false; + } - /*! \brief Information about the current playback status */ - virtual mgPlayInfo *playInfo() - { - return 0; - } +/*! \brief Return decoded data */ + virtual struct mgDecode *decode () = 0; + +/*! \brief Information about the current playback status */ + virtual mgPlayInfo *playInfo () + { + return 0; + } }; - + // ---------------------------------------------------------------- -/*! +/*! * \brief A generic decoder manager class to handle different decoders */ class mgDecoders { -public: - - /*! \brief Try to find a valid decoder for a file - */ - static mgDecoder *findDecoder( mgContentItem *item ); + public: - /*! \brief determine the media type for a given source - */ - static mgMediaType getMediaType( std::string filename ); +/*! \brief Try to find a valid decoder for a file + */ + static mgDecoder *findDecoder (mgContentItem * item); -}; +/*! \brief determine the media type for a given source + */ + static mgMediaType getMediaType (std::string filename); -#endif //___DECODER_H +}; +#endif //___DECODER_H -- cgit v1.2.3 From 05801055e91bef231bb6aa48a96034e69bd7f250 Mon Sep 17 00:00:00 2001 From: LarsAC Date: Sun, 23 Jan 2005 13:03:34 +0000 Subject: Merged branches osd_extensions and flac_player for new release, yet untested git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@386 e10066b5-e1e2-0310-b819-94efdf66514b --- vdr_decoder.h | 150 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 75 insertions(+), 75 deletions(-) (limited to 'vdr_decoder.h') diff --git a/vdr_decoder.h b/vdr_decoder.h index ee943ce..3dd6c00 100644 --- a/vdr_decoder.h +++ b/vdr_decoder.h @@ -82,71 +82,71 @@ class mgDecoder { protected: -/*! \brief database handle to the track being decoded */ - mgContentItem * m_item; - -/*! \brief The currently playing file */ - std::string m_filename; - -/*! \brief Mutexes to coordinate threads */ - cMutex m_lock, m_locklock; - int m_locked; - bool m_urgentLock; - -/*! \brief Whether the decoder is currently active */ - bool m_playing; - -/*! \brief ??? */ - mgPlayInfo m_playinfo; - -/*! \brief Place a lock */ - virtual void lock (bool urgent = false); - -/*! \brief Release a lock */ - virtual void unlock (void); - -/*! \brief Try to obtain a lock */ - virtual bool tryLock (void); - - public: - -//@{ -/*! \brief The constructor */ - mgDecoder (mgContentItem * item); - -/*! \brief The destructor */ - virtual ~ mgDecoder (); -//@} - -/*! \brief Whether a decoder instance is able to play the given file */ - virtual bool valid () = 0; - -/*! \brief Whether a stream (i.e. from the network is being decoded */ - virtual bool isStream () - { - return false; - } - -/*! \brief Start decoding */ - virtual bool start () = 0; - -/*! \brief Stop decoding */ - virtual bool stop () = 0; - -/*! \brief Skip an amount of time. Impossible by default */ - virtual bool skip (int seconds, int avail, int rate) - { - return false; - } - -/*! \brief Return decoded data */ - virtual struct mgDecode *decode () = 0; - -/*! \brief Information about the current playback status */ - virtual mgPlayInfo *playInfo () - { - return 0; - } + /*! \brief database handle to the track being decoded */ + mgContentItem * m_item; + + /*! \brief The currently playing file */ + std::string m_filename; + + /*! \brief Mutexes to coordinate threads */ + cMutex m_lock, m_locklock; + int m_locked; + bool m_urgentLock; + + /*! \brief Whether the decoder is currently active */ + bool m_playing; + + /*! \brief ??? */ + mgPlayInfo m_playinfo; + + /*! \brief Place a lock */ + virtual void lock (bool urgent = false); + + /*! \brief Release a lock */ + virtual void unlock (void); + + /*! \brief Try to obtain a lock */ + virtual bool tryLock (void); + + public: + + //@{ + /*! \brief The constructor */ + mgDecoder (mgContentItem * item); + + /*! \brief The destructor */ + virtual ~ mgDecoder (); + //@} + + /*! \brief Whether a decoder instance is able to play the given file */ + virtual bool valid () = 0; + + /*! \brief Whether a stream (i.e. from the network is being decoded */ + virtual bool isStream () + { + return false; + } + + /*! \brief Start decoding */ + virtual bool start () = 0; + + /*! \brief Stop decoding */ + virtual bool stop () = 0; + + /*! \brief Skip an amount of time. Impossible by default */ + virtual bool skip (int seconds, int avail, int rate) + { + return false; + } + + /*! \brief Return decoded data */ + virtual struct mgDecode *decode () = 0; + + /*! \brief Information about the current playback status */ + virtual mgPlayInfo *playInfo () + { + return 0; + } }; // ---------------------------------------------------------------- @@ -156,15 +156,15 @@ class mgDecoder */ class mgDecoders { - public: - -/*! \brief Try to find a valid decoder for a file - */ - static mgDecoder *findDecoder (mgContentItem * item); - -/*! \brief determine the media type for a given source - */ - static mgMediaType getMediaType (std::string filename); - + public: + + /*! \brief Try to find a valid decoder for a file + */ + static mgDecoder *findDecoder (mgContentItem * item); + + /*! \brief determine the media type for a given source + */ + static mgMediaType getMediaType (std::string filename); + }; #endif //___DECODER_H -- cgit v1.2.3