#ifndef DCPOMATIC_CONTENT_VIDEO_H
#define DCPOMATIC_CONTENT_VIDEO_H
-#include "video_frame.h"
-
class ImageProxy;
/** @class ContentVideo
: part (PART_WHOLE)
{}
- ContentVideo (boost::shared_ptr<const ImageProxy> i, VideoFrame f, Part p)
+ ContentVideo (boost::shared_ptr<const ImageProxy> i, Frame f, Eyes e, Part p)
: image (i)
, frame (f)
+ , eyes (e)
, part (p)
{}
boost::shared_ptr<const ImageProxy> image;
- VideoFrame frame;
+ Frame frame;
+ Eyes eyes;
Part part;
};
}
/* Time and period of the frame we will emit */
- DCPTime const time = content_video_to_dcp (piece, video.frame.index());
+ DCPTime const time = content_video_to_dcp (piece, video.frame);
DCPTimePeriod const period (time, time + DCPTime::from_frames (1, _film->video_frame_rate()));
/* Discard if it's outside the content's period */
new PlayerVideo (
video.image,
piece->content->video->crop (),
- piece->content->video->fade (video.frame.index()),
+ piece->content->video->fade (video.frame),
piece->content->video->scale().size (
piece->content->video, _video_container_size, _film->frame_size ()
),
_video_container_size,
- video.frame.eyes(),
+ video.eyes,
video.part,
piece->content->video->colour_conversion ()
)
/* Work out what we are going to emit next */
switch (_content->video->frame_type ()) {
case VIDEO_FRAME_TYPE_2D:
- Data (ContentVideo (image, VideoFrame (frame, EYES_BOTH), PART_WHOLE));
+ Data (ContentVideo (image, frame, EYES_BOTH, PART_WHOLE));
break;
case VIDEO_FRAME_TYPE_3D:
{
frame this one is.
*/
bool const same = (_last_emitted && _last_emitted.get() == frame);
- Data (ContentVideo (image, VideoFrame (frame, same ? EYES_RIGHT : EYES_LEFT), PART_WHOLE));
+ Data (ContentVideo (image, frame, same ? EYES_RIGHT : EYES_LEFT, PART_WHOLE));
_last_emitted = frame;
break;
}
case VIDEO_FRAME_TYPE_3D_ALTERNATE:
- Data (ContentVideo (image, VideoFrame (frame / 2, (frame % 2) ? EYES_RIGHT : EYES_LEFT), PART_WHOLE));
+ Data (ContentVideo (image, frame / 2, (frame % 2) ? EYES_RIGHT : EYES_LEFT, PART_WHOLE));
break;
case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT:
- Data (ContentVideo (image, VideoFrame (frame, EYES_LEFT), PART_LEFT_HALF));
- Data (ContentVideo (image, VideoFrame (frame, EYES_RIGHT), PART_RIGHT_HALF));
+ Data (ContentVideo (image, frame, EYES_LEFT, PART_LEFT_HALF));
+ Data (ContentVideo (image, frame, EYES_RIGHT, PART_RIGHT_HALF));
break;
case VIDEO_FRAME_TYPE_3D_TOP_BOTTOM:
- Data (ContentVideo (image, VideoFrame (frame, EYES_LEFT), PART_TOP_HALF));
- Data (ContentVideo (image, VideoFrame (frame, EYES_RIGHT), PART_BOTTOM_HALF));
+ Data (ContentVideo (image, frame, EYES_LEFT, PART_TOP_HALF));
+ Data (ContentVideo (image, frame, EYES_RIGHT, PART_BOTTOM_HALF));
break;
case VIDEO_FRAME_TYPE_3D_LEFT:
- Data (ContentVideo (image, VideoFrame (frame, EYES_LEFT), PART_WHOLE));
+ Data (ContentVideo (image, frame, EYES_LEFT, PART_WHOLE));
break;
case VIDEO_FRAME_TYPE_3D_RIGHT:
- Data (ContentVideo (image, VideoFrame (frame, EYES_RIGHT), PART_WHOLE));
+ Data (ContentVideo (image, frame, EYES_RIGHT, PART_WHOLE));
break;
default:
DCPOMATIC_ASSERT (false);
+++ /dev/null
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "video_frame.h"
-#include "dcpomatic_assert.h"
-
-VideoFrame &
-VideoFrame::operator++ ()
-{
- if (_eyes == EYES_BOTH) {
- ++_index;
- } else if (_eyes == EYES_LEFT) {
- _eyes = EYES_RIGHT;
- } else {
- _eyes = EYES_LEFT;
- ++_index;
- }
-
- return *this;
-}
-
-bool
-operator== (VideoFrame const & a, VideoFrame const & b)
-{
- return a.index() == b.index() && a.eyes() == b.eyes();
-}
-
-bool
-operator!= (VideoFrame const & a, VideoFrame const & b)
-{
- return !(a == b);
-}
-
-bool
-operator> (VideoFrame const & a, VideoFrame const & b)
-{
- if (a.index() != b.index()) {
- return a.index() > b.index();
- }
-
- /* indexes are the same */
-
- if (a.eyes() == b.eyes()) {
- return false;
- }
-
- /* eyes are not the same */
-
- if (a.eyes() == EYES_LEFT && b.eyes() == EYES_RIGHT) {
- return false;
- }
-
- if (a.eyes() == EYES_RIGHT && b.eyes() == EYES_LEFT) {
- return true;
- }
-
- /* should never get here; we are comparing 2D with 3D */
-
- DCPOMATIC_ASSERT (false);
-}
+++ /dev/null
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#ifndef DCPOMATIC_VIDEO_FRAME_H
-#define DCPOMATIC_VIDEO_FRAME_H
-
-#include "types.h"
-
-class VideoFrame
-{
-public:
- VideoFrame ()
- : _index (0)
- , _eyes (EYES_BOTH)
- {}
-
- explicit VideoFrame (Frame i)
- : _index (i)
- , _eyes (EYES_BOTH)
- {}
-
- VideoFrame (Frame i, Eyes e)
- : _index (i)
- , _eyes (e)
- {}
-
- Frame index () const {
- return _index;
- }
-
- Eyes eyes () const {
- return _eyes;
- }
-
- VideoFrame& operator++ ();
-
-private:
- Frame _index;
- Eyes _eyes;
-};
-
-extern bool operator== (VideoFrame const & a, VideoFrame const & b);
-extern bool operator!= (VideoFrame const & a, VideoFrame const & b);
-extern bool operator> (VideoFrame const & a, VideoFrame const & b);
-
-#endif
video_content_scale.cc
video_decoder.cc
video_filter_graph.cc
- video_frame.cc
video_mxf_content.cc
video_mxf_decoder.cc
video_mxf_examiner.cc
+++ /dev/null
-/*
- Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
-
- This file is part of DCP-o-matic.
-
- DCP-o-matic is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- DCP-o-matic is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
-
-*/
-
-#include "lib/video_frame.h"
-#include "lib/exceptions.h"
-#include <boost/test/unit_test.hpp>
-
-/** Test VideoFrame */
-BOOST_AUTO_TEST_CASE (video_frame_test)
-{
- BOOST_CHECK_EQUAL (VideoFrame (0, EYES_BOTH) > VideoFrame (0, EYES_BOTH), false);
- BOOST_CHECK_EQUAL (VideoFrame (1, EYES_BOTH) > VideoFrame (0, EYES_BOTH), true);
- BOOST_CHECK_EQUAL (VideoFrame (0, EYES_BOTH) > VideoFrame (1, EYES_BOTH), false);
-
- BOOST_CHECK_EQUAL (VideoFrame (0, EYES_LEFT) > VideoFrame (0, EYES_LEFT), false);
- BOOST_CHECK_EQUAL (VideoFrame (0, EYES_LEFT) > VideoFrame (0, EYES_RIGHT), false);
- BOOST_CHECK_EQUAL (VideoFrame (0, EYES_RIGHT) > VideoFrame (0, EYES_LEFT), true);
- BOOST_CHECK_EQUAL (VideoFrame (0, EYES_RIGHT) > VideoFrame (1, EYES_LEFT), false);
- BOOST_CHECK_EQUAL (VideoFrame (1, EYES_LEFT) > VideoFrame (0, EYES_RIGHT), true);
-
- BOOST_CHECK_THROW (VideoFrame (0, EYES_LEFT) > VideoFrame (0, EYES_BOTH), ProgrammingError);
- BOOST_CHECK_THROW (VideoFrame (0, EYES_BOTH) > VideoFrame (0, EYES_RIGHT), ProgrammingError);
-}
util_test.cc
vf_test.cc
video_content_scale_test.cc
- video_frame_test.cc
video_mxf_content_test.cc
vf_kdm_test.cc
"""