summaryrefslogtreecommitdiff
path: root/src/lib/transcoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-26 01:21:21 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-26 17:04:31 +0100
commit09a9ac376db005a40a351736bcff4077f098825d (patch)
tree64ea69741155d15d114ad96daf0f90e24b3abe28 /src/lib/transcoder.cc
parent46cd0fe7b5b514f0d9456b25f670679cc584a218 (diff)
Another try at sorting out the thorny question of timing.
Diffstat (limited to 'src/lib/transcoder.cc')
-rw-r--r--src/lib/transcoder.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/lib/transcoder.cc b/src/lib/transcoder.cc
index f4637a05c..f4a52639a 100644
--- a/src/lib/transcoder.cc
+++ b/src/lib/transcoder.cc
@@ -36,8 +36,27 @@
using std::string;
using boost::shared_ptr;
+using boost::weak_ptr;
using boost::dynamic_pointer_cast;
+static void
+video_proxy (weak_ptr<Encoder> encoder, shared_ptr<const Image> image, bool same)
+{
+ shared_ptr<Encoder> e = encoder.lock ();
+ if (e) {
+ e->process_video (image, same);
+ }
+}
+
+static void
+audio_proxy (weak_ptr<Encoder> encoder, shared_ptr<const AudioBuffers> audio)
+{
+ shared_ptr<Encoder> e = encoder.lock ();
+ if (e) {
+ e->process_audio (audio);
+ }
+}
+
/** Construct a transcoder using a Decoder that we create and a supplied Encoder.
* @param f Film that we are transcoding.
* @param j Job that we are running under, or 0.
@@ -48,8 +67,8 @@ Transcoder::Transcoder (shared_ptr<const Film> f, shared_ptr<Job> j)
, _player (f->player ())
, _encoder (new Encoder (f, j))
{
- _player->connect_video (_encoder);
- _player->connect_audio (_encoder);
+ _player->Video.connect (bind (video_proxy, _encoder, _1, _2));
+ _player->Audio.connect (bind (audio_proxy, _encoder, _1));
}
void