summaryrefslogtreecommitdiff
path: root/src/lib/video_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-12-18 09:39:36 +0000
committerCarl Hetherington <cth@carlh.net>2013-12-18 09:39:36 +0000
commit9c399a21b37d83ceb2c81706975e2c46d1a3f673 (patch)
tree5b1123cd22cad797c9587c22927f9c9249ed4ca4 /src/lib/video_decoder.cc
parentda19eaac0dd80afed3dd282d61ea3298196a5090 (diff)
Considerable rework of decoder timing; tests pass, at least.
Diffstat (limited to 'src/lib/video_decoder.cc')
-rw-r--r--src/lib/video_decoder.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc
index 72caf72e9..3a8891111 100644
--- a/src/lib/video_decoder.cc
+++ b/src/lib/video_decoder.cc
@@ -24,6 +24,7 @@
using std::cout;
using boost::shared_ptr;
+using boost::optional;
VideoDecoder::VideoDecoder (shared_ptr<const Film> f, shared_ptr<const VideoContent> c)
: Decoder (f)
@@ -32,20 +33,20 @@ VideoDecoder::VideoDecoder (shared_ptr<const Film> f, shared_ptr<const VideoCont
}
+/** Called by subclasses when they have a video frame ready */
void
VideoDecoder::video (shared_ptr<const Image> image, bool same, ContentTime time)
{
switch (_video_content->video_frame_type ()) {
case VIDEO_FRAME_TYPE_2D:
- Video (image, EYES_BOTH, same, time);
+ _pending.push_back (shared_ptr<DecodedVideo> (new DecodedVideo (image, EYES_BOTH, same, time)));
break;
case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT:
{
int const half = image->size().width / 2;
- Video (image->crop (Crop (0, half, 0, 0), true), EYES_LEFT, same, time);
- Video (image->crop (Crop (half, 0, 0, 0), true), EYES_RIGHT, same, time);
+ _pending.push_back (shared_ptr<DecodedVideo> (new DecodedVideo (image->crop (Crop (0, half, 0, 0), true), EYES_LEFT, same, time)));
+ _pending.push_back (shared_ptr<DecodedVideo> (new DecodedVideo (image->crop (Crop (half, 0, 0, 0), true), EYES_RIGHT, same, time)));
break;
}
}
}
-