From: ghost Date: Wed, 24 Nov 2010 15:06:57 +0000 (+0100) Subject: rename iDataSource to iTsSource (no functional change) X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=commitdiff_plain;h=453fc1c6f82fa3b6ae983059eb55ad822860a5eb rename iDataSource to iTsSource (no functional change) --- diff --git a/lib/base/filepush.cpp b/lib/base/filepush.cpp index af5a8bb..e3e2a13 100644 --- a/lib/base/filepush.cpp +++ b/lib/base/filepush.cpp @@ -227,7 +227,7 @@ void eFilePushThread::thread() void eFilePushThread::start(int fd, int fd_dest) { eRawFile *f = new eRawFile(); - ePtr source = f; + ePtr source = f; f->setfd(fd); start(source, fd_dest); } @@ -235,14 +235,14 @@ void eFilePushThread::start(int fd, int fd_dest) int eFilePushThread::start(const char *file, int fd_dest) { eRawFile *f = new eRawFile(); - ePtr source = f; + ePtr source = f; if (f->open(file) < 0) return -1; start(source, fd_dest); return 0; } -void eFilePushThread::start(ePtr &source, int fd_dest) +void eFilePushThread::start(ePtr &source, int fd_dest) { m_source = source; m_fd_dest = fd_dest; diff --git a/lib/base/filepush.h b/lib/base/filepush.h index eb8e792..a4457f6 100644 --- a/lib/base/filepush.h +++ b/lib/base/filepush.h @@ -25,7 +25,7 @@ public: void start(int sourcefd, int destfd); int start(const char *filename, int destfd); - void start(ePtr &source, int destfd); + void start(ePtr &source, int destfd); void pause(); void resume(); @@ -60,7 +60,7 @@ private: int m_blocksize; off_t m_current_position; - ePtr m_source; + ePtr m_source; eFixedMessagePump m_messagepump; diff --git a/lib/base/idatasource.h b/lib/base/idatasource.h deleted file mode 100644 index 0daa526..0000000 --- a/lib/base/idatasource.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __lib_base_idatasource_h -#define __lib_base_idatasource_h - -#include - -class iDataSource: public iObject -{ -public: - /* NOTE: should only be used to get current position or filelength */ - virtual off_t lseek(off_t offset, int whence)=0; - - /* NOTE: you must be able to handle short reads! */ - virtual ssize_t read(off_t offset, void *buf, size_t count)=0; /* NOTE: this is what you in normal case have to use!! */ - - virtual off_t length()=0; - virtual int valid()=0; -}; - -#endif diff --git a/lib/base/itssource.h b/lib/base/itssource.h new file mode 100644 index 0000000..91167ff --- /dev/null +++ b/lib/base/itssource.h @@ -0,0 +1,19 @@ +#ifndef __lib_base_idatasource_h +#define __lib_base_idatasource_h + +#include + +class iTsSource: public iObject +{ +public: + /* NOTE: should only be used to get current position or filelength */ + virtual off_t lseek(off_t offset, int whence)=0; + + /* NOTE: you must be able to handle short reads! */ + virtual ssize_t read(off_t offset, void *buf, size_t count)=0; /* NOTE: this is what you in normal case have to use!! */ + + virtual off_t length()=0; + virtual int valid()=0; +}; + +#endif diff --git a/lib/base/rawfile.h b/lib/base/rawfile.h index 1720d58..7b736a3 100644 --- a/lib/base/rawfile.h +++ b/lib/base/rawfile.h @@ -2,9 +2,9 @@ #define __lib_base_rawfile_h #include -#include +#include -class eRawFile: public iDataSource +class eRawFile: public iTsSource { DECLARE_REF(eRawFile); eSingleLock m_lock; @@ -15,7 +15,7 @@ public: void setfd(int fd); int close(); - // iDataSource + // iTsSource off_t lseek(off_t offset, int whence); ssize_t read(off_t offset, void *buf, size_t count); off_t length(); diff --git a/lib/dvb/dvb.cpp b/lib/dvb/dvb.cpp index c980ac5..414ab8d 100644 --- a/lib/dvb/dvb.cpp +++ b/lib/dvb/dvb.cpp @@ -1753,7 +1753,7 @@ RESULT eDVBChannel::getCurrentFrontendParameters(ePtr &p RESULT eDVBChannel::playFile(const char *file) { eRawFile *f = new eRawFile(); - ePtr source = f; + ePtr source = f; if (f->open(file) < 0) { @@ -1764,7 +1764,7 @@ RESULT eDVBChannel::playFile(const char *file) return playSource(source, file); } -RESULT eDVBChannel::playSource(ePtr &source, const char *streaminfo_file) +RESULT eDVBChannel::playSource(ePtr &source, const char *streaminfo_file) { ASSERT(!m_frontend); if (m_pvr_thread) @@ -1826,7 +1826,7 @@ void eDVBChannel::stopSource() } if (m_pvr_fd_dst >= 0) ::close(m_pvr_fd_dst); - ePtr d; + ePtr d; m_tstools.setSource(d); } diff --git a/lib/dvb/dvb.h b/lib/dvb/dvb.h index 9277160..f612aff 100644 --- a/lib/dvb/dvb.h +++ b/lib/dvb/dvb.h @@ -260,7 +260,7 @@ public: RESULT playFile(const char *file); void stopFile(); - RESULT playSource(ePtr& source, const char *priv=NULL); + RESULT playSource(ePtr& source, const char *priv=NULL); void stopSource(); void setCueSheet(eCueSheet *cuesheet); diff --git a/lib/dvb/idvb.h b/lib/dvb/idvb.h index 3996b6b..f15cd04 100644 --- a/lib/dvb/idvb.h +++ b/lib/dvb/idvb.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include @@ -607,7 +607,7 @@ public: virtual void stopFile() = 0; /* new interface */ - virtual RESULT playSource(ePtr &source, const char *priv=NULL) = 0; + virtual RESULT playSource(ePtr &source, const char *priv=NULL) = 0; virtual void stopSource() = 0; virtual void setCueSheet(eCueSheet *cuesheet) = 0; diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp index 7b79966..46fa12e 100644 --- a/lib/dvb/pmt.cpp +++ b/lib/dvb/pmt.cpp @@ -675,11 +675,11 @@ void eDVBServicePMTHandler::SDTScanEvent(int event) int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *cue, bool simulate, eDVBService *service) { - ePtr s; + ePtr s; return tuneExt(ref, use_decode_demux, s, NULL, cue, simulate, service); } -int eDVBServicePMTHandler::tuneExt(eServiceReferenceDVB &ref, int use_decode_demux, ePtr &source, const char *streaminfo_file, eCueSheet *cue, bool simulate, eDVBService *service) +int eDVBServicePMTHandler::tuneExt(eServiceReferenceDVB &ref, int use_decode_demux, ePtr &source, const char *streaminfo_file, eCueSheet *cue, bool simulate, eDVBService *service) { RESULT res=0; m_reference = ref; diff --git a/lib/dvb/pmt.h b/lib/dvb/pmt.h index 721a8fc..de0de05 100644 --- a/lib/dvb/pmt.h +++ b/lib/dvb/pmt.h @@ -209,7 +209,7 @@ public: int tune(eServiceReferenceDVB &ref, int use_decode_demux, eCueSheet *sg=0, bool simulate=false, eDVBService *service = 0); /* new interface */ - int tuneExt(eServiceReferenceDVB &ref, int use_decode_demux, ePtr &, const char *streaminfo_file, eCueSheet *sg=0, bool simulate=false, eDVBService *service = 0); + int tuneExt(eServiceReferenceDVB &ref, int use_decode_demux, ePtr &, const char *streaminfo_file, eCueSheet *sg=0, bool simulate=false, eDVBService *service = 0); void free(); private: diff --git a/lib/dvb/tstools.cpp b/lib/dvb/tstools.cpp index bd36308..cfea3fd 100644 --- a/lib/dvb/tstools.cpp +++ b/lib/dvb/tstools.cpp @@ -35,7 +35,7 @@ eDVBTSTools::~eDVBTSTools() int eDVBTSTools::openFile(const char *filename, int nostreaminfo) { eRawFile *f = new eRawFile(); - ePtr src = f; + ePtr src = f; if (f->open(filename, 1) < 0) return -1; @@ -45,7 +45,7 @@ int eDVBTSTools::openFile(const char *filename, int nostreaminfo) return 0; } -void eDVBTSTools::setSource(ePtr &source, const char *stream_info_filename) +void eDVBTSTools::setSource(ePtr &source, const char *stream_info_filename) { closeFile(); diff --git a/lib/dvb/tstools.h b/lib/dvb/tstools.h index 1192cd2..9982792 100644 --- a/lib/dvb/tstools.h +++ b/lib/dvb/tstools.h @@ -19,7 +19,7 @@ public: eDVBTSTools(); ~eDVBTSTools(); - void setSource(ePtr &source, const char *streaminfo_filename=NULL); + void setSource(ePtr &source, const char *streaminfo_filename=NULL); void closeSource(); int openFile(const char *filename, int nostreaminfo = 0); @@ -80,7 +80,7 @@ private: int m_pid; int m_maxrange; - ePtr m_source; + ePtr m_source; int m_begin_valid, m_end_valid; pts_t m_pts_begin, m_pts_end; diff --git a/lib/service/servicedvb.cpp b/lib/service/servicedvb.cpp index 1e58d84..0d617c3 100644 --- a/lib/service/servicedvb.cpp +++ b/lib/service/servicedvb.cpp @@ -1094,7 +1094,7 @@ void eDVBServicePlay::serviceEventTimeshift(int event) if (m_skipmode < 0) m_cue->seekTo(0, -1000); - ePtr source = createDataSource(r); + ePtr source = createTsSource(r); m_service_handler_timeshift.tuneExt(r, 1, source, r.path.c_str(), m_cue, 0, m_dvb_service); /* use the decoder demux for everything */ m_event((iPlayableService*)this, evUser+1); @@ -1124,7 +1124,7 @@ void eDVBServicePlay::serviceEventTimeshift(int event) m_service_handler_timeshift.free(); resetTimeshift(1); - ePtr source = createDataSource(r); + ePtr source = createTsSource(r); m_service_handler_timeshift.tuneExt(r, 1, source, m_timeshift_file_next.c_str(), m_cue, 0, m_dvb_service); /* use the decoder demux for everything */ m_event((iPlayableService*)this, evUser+1); @@ -1155,7 +1155,7 @@ RESULT eDVBServicePlay::start() m_event(this, evStart); m_first_program_info = 1; - ePtr source = createDataSource(service); + ePtr source = createTsSource(service); m_service_handler.tuneExt(service, m_is_pvr, source, service.path.c_str(), m_cue, false, m_dvb_service); if (m_is_pvr) @@ -2360,11 +2360,11 @@ void eDVBServicePlay::resetTimeshift(int start) m_timeshift_active = 0; } -ePtr eDVBServicePlay::createDataSource(eServiceReferenceDVB &ref) +ePtr eDVBServicePlay::createTsSource(eServiceReferenceDVB &ref) { eRawFile *f = new eRawFile(); f->open(ref.path.c_str()); - return ePtr(f); + return ePtr(f); } void eDVBServicePlay::switchToTimeshift() @@ -2379,7 +2379,7 @@ void eDVBServicePlay::switchToTimeshift() m_cue->seekTo(0, -1000); - ePtr source = createDataSource(r); + ePtr source = createTsSource(r); m_service_handler_timeshift.tuneExt(r, 1, source, m_timeshift_file.c_str(), m_cue, 0, m_dvb_service); /* use the decoder demux for everything */ eDebug("eDVBServicePlay::switchToTimeshift, in pause mode now."); diff --git a/lib/service/servicedvb.h b/lib/service/servicedvb.h index 23675bf..3efc259 100644 --- a/lib/service/servicedvb.h +++ b/lib/service/servicedvb.h @@ -290,7 +290,7 @@ protected: ePtr m_video_event_connection; void video_event(struct iTSMPEGDecoder::videoEvent); - virtual ePtr createDataSource(eServiceReferenceDVB &ref); + virtual ePtr createTsSource(eServiceReferenceDVB &ref); }; class eStaticServiceDVBBouquetInformation: public iStaticServiceInformation