using boost::shared_ptr;
using boost::dynamic_pointer_cast;
-DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log)
+DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c)
: VideoDecoder (c)
, AudioDecoder (c)
, SubtitleDecoder (c)
- , _log (log)
, _dcp_content (c)
{
dcp::DCP dcp (c->directory ());
shared_ptr<dcp::StereoPictureMXF> stereo = dynamic_pointer_cast<dcp::StereoPictureMXF> (mxf);
int64_t const entry_point = (*_reel)->main_picture()->entry_point ();
if (mono) {
- video (shared_ptr<ImageProxy> (new J2KImageProxy (mono->get_frame (entry_point + frame), mxf->size(), _log)), frame);
+ video (shared_ptr<ImageProxy> (new J2KImageProxy (mono->get_frame (entry_point + frame), mxf->size())), frame);
} else {
video (
- shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_LEFT, _log)),
+ shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_LEFT)),
frame
);
video (
- shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_RIGHT, _log)),
+ shared_ptr<ImageProxy> (new J2KImageProxy (stereo->get_frame (entry_point + frame), mxf->size(), dcp::EYE_RIGHT)),
frame
);
}
class DCPDecoder : public VideoDecoder, public AudioDecoder, public SubtitleDecoder
{
public:
- DCPDecoder (boost::shared_ptr<const DCPContent>, boost::shared_ptr<Log>);
+ DCPDecoder (boost::shared_ptr<const DCPContent>);
private:
void seek (ContentTime t, bool accurate);
ContentTime _next;
std::list<boost::shared_ptr<dcp::Reel> > _reels;
std::list<boost::shared_ptr<dcp::Reel> >::iterator _reel;
- boost::shared_ptr<Log> _log;
boost::shared_ptr<const DCPContent> _dcp_content;
};
if (i->second != AV_NOPTS_VALUE) {
double const pts = i->second * av_q2d (_format_context->streams[_video_stream]->time_base) + _pts_offset.seconds ();
video (
- shared_ptr<ImageProxy> (new RawImageProxy (image, _video_content->film()->log())),
+ shared_ptr<ImageProxy> (new RawImageProxy (image)),
rint (pts * _ffmpeg_content->video_frame_rate ())
);
} else {
if (!_image_content->still() || !_image) {
/* Either we need an image or we are using moving images, so load one */
- _image.reset (new MagickImageProxy (_image_content->path (_image_content->still() ? 0 : _video_position), _image_content->film()->log ()));
+ _image.reset (new MagickImageProxy (_image_content->path (_image_content->still() ? 0 : _video_position)));
}
video (_image, _video_position);
#include "image.h"
#include "exceptions.h"
#include "cross.h"
-#include "log.h"
#include "i18n.h"
-#define LOG_TIMING(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING);
-
using std::cout;
using std::string;
using boost::shared_ptr;
-ImageProxy::ImageProxy (shared_ptr<Log> log)
- : _log (log)
-{
-
-}
-
shared_ptr<ImageProxy>
-image_proxy_factory (shared_ptr<cxml::Node> xml, shared_ptr<Socket> socket, shared_ptr<Log> log)
+image_proxy_factory (shared_ptr<cxml::Node> xml, shared_ptr<Socket> socket)
{
if (xml->string_child("Type") == N_("Raw")) {
- return shared_ptr<ImageProxy> (new RawImageProxy (xml, socket, log));
+ return shared_ptr<ImageProxy> (new RawImageProxy (xml, socket));
} else if (xml->string_child("Type") == N_("Magick")) {
- return shared_ptr<MagickImageProxy> (new MagickImageProxy (xml, socket, log));
+ return shared_ptr<MagickImageProxy> (new MagickImageProxy (xml, socket));
} else if (xml->string_child("Type") == N_("J2K")) {
- return shared_ptr<J2KImageProxy> (new J2KImageProxy (xml, socket, log));
+ return shared_ptr<J2KImageProxy> (new J2KImageProxy (xml, socket));
}
throw NetworkError (_("Unexpected image type received by server"));
class Image;
class Socket;
-class Log;
namespace cxml {
class Node;
class ImageProxy : public boost::noncopyable
{
public:
- ImageProxy (boost::shared_ptr<Log> log);
virtual ~ImageProxy () {}
/** @return Image (which must be aligned) */
virtual bool same (boost::shared_ptr<const ImageProxy>) const {
return false;
}
-
-protected:
- boost::shared_ptr<Log> _log;
};
-boost::shared_ptr<ImageProxy> image_proxy_factory (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket, boost::shared_ptr<Log> log);
+boost::shared_ptr<ImageProxy> image_proxy_factory (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
#endif
using std::string;
using boost::shared_ptr;
-J2KImageProxy::J2KImageProxy (shared_ptr<const dcp::MonoPictureFrame> frame, dcp::Size size, shared_ptr<Log> log)
- : ImageProxy (log)
- , _mono (frame)
+J2KImageProxy::J2KImageProxy (shared_ptr<const dcp::MonoPictureFrame> frame, dcp::Size size)
+ : _mono (frame)
, _size (size)
{
}
-J2KImageProxy::J2KImageProxy (shared_ptr<const dcp::StereoPictureFrame> frame, dcp::Size size, dcp::Eye eye, shared_ptr<Log> log)
- : ImageProxy (log)
- , _stereo (frame)
+J2KImageProxy::J2KImageProxy (shared_ptr<const dcp::StereoPictureFrame> frame, dcp::Size size, dcp::Eye eye)
+ : _stereo (frame)
, _size (size)
, _eye (eye)
{
}
-J2KImageProxy::J2KImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> socket, shared_ptr<Log> log)
- : ImageProxy (log)
+J2KImageProxy::J2KImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> socket)
{
_size = dcp::Size (xml->number_child<int> ("Width"), xml->number_child<int> ("Height"));
if (xml->optional_number_child<int> ("Eye")) {
class J2KImageProxy : public ImageProxy
{
public:
- J2KImageProxy (boost::shared_ptr<const dcp::MonoPictureFrame> frame, dcp::Size, boost::shared_ptr<Log> log);
- J2KImageProxy (boost::shared_ptr<const dcp::StereoPictureFrame> frame, dcp::Size, dcp::Eye, boost::shared_ptr<Log> log);
- J2KImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket, boost::shared_ptr<Log> log);
+ J2KImageProxy (boost::shared_ptr<const dcp::MonoPictureFrame> frame, dcp::Size);
+ J2KImageProxy (boost::shared_ptr<const dcp::StereoPictureFrame> frame, dcp::Size, dcp::Eye);
+ J2KImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
boost::shared_ptr<Image> image () const;
void add_metadata (xmlpp::Node *) const;
#include "cross.h"
#include "exceptions.h"
#include "util.h"
-#include "log.h"
#include "image.h"
-#include "log.h"
#include "i18n.h"
-#define LOG_TIMING(...) _log->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING);
-
using std::string;
using std::cout;
using boost::shared_ptr;
using boost::dynamic_pointer_cast;
-MagickImageProxy::MagickImageProxy (boost::filesystem::path path, shared_ptr<Log> log)
- : ImageProxy (log)
+MagickImageProxy::MagickImageProxy (boost::filesystem::path path)
{
/* Read the file into a Blob */
delete[] data;
}
-MagickImageProxy::MagickImageProxy (shared_ptr<cxml::Node>, shared_ptr<Socket> socket, shared_ptr<Log> log)
- : ImageProxy (log)
+MagickImageProxy::MagickImageProxy (shared_ptr<cxml::Node>, shared_ptr<Socket> socket)
{
uint32_t const size = socket->read_uint32 ();
uint8_t* data = new uint8_t[size];
return _image;
}
- LOG_TIMING ("[%1] MagickImageProxy begins decode and convert of %2 bytes", boost::this_thread::get_id(), _blob.length());
-
Magick::Image* magick_image = 0;
string error;
try {
}
dcp::Size size (magick_image->columns(), magick_image->rows());
- LOG_TIMING ("[%1] MagickImageProxy decode finished", boost::this_thread::get_id ());
_image.reset (new Image (PIX_FMT_RGB24, size, true));
delete magick_image;
- LOG_TIMING ("[%1] MagickImageProxy completes decode and convert of %2 bytes", boost::this_thread::get_id(), _blob.length());
-
return _image;
}
class MagickImageProxy : public ImageProxy
{
public:
- MagickImageProxy (boost::filesystem::path, boost::shared_ptr<Log> log);
- MagickImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket, boost::shared_ptr<Log> log);
+ MagickImageProxy (boost::filesystem::path);
+ MagickImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
boost::shared_ptr<Image> image () const;
void add_metadata (xmlpp::Node *) const;
shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (*i);
if (dc) {
- decoder.reset (new DCPDecoder (dc, _film->log ()));
+ decoder.reset (new DCPDecoder (dc));
frc = FrameRateChange (dc->video_frame_rate(), _film->video_frame_rate());
}
{
return shared_ptr<PlayerVideo> (
new PlayerVideo (
- shared_ptr<const ImageProxy> (new RawImageProxy (_black_image, _film->log ())),
+ shared_ptr<const ImageProxy> (new RawImageProxy (_black_image)),
time,
Crop (),
optional<float> (),
}
-PlayerVideo::PlayerVideo (shared_ptr<cxml::Node> node, shared_ptr<Socket> socket, shared_ptr<Log> log)
+PlayerVideo::PlayerVideo (shared_ptr<cxml::Node> node, shared_ptr<Socket> socket)
{
_time = DCPTime (node->number_child<DCPTime::Type> ("Time"));
_crop = Crop (node);
_part = (Part) node->number_child<int> ("Part");
_colour_conversion = ColourConversion::from_xml (node);
- _in = image_proxy_factory (node->node_child ("In"), socket, log);
+ _in = image_proxy_factory (node->node_child ("In"), socket);
if (node->optional_number_child<int> ("SubtitleX")) {
class ImageProxy;
class Scaler;
class Socket;
-class Log;
class EncodedData;
/** Everything needed to describe a video frame coming out of the player, but with the
boost::optional<ColourConversion>
);
- PlayerVideo (boost::shared_ptr<cxml::Node>, boost::shared_ptr<Socket>, boost::shared_ptr<Log>);
+ PlayerVideo (boost::shared_ptr<cxml::Node>, boost::shared_ptr<Socket>);
void set_subtitle (PositionImage);
using std::string;
using boost::shared_ptr;
-RawImageProxy::RawImageProxy (shared_ptr<Image> image, shared_ptr<Log> log)
- : ImageProxy (log)
- , _image (image)
+RawImageProxy::RawImageProxy (shared_ptr<Image> image)
+ : _image (image)
{
}
-RawImageProxy::RawImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> socket, shared_ptr<Log> log)
- : ImageProxy (log)
+RawImageProxy::RawImageProxy (shared_ptr<cxml::Node> xml, shared_ptr<Socket> socket)
{
dcp::Size size (
xml->number_child<int> ("Width"), xml->number_child<int> ("Height")
class RawImageProxy : public ImageProxy
{
public:
- RawImageProxy (boost::shared_ptr<Image>, boost::shared_ptr<Log> log);
- RawImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket, boost::shared_ptr<Log> log);
+ RawImageProxy (boost::shared_ptr<Image>);
+ RawImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
boost::shared_ptr<Image> image () const;
void add_metadata (xmlpp::Node *) const;
return -1;
}
- shared_ptr<PlayerVideo> pvf (new PlayerVideo (xml, socket, _log));
+ shared_ptr<PlayerVideo> pvf (new PlayerVideo (xml, socket));
DCPVideo dcp_video_frame (pvf, xml, _log);
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image, log)),
+ shared_ptr<ImageProxy> (new RawImageProxy (image)),
DCPTime (),
Crop (),
optional<float> (),
shared_ptr<PlayerVideo> pvf (
new PlayerVideo (
- shared_ptr<ImageProxy> (new RawImageProxy (image, log)),
+ shared_ptr<ImageProxy> (new RawImageProxy (image)),
DCPTime (),
Crop (),
optional<float> (),