iTsSource: add method to retrieve the current stream offset
authorpieterg <pieterg@users.sourceforge.net>
Fri, 10 Feb 2012 12:28:50 +0000 (13:28 +0100)
committerpieterg <pieterg@users.sourceforge.net>
Fri, 10 Feb 2012 12:41:32 +0000 (13:41 +0100)
Only valid for file sources

lib/base/httpstream.cpp
lib/base/httpstream.h
lib/base/itssource.h
lib/base/rawfile.cpp
lib/base/rawfile.h
lib/service/servicem2ts.cpp

index 343109e..fdf7a99 100644 (file)
@@ -122,3 +122,8 @@ off_t eHttpStream::length()
 {
        return (off_t)-1;
 }
+
+off_t eHttpStream::offset()
+{
+       return 0;
+}
index f02bb24..f48f3c9 100644 (file)
@@ -16,6 +16,7 @@ class eHttpStream: public iTsSource, public eSocketBase, public Object
        off_t lseek(off_t offset, int whence);
        ssize_t read(off_t offset, void *buf, size_t count);
        off_t length();
+       off_t offset();
        int valid();
 
 public:
index 69fec3a..4070923 100644 (file)
@@ -18,6 +18,7 @@ public:
 
        virtual off_t length()=0;
        virtual int valid()=0;
+       virtual off_t offset() = 0;
        int getPacketSize() { return packetSize; }
 };
 
index 745020e..d94602d 100644 (file)
@@ -255,3 +255,8 @@ off_t eRawFile::length()
 {
        return m_totallength;
 }
+
+off_t eRawFile::offset()
+{
+       return m_last_offset;
+}
index 3ca6f90..f27135a 100644 (file)
@@ -19,6 +19,7 @@ public:
        off_t lseek(off_t offset, int whence);
        ssize_t read(off_t offset, void *buf, size_t count);
        off_t length();
+       off_t offset();
        int valid();
 private:
        int m_fd;     /* for uncached */
index 8f64235..87d0233 100644 (file)
@@ -19,6 +19,7 @@ public:
        off_t lseek(off_t offset, int whence);
        ssize_t read(off_t offset, void *buf, size_t count);
        off_t length();
+       off_t offset();
        int valid();
 private:
        int m_sync_offset;
@@ -311,6 +312,11 @@ off_t eM2TSFile::length()
        return m_length;
 }
 
+off_t eM2TSFile::offset()
+{
+       return m_current_offset;
+}
+
 eServiceFactoryM2TS::eServiceFactoryM2TS()
 {
        ePtr<eServiceCenter> sc;