summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-05-04 13:34:50 +0200
committerCarl Hetherington <cth@carlh.net>2021-05-07 09:29:59 +0200
commitf68b82c43c5ce988a11d16f537c1e0ab178089b5 (patch)
treee3f5f88708a8e898056a1a60ee66bca310fb215c
parent41885408b723c29ab3ae48cae5999a9934240bf2 (diff)
Rename ContentAtmos -> PieceAtmos and pass atmos through Piece.
-rw-r--r--src/lib/atmos_decoder.cc2
-rw-r--r--src/lib/atmos_decoder.h4
-rw-r--r--src/lib/piece.cc13
-rw-r--r--src/lib/piece.h3
-rw-r--r--src/lib/piece_atmos.h (renamed from src/lib/content_atmos.h)16
-rw-r--r--src/lib/player.cc13
-rw-r--r--src/lib/player.h7
7 files changed, 38 insertions, 20 deletions
diff --git a/src/lib/atmos_decoder.cc b/src/lib/atmos_decoder.cc
index 478c45809..1b3e3503a 100644
--- a/src/lib/atmos_decoder.cc
+++ b/src/lib/atmos_decoder.cc
@@ -48,7 +48,7 @@ AtmosDecoder::seek ()
void
AtmosDecoder::emit (shared_ptr<const Film> film, shared_ptr<const dcp::AtmosFrame> data, Frame frame, AtmosMetadata metadata)
{
- Data (ContentAtmos(data, frame, metadata));
+ Data (data, frame, metadata);
/* There's no fiddling with frame rates when we are using Atmos; the DCP rate must be the same as the Atmos one */
_position = dcpomatic::ContentTime::from_frames (frame, film->video_frame_rate());
}
diff --git a/src/lib/atmos_decoder.h b/src/lib/atmos_decoder.h
index 1ec1b8a6c..6e1d18680 100644
--- a/src/lib/atmos_decoder.h
+++ b/src/lib/atmos_decoder.h
@@ -20,8 +20,8 @@
#include "atmos_metadata.h"
-#include "content_atmos.h"
#include "decoder_part.h"
+#include "piece_atmos.h"
#include <boost/signals2.hpp>
@@ -38,7 +38,7 @@ public:
void emit (std::shared_ptr<const Film> film, std::shared_ptr<const dcp::AtmosFrame> data, Frame frame, AtmosMetadata metadata);
- boost::signals2::signal<void (ContentAtmos)> Data;
+ boost::signals2::signal<void (std::shared_ptr<const dcp::AtmosFrame>, Frame, AtmosMetadata)> Data;
private:
std::shared_ptr<const Content> _content;
diff --git a/src/lib/piece.cc b/src/lib/piece.cc
index 69469c02e..452b34222 100644
--- a/src/lib/piece.cc
+++ b/src/lib/piece.cc
@@ -19,6 +19,8 @@
*/
+#include "atmos_decoder.h"
+#include "atmos_metadata.h"
#include "audio_content.h"
#include "audio_decoder.h"
#include "content.h"
@@ -74,6 +76,10 @@ Piece::Piece (weak_ptr<const Film> film, shared_ptr<Content> content, shared_ptr
i->Stop.connect (boost::bind(&Piece::stop, this, content, i->content(), _1));
}
+ if (_decoder->atmos) {
+ _decoder->atmos->Data.connect (boost::bind(&Piece::atmos, this, _1, _2, _3));
+ }
+
_decoder->Flush.connect (boost::bind(&Piece::flush, this));
}
@@ -153,6 +159,13 @@ Piece::stop (weak_ptr<const Content> content, weak_ptr<const TextContent> text,
void
+Piece::atmos (shared_ptr<const dcp::AtmosFrame> data, Frame frame, AtmosMetadata metadata)
+{
+ Atmos (PieceAtmos(data, frame, metadata));
+}
+
+
+void
Piece::update_pull_to (DCPTime& pull_to) const
{
if (_done) {
diff --git a/src/lib/piece.h b/src/lib/piece.h
index 2e4eded89..2586bb1d0 100644
--- a/src/lib/piece.h
+++ b/src/lib/piece.h
@@ -27,6 +27,7 @@
#include "dcpomatic_time.h"
#include "font_data.h"
#include "frame_rate_change.h"
+#include "piece_atmos.h"
#include "piece_audio.h"
#include "piece_text.h"
#include "piece_video.h"
@@ -92,6 +93,7 @@ public:
boost::signals2::signal<void (PieceBitmapTextStart)> BitmapTextStart;
boost::signals2::signal<void (PieceStringTextStart)> StringTextStart;
boost::signals2::signal<void (PieceTextStop)> TextStop;
+ boost::signals2::signal<void (PieceAtmos)> Atmos;
private:
friend struct overlap_video_test1;
@@ -102,6 +104,7 @@ private:
void bitmap_start (std::weak_ptr<const Content> content, std::weak_ptr<const TextContent> text, dcpomatic::ContentTime time, std::shared_ptr<Image> image, dcpomatic::Rect<double> area);
void string_start (std::weak_ptr<const Content> content, std::weak_ptr<const TextContent> text, dcpomatic::ContentTime time, std::list<dcp::SubtitleString> subs);
void stop (std::weak_ptr<const Content> content, std::weak_ptr<const TextContent> text, dcpomatic::ContentTime time);
+ void atmos (std::shared_ptr<const dcp::AtmosFrame> data, Frame frame, AtmosMetadata metadata);
void flush ();
diff --git a/src/lib/content_atmos.h b/src/lib/piece_atmos.h
index 891ca3b83..1fa927243 100644
--- a/src/lib/content_atmos.h
+++ b/src/lib/piece_atmos.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -18,20 +18,23 @@
*/
-#ifndef DCPOMATIC_CONTENT_ATMOS_H
-#define DCPOMATIC_CONTENT_ATMOS_H
+
+#ifndef DCPOMATIC_PIECE_ATMOS_H
+#define DCPOMATIC_PIECE_ATMOS_H
+
#include "atmos_metadata.h"
#include "types.h"
#include <dcp/atmos_asset_reader.h>
-/** @class ContentAtmos
+
+/** @class PieceAtmos
* @brief Some Atmos data that has come out of a decoder.
*/
-class ContentAtmos
+class PieceAtmos
{
public:
- ContentAtmos (std::shared_ptr<const dcp::AtmosFrame> data_, Frame frame_, AtmosMetadata metadata_)
+ PieceAtmos (std::shared_ptr<const dcp::AtmosFrame> data_, Frame frame_, AtmosMetadata metadata_)
: data (data_)
, frame (frame_)
, metadata (metadata_)
@@ -42,4 +45,5 @@ public:
AtmosMetadata metadata;
};
+
#endif
diff --git a/src/lib/player.cc b/src/lib/player.cc
index ad23ea47d..590fddb7c 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -293,13 +293,10 @@ Player::setup_pieces_unlocked ()
piece->Audio.connect (bind(&Player::audio, this, weak_ptr<Piece>(piece), _1));
}
- piece->BitmapTextStart.connect (bind(&Player::bitmap_text_start, this, weak_ptr<Piece>(piece), _1));
- piece->StringTextStart.connect (bind(&Player::string_text_start, this, weak_ptr<Piece>(piece), _1));
- piece->TextStop.connect (bind(&Player::subtitle_stop, this, weak_ptr<Piece>(piece), _1));
-
- if (decoder->atmos) {
- decoder->atmos->Data.connect (bind(&Player::atmos, this, weak_ptr<Piece>(piece), _1));
- }
+ piece->BitmapTextStart.connect (bind(&Player::bitmap_text_start, this, piece, _1));
+ piece->StringTextStart.connect (bind(&Player::string_text_start, this, piece, _1));
+ piece->TextStop.connect (bind(&Player::subtitle_stop, this, piece, _1));
+ piece->Atmos.connect (bind(&Player::atmos, this, piece, _1));
}
for (auto i = _pieces.begin(); i != _pieces.end(); ++i) {
@@ -1279,7 +1276,7 @@ Player::playlist () const
void
-Player::atmos (weak_ptr<Piece>, ContentAtmos data)
+Player::atmos (weak_ptr<Piece>, PieceAtmos data)
{
Atmos (data.data, DCPTime::from_frames(data.frame, _film->video_frame_rate()), data.metadata);
}
diff --git a/src/lib/player.h b/src/lib/player.h
index d7e297985..eb38bc46f 100644
--- a/src/lib/player.h
+++ b/src/lib/player.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013-2020 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
@@ -28,10 +28,10 @@
#include "audio_merger.h"
#include "audio_stream.h"
#include "content.h"
-#include "content_atmos.h"
#include "empty.h"
#include "film.h"
#include "piece.h"
+#include "piece_atmos.h"
#include "piece_audio.h"
#include "piece_text.h"
#include "piece_video.h"
@@ -143,7 +143,7 @@ private:
void bitmap_text_start (std::weak_ptr<Piece>, PieceBitmapTextStart);
void string_text_start (std::weak_ptr<Piece>, PieceStringTextStart);
void subtitle_stop (std::weak_ptr<Piece>, PieceTextStop);
- void atmos (std::weak_ptr<Piece>, ContentAtmos);
+ void atmos (std::weak_ptr<Piece>, PieceAtmos);
dcpomatic::DCPTime one_video_frame () const;
void fill_audio (dcpomatic::DCPTimePeriod period);
@@ -220,4 +220,5 @@ private:
std::vector<std::vector<std::shared_ptr<Content>>> collect (std::shared_ptr<const Film> film, ContentList content);
+
#endif