summaryrefslogtreecommitdiff
path: root/src/lib/transcoder.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-05-09 13:58:35 +0100
committerCarl Hetherington <cth@carlh.net>2017-05-09 13:58:35 +0100
commit76ee27e08be5bf8e4a9eeb4fef09de307c6a6aa8 (patch)
tree311bb483943f696360ba4ef5a28abb5f23beb410 /src/lib/transcoder.h
parent0f42e807a707249cd1a60fa6e476cb47a4147c5a (diff)
Make Transcoder a virtual base.
Diffstat (limited to 'src/lib/transcoder.h')
-rw-r--r--src/lib/transcoder.h33
1 files changed, 14 insertions, 19 deletions
diff --git a/src/lib/transcoder.h b/src/lib/transcoder.h
index 50cbfdfec..b6378119b 100644
--- a/src/lib/transcoder.h
+++ b/src/lib/transcoder.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,6 +18,9 @@
*/
+#ifndef DCPOMATIC_TRANSCODER_H
+#define DCPOMATIC_TRANSCODER_H
+
#include "types.h"
#include "player_subtitles.h"
#include <boost/weak_ptr.hpp>
@@ -25,7 +28,6 @@
class Film;
class Encoder;
class Player;
-class Writer;
class Job;
class PlayerVideo;
class AudioBuffers;
@@ -35,28 +37,21 @@ class Transcoder : public boost::noncopyable
{
public:
Transcoder (boost::shared_ptr<const Film> film, boost::weak_ptr<Job> job);
+ virtual ~Transcoder () {}
- void go ();
-
- float current_encoding_rate () const;
- int video_frames_enqueued () const;
+ virtual void go () = 0;
- /** @return true if we are in the process of calling Encoder::process_end */
- bool finishing () const {
- return _finishing;
- }
+ virtual float current_encoding_rate () const = 0;
+ virtual int video_frames_enqueued () const = 0;
-private:
-
- void video (boost::shared_ptr<PlayerVideo>, DCPTime);
- void audio (boost::shared_ptr<AudioBuffers>, DCPTime);
- void subtitle (PlayerSubtitles, DCPTimePeriod);
+protected:
+ virtual void video (boost::shared_ptr<PlayerVideo>, DCPTime) = 0;
+ virtual void audio (boost::shared_ptr<AudioBuffers>, DCPTime) = 0;
+ virtual void subtitle (PlayerSubtitles, DCPTimePeriod) = 0;
boost::shared_ptr<const Film> _film;
boost::weak_ptr<Job> _job;
boost::shared_ptr<Player> _player;
- boost::shared_ptr<Writer> _writer;
- boost::shared_ptr<Encoder> _encoder;
- bool _finishing;
- bool _non_burnt_subtitles;
};
+
+#endif