return dec;
}
-/** Fill _decoded_video from `from' up to, but not including, `to' */
+/** Fill _decoded_video from `from' up to, but not including, `to' with
+ * a frame for one particular Eyes value (which could be EYES_BOTH,
+ * EYES_LEFT or EYES_RIGHT)
+ */
void
-VideoDecoder::fill_2d (Frame from, Frame to)
+VideoDecoder::fill_one_eye (Frame from, Frame to, Eyes eye)
{
if (to == 0) {
/* Already OK */
test_gaps++;
#endif
_decoded_video.push_back (
- ContentVideo (filler_image, EYES_BOTH, filler_part, i)
+ ContentVideo (filler_image, eye, filler_part, i)
);
}
}
-/** Fill _decoded_video from `from' up to, but not including, `to' */
+/** Fill _decoded_video from `from' up to, but not including, `to'
+ * adding both left and right eye frames.
+ */
void
-VideoDecoder::fill_3d (Frame from, Frame to, Eyes eye)
+VideoDecoder::fill_both_eyes (Frame from, Frame to, Eyes eye)
{
if (to == 0 && eye == EYES_LEFT) {
/* Already OK */
}
_video_content->film()->log()->log (String::compose ("VD receives %1", frame), Log::TYPE_DEBUG_DECODE);
+ cout << "receive " << frame << " for " << _video_content->path(0) << "\n";
/* We may receive the same frame index twice for 3D, and we need to know
when that happens.
}
if (from) {
- if (_video_content->video_frame_type() == VIDEO_FRAME_TYPE_2D) {
- fill_2d (from.get(), to.get ());
- } else {
- fill_3d (from.get(), to.get(), to_push.front().eyes);
+ switch (_video_content->video_frame_type ()) {
+ case VIDEO_FRAME_TYPE_2D:
+ fill_one_eye (from.get(), to.get (), EYES_BOTH);
+ break;
+ case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT:
+ case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM:
+ case VIDEO_FRAME_TYPE_3D_ALTERNATE:
+ fill_both_eyes (from.get(), to.get(), to_push.front().eyes);
+ break;
+ case VIDEO_FRAME_TYPE_3D_LEFT:
+ fill_one_eye (from.get(), to.get (), EYES_LEFT);
+ break;
+ case VIDEO_FRAME_TYPE_3D_RIGHT:
+ fill_one_eye (from.get(), to.get (), EYES_RIGHT);
}
}
void seek (ContentTime time, bool accurate);
void video (boost::shared_ptr<const ImageProxy>, Frame frame);
std::list<ContentVideo> decoded_video (Frame frame);
- void fill_2d (Frame from, Frame to);
- void fill_3d (Frame from, Frame to, Eyes);
+ void fill_one_eye (Frame from, Frame to, Eyes);
+ void fill_both_eyes (Frame from, Frame to, Eyes);
boost::shared_ptr<const VideoContent> _video_content;
std::list<ContentVideo> _decoded_video;
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
ImageDecoder decoder (c);
- decoder.fill_2d (0, 4);
+ decoder.fill_one_eye (0, 4, EYES_BOTH);
BOOST_CHECK_EQUAL (decoder._decoded_video.size(), 4U);
list<ContentVideo>::iterator i = decoder._decoded_video.begin();
for (int j = 0; j < 4; ++j) {
decoder._decoded_video.clear ();
- decoder.fill_2d (0, 7);
+ decoder.fill_one_eye (0, 7, EYES_BOTH);
BOOST_CHECK_EQUAL (decoder._decoded_video.size(), 7);
i = decoder._decoded_video.begin();
for (int j = 0; j < 7; ++j) {
shared_ptr<ImageContent> c (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
ImageDecoder decoder (c);
- decoder.fill_3d (0, 4, EYES_LEFT);
+ decoder.fill_both_eyes (0, 4, EYES_LEFT);
BOOST_CHECK_EQUAL (decoder._decoded_video.size(), 8);
list<ContentVideo>::iterator i = decoder._decoded_video.begin();
for (int j = 0; j < 8; ++j) {
++i;
}
- decoder.fill_3d (0, 7, EYES_RIGHT);
+ decoder.fill_both_eyes (0, 7, EYES_RIGHT);
BOOST_CHECK_EQUAL (decoder._decoded_video.size(), 15);
i = decoder._decoded_video.begin();
for (int j = 0; j < 15; ++j) {