Merge master; fix crash on new film.
[dcpomatic.git] / src / lib / video_source.h
index e60e7dfd09dce7fc16d31a126ddca4a83698a37e..9b4c9b4a2040db794a94b179da4e2c46dcdb7dc8 100644 (file)
  *  @brief Parent class for classes which emit video data.
  */
 
-#ifndef DVDOMATIC_VIDEO_SOURCE_H
-#define DVDOMATIC_VIDEO_SOURCE_H
+#ifndef DCPOMATIC_VIDEO_SOURCE_H
+#define DCPOMATIC_VIDEO_SOURCE_H
 
 #include <boost/shared_ptr.hpp>
 #include <boost/signals2.hpp>
 #include "util.h"
 
 class VideoSink;
+class TimedVideoSink;
 class Subtitle;
 class Image;
 
 /** @class VideoSource
- *  @param A class that emits video data.
+ *  @param A class that emits video data without timestamps.
  */
 class VideoSource
 {
@@ -44,9 +45,28 @@ public:
         *  Second parameter is true if the image is the same as the last one that was emitted.
         *  Third parameter is either 0 or a subtitle that should be on this frame.
         */
-       boost::signals2::signal<void (boost::shared_ptr<Image>, bool, boost::shared_ptr<Subtitle>)> Video;
+       boost::signals2::signal<void (boost::shared_ptr<const Image>, bool, boost::shared_ptr<Subtitle>)> Video;
 
        void connect_video (boost::shared_ptr<VideoSink>);
 };
 
+/** @class TimedVideoSource
+ *  @param A class that emits video data with timestamps.
+ */
+class TimedVideoSource
+{
+public:
+
+       /** Emitted when a video frame is ready.
+        *  First parameter is the video image.
+        *  Second parameter is true if the image is the same as the last one that was emitted.
+        *  Third parameter is either 0 or a subtitle that should be on this frame.
+        *  Fourth parameter is the source timestamp of this frame.
+        */
+       boost::signals2::signal<void (boost::shared_ptr<const Image>, bool, boost::shared_ptr<Subtitle>, double)> Video;
+
+       void connect_video (boost::shared_ptr<VideoSink>);
+       void connect_video (boost::shared_ptr<TimedVideoSink>);
+};
+
 #endif