save timing information after record
authorFelix Domke <tmbinc@elitedvb.net>
Mon, 13 Feb 2006 17:03:56 +0000 (17:03 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Mon, 13 Feb 2006 17:03:56 +0000 (17:03 +0000)
lib/dvb/demux.cpp
lib/dvb/demux.h
lib/dvb/idemux.h
lib/service/servicedvbrecord.cpp

index 73e0443..6753f2f 100644 (file)
@@ -273,6 +273,8 @@ class eDVBRecordFileThread: public eFilePushThread
 public:
        eDVBRecordFileThread();
        void setTimingPID(int pid);
+       
+       void saveTimingInformation(const std::string &filename);
 protected:
        void filterRecordData(const unsigned char *data, int len);
 private:
@@ -293,6 +295,11 @@ void eDVBRecordFileThread::setTimingPID(int pid)
        m_ts_parser.setPid(pid);
 }
 
+void eDVBRecordFileThread::saveTimingInformation(const std::string &filename)
+{
+       m_stream_info.save(filename.c_str());
+}
+
 void eDVBRecordFileThread::filterRecordData(const unsigned char *data, int len)
 {
        m_ts_parser.parseData(m_current_offset, data, len);
@@ -385,6 +392,11 @@ RESULT eDVBTSRecorder::setTargetFD(int fd)
        return 0;
 }
 
+RESULT eDVBTSRecorder::setTargetFilename(const char *filename)
+{
+       m_target_filename = filename;
+}
+
 RESULT eDVBTSRecorder::setBoundary(off_t max)
 {
        return -1; // not yet implemented
@@ -401,6 +413,9 @@ RESULT eDVBTSRecorder::stop()
        
        close(m_source_fd);
        
+       if (m_target_filename != "")
+               m_thread->saveTimingInformation(m_target_filename + ".ap");
+       
        return 0;
 }
 
index f539006..19ed1a1 100644 (file)
@@ -76,6 +76,7 @@ public:
        RESULT setTimingPID(int pid);
        
        RESULT setTargetFD(int fd);
+       RESULT setTargetFilename(const char *filename);
        RESULT setBoundary(off_t max);
        
        RESULT stop();
@@ -93,6 +94,7 @@ private:
        ePtr<eDVBDemux> m_demux;
        
        int m_running, m_target_fd, m_source_fd;
+       std::string m_target_filename;
 };
 
 #endif
index 6cf7b02..8511992 100644 (file)
@@ -65,6 +65,8 @@ public:
        virtual RESULT setTimingPID(int pid) = 0;
        
        virtual RESULT setTargetFD(int fd) = 0;
+               /* for saving additional meta data. */
+       virtual RESULT setTargetFilename(const char *filename) = 0;
        virtual RESULT setBoundary(off_t max) = 0;
        
        virtual RESULT stop() = 0;
index 5b4f35e..bded7cc 100644 (file)
@@ -122,6 +122,7 @@ int eDVBServiceRecord::doRecord()
                        return -3;
                }
                m_record->setTargetFD(fd);
+               m_record->setTargetFilename(m_filename.c_str());
        }
        eDebug("starting recording..");