summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2017-05-09 23:08:34 +0100
committerCarl Hetherington <cth@carlh.net>2017-05-09 23:08:34 +0100
commitb19987ae5342602977b265ba9167ec09e433367c (patch)
tree7225dfbf58e7e07135b58d44e0ebb390df6178ac /src/lib
parent78c27b4fa4d23d4a0a64f0398350ec5697d50551 (diff)
Some export tidying up.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/encoder.cc2
-rw-r--r--src/lib/event_history.h5
-rw-r--r--src/lib/ffmpeg_transcoder.cc15
-rw-r--r--src/lib/ffmpeg_transcoder.h17
4 files changed, 27 insertions, 12 deletions
diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc
index e82c4af7e..2d916d47e 100644
--- a/src/lib/encoder.cc
+++ b/src/lib/encoder.cc
@@ -59,8 +59,8 @@ using dcp::Data;
*/
Encoder::Encoder (shared_ptr<const Film> film, shared_ptr<Writer> writer)
: _film (film)
- , _writer (writer)
, _history (200)
+ , _writer (writer)
{
servers_list_changed ();
}
diff --git a/src/lib/event_history.h b/src/lib/event_history.h
index 5b0f9a6a3..f723591fb 100644
--- a/src/lib/event_history.h
+++ b/src/lib/event_history.h
@@ -18,6 +18,9 @@
*/
+#ifndef DCPOMATIC_EVENT_HISTORY_H
+#define DCPOMATIC_EVENT_HISTORY_H
+
#include <boost/thread/mutex.hpp>
#include <list>
@@ -39,3 +42,5 @@ private:
/** Number of events that we should keep history for */
int const _size;
};
+
+#endif
diff --git a/src/lib/ffmpeg_transcoder.cc b/src/lib/ffmpeg_transcoder.cc
index 19c55ff7a..b3d1e9926 100644
--- a/src/lib/ffmpeg_transcoder.cc
+++ b/src/lib/ffmpeg_transcoder.cc
@@ -43,21 +43,24 @@ force_pixel_format (AVPixelFormat, AVPixelFormat out)
return out;
}
-FFmpegTranscoder::FFmpegTranscoder (shared_ptr<const Film> film, weak_ptr<Job> job)
+FFmpegTranscoder::FFmpegTranscoder (shared_ptr<const Film> film, weak_ptr<Job> job, boost::filesystem::path output, Format format)
: Transcoder (film, job)
- , _pixel_format (AV_PIX_FMT_YUV422P10)
, _history (1000)
+ , _output (output)
{
-
+ switch (format) {
+ case FORMAT_PRORES:
+ _pixel_format = AV_PIX_FMT_YUV422P10;
+ _codec_name = "prores_ks";
+ }
}
void
FFmpegTranscoder::go ()
{
- string const codec_name = "prores_ks";
- AVCodec* codec = avcodec_find_encoder_by_name (codec_name.c_str());
+ AVCodec* codec = avcodec_find_encoder_by_name (_codec_name.c_str());
if (!codec) {
- throw runtime_error (String::compose ("could not find FFmpeg codec %1", codec_name));
+ throw runtime_error (String::compose ("could not find FFmpeg codec %1", _codec_name));
}
_codec_context = avcodec_alloc_context3 (codec);
diff --git a/src/lib/ffmpeg_transcoder.h b/src/lib/ffmpeg_transcoder.h
index 5380e84b0..9799285e2 100644
--- a/src/lib/ffmpeg_transcoder.h
+++ b/src/lib/ffmpeg_transcoder.h
@@ -18,6 +18,9 @@
*/
+#ifndef DCPOMATIC_FFMPEG_TRANSCODER_H
+#define DCPOMATIC_FFMPEG_TRANSCODER_H
+
#include "transcoder.h"
#include "event_history.h"
extern "C" {
@@ -28,7 +31,12 @@ extern "C" {
class FFmpegTranscoder : public Transcoder
{
public:
- FFmpegTranscoder (boost::shared_ptr<const Film> film, boost::weak_ptr<Job> job);
+ enum Format
+ {
+ FORMAT_PRORES
+ };
+
+ FFmpegTranscoder (boost::shared_ptr<const Film> film, boost::weak_ptr<Job> job, boost::filesystem::path output, Format format);
void go ();
@@ -38,10 +46,6 @@ public:
return false;
}
- void set_output (boost::filesystem::path o) {
- _output = o;
- }
-
private:
void video (boost::shared_ptr<PlayerVideo>, DCPTime);
void audio (boost::shared_ptr<AudioBuffers>, DCPTime);
@@ -51,6 +55,7 @@ private:
AVFormatContext* _format_context;
AVStream* _video_stream;
AVPixelFormat _pixel_format;
+ std::string _codec_name;
mutable boost::mutex _mutex;
DCPTime _last_time;
@@ -59,3 +64,5 @@ private:
boost::filesystem::path _output;
};
+
+#endif