diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-03-21 12:36:17 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-03-21 12:36:17 +0000 |
| commit | e6f28e7cda23c1ba3c49cc1bf2dc1491c2f87160 (patch) | |
| tree | ab7de2b131c3543d170b167c8b93ea2113ac112e /src/lib | |
| parent | 76f601f5edbdfceec91ff6f6ce4b310e0d3a6ce9 (diff) | |
| parent | 4ec7a8070dfcda1fa327df6378eaab754f119f1b (diff) | |
Mostly-merge master.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/ffmpeg.cc | 1 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 14 | ||||
| -rw-r--r-- | src/lib/ffmpeg_decoder.h | 1 | ||||
| -rw-r--r-- | src/lib/image.cc | 1 | ||||
| -rw-r--r-- | src/lib/image_content.cc | 2 | ||||
| -rw-r--r-- | src/lib/scaler.h | 2 | ||||
| -rw-r--r-- | src/lib/types.h | 3 | ||||
| -rw-r--r-- | src/lib/util.cc | 2 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 3 | ||||
| -rw-r--r-- | src/lib/video_content.h | 9 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 3 |
11 files changed, 24 insertions, 17 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 5fc333489..a98aa9828 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -21,7 +21,6 @@ extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h> -#include <libpostproc/postprocess.h> } #include "ffmpeg.h" #include "ffmpeg_content.h" diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 90c00283d..86ce7503c 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -237,7 +237,7 @@ FFmpegContent::information () const stringstream s; - s << String::compose (_("%1 frames; %2 frames per second"), video_length().frames (video_frame_rate()), video_frame_rate()) << "\n"; + s << String::compose (_("%1 frames; %2 frames per second"), video_length_after_3d_combine().frames (video_frame_rate()), video_frame_rate()) << "\n"; s << VideoContent::information (); return s.str (); @@ -268,14 +268,12 @@ FFmpegContent::set_audio_stream (shared_ptr<FFmpegAudioStream> s) ContentTime FFmpegContent::audio_length () const { - { - boost::mutex::scoped_lock lm (_mutex); - if (!_audio_stream) { - return ContentTime (); - } + boost::mutex::scoped_lock lm (_mutex); + if (!_audio_stream) { + return ContentTime (); } - return video_length(); + return video_length (); } int @@ -422,7 +420,7 @@ FFmpegContent::full_length () const { shared_ptr<const Film> film = _film.lock (); assert (film); - return DCPTime (video_length(), FrameRateChange (video_frame_rate (), film->video_frame_rate ())); + return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate (), film->video_frame_rate ())); } AudioMapping diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index fbf802bb0..15fe5d9a4 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -29,7 +29,6 @@ #include <boost/thread/mutex.hpp> extern "C" { #include <libavcodec/avcodec.h> -#include <libpostproc/postprocess.h> } #include "util.h" #include "decoder.h" diff --git a/src/lib/image.cc b/src/lib/image.cc index c3b1ca77a..926aefd36 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -26,7 +26,6 @@ extern "C" { #include <libswscale/swscale.h> #include <libavutil/pixfmt.h> #include <libavutil/pixdesc.h> -#include <libpostproc/postprocess.h> } #include "image.h" #include "exceptions.h" diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 6a37f3067..d7b37a835 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -125,7 +125,7 @@ ImageContent::full_length () const { shared_ptr<const Film> film = _film.lock (); assert (film); - return DCPTime (video_length(), FrameRateChange (video_frame_rate(), film->video_frame_rate())); + return DCPTime (video_length_after_3d_combine(), FrameRateChange (video_frame_rate(), film->video_frame_rate())); } string diff --git a/src/lib/scaler.h b/src/lib/scaler.h index 6a039edd8..14077ff1d 100644 --- a/src/lib/scaler.h +++ b/src/lib/scaler.h @@ -36,7 +36,7 @@ class Scaler : public boost::noncopyable public: Scaler (int f, std::string i, std::string n); - /** @return id used for calls to FFmpeg's pp_postprocess */ + /** @return id used for calls to FFmpeg's sws_getContext */ int ffmpeg_id () const { return _ffmpeg_id; } diff --git a/src/lib/types.h b/src/lib/types.h index dafea92f8..4e1f59ca8 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -64,7 +64,8 @@ enum VideoFrameType { VIDEO_FRAME_TYPE_2D, VIDEO_FRAME_TYPE_3D_LEFT_RIGHT, - VIDEO_FRAME_TYPE_3D_TOP_BOTTOM + VIDEO_FRAME_TYPE_3D_TOP_BOTTOM, + VIDEO_FRAME_TYPE_3D_ALTERNATE }; enum Eyes diff --git a/src/lib/util.cc b/src/lib/util.cc index 15109eee0..5b3bd76ba 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -58,7 +58,6 @@ extern "C" { #include <libavformat/avformat.h> #include <libswscale/swscale.h> #include <libavfilter/avfiltergraph.h> -#include <libpostproc/postprocess.h> #include <libavutil/pixfmt.h> } #include "util.h" @@ -249,7 +248,6 @@ dependency_version_summary () << N_("libavfilter ") << ffmpeg_version_to_string (avfilter_version()) << N_(", ") << N_("libavformat ") << ffmpeg_version_to_string (avformat_version()) << N_(", ") << N_("libavutil ") << ffmpeg_version_to_string (avutil_version()) << N_(", ") - << N_("libpostproc ") << ffmpeg_version_to_string (postproc_version()) << N_(", ") << N_("libswscale ") << ffmpeg_version_to_string (swscale_version()) << N_(", ") << MagickVersion << N_(", ") << N_("libssh ") << ssh_version (0) << N_(", ") diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index b6a2d0318..5864342a2 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -319,7 +319,7 @@ VideoContent::technical_summary () const { return String::compose ( "video: length %1, size %2x%3, rate %4", - video_length().seconds(), + video_length_after_3d_combine().seconds(), video_size().width, video_size().height, video_frame_rate() @@ -332,6 +332,7 @@ VideoContent::video_size_after_3d_split () const dcp::Size const s = video_size (); switch (video_frame_type ()) { case VIDEO_FRAME_TYPE_2D: + case VIDEO_FRAME_TYPE_3D_ALTERNATE: return s; case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: return dcp::Size (s.width / 2, s.height); diff --git a/src/lib/video_content.h b/src/lib/video_content.h index d2b19480f..eeb49cfa5 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -96,6 +96,15 @@ public: return _video_length; } + ContentTime video_length_after_3d_combine () const { + boost::mutex::scoped_lock lm (_mutex); + if (_video_frame_type == VIDEO_FRAME_TYPE_3D_ALTERNATE) { + return ContentTime (_video_length.get() / 2); + } + + return _video_length; + } + dcp::Size video_size () const { boost::mutex::scoped_lock lm (_mutex); return _video_size; diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 15f91b892..144a494dc 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -40,6 +40,9 @@ VideoDecoder::video (shared_ptr<const Image> image, bool same, ContentTime time) case VIDEO_FRAME_TYPE_2D: _pending.push_back (shared_ptr<DecodedVideo> (new DecodedVideo (time, image, EYES_BOTH, same))); break; + case VIDEO_FRAME_TYPE_3D_ALTERNATE: + Video (image, (frame % 2) ? EYES_RIGHT : EYES_LEFT, same); + break; case VIDEO_FRAME_TYPE_3D_LEFT_RIGHT: { int const half = image->size().width / 2; |
