Move audio into Encoder so that J2KStillEncoder can use it too. Rename J2KWAVEncoder...
[dcpomatic.git] / src / lib / dcp_video_frame.cc
index 1dcc81f0de980a6954c7add6394e0f4f001be6d2..8b70b0aa4697286e82f3b0da3abad72b7f3e95c9 100644 (file)
@@ -76,7 +76,7 @@ using boost::shared_ptr;
 DCPVideoFrame::DCPVideoFrame (
        shared_ptr<const Image> yuv, shared_ptr<Subtitle> sub,
        Size out, int p, int subtitle_offset, float subtitle_scale,
-       Scaler const * s, int f, float fps, string pp, int clut, int bw, Log* l
+       Scaler const * s, SourceFrame f, float fps, string pp, int clut, int bw, Log* l
        )
        : _input (yuv)
        , _subtitle (sub)
@@ -154,10 +154,10 @@ shared_ptr<EncodedData>
 DCPVideoFrame::encode_locally ()
 {
        if (!_post_process.empty ()) {
-               _input = _input->post_process (_post_process);
+               _input = _input->post_process (_post_process, true);
        }
        
-       shared_ptr<Image> prepared = _input->scale_and_convert_to_rgb (_out_size, _padding, _scaler);
+       shared_ptr<Image> prepared = _input->scale_and_convert_to_rgb (_out_size, _padding, _scaler, true);
 
        if (_subtitle) {
                Rect tx = subtitle_transformed_area (
@@ -166,7 +166,7 @@ DCPVideoFrame::encode_locally ()
                        _subtitle->area(), _subtitle_offset, _subtitle_scale
                        );
 
-               shared_ptr<Image> im = _subtitle->image()->scale (tx.size(), _scaler);
+               shared_ptr<Image> im = _subtitle->image()->scale (tx.size(), _scaler, true);
                prepared->alpha_blend (im, tx.position());
        }
 
@@ -376,7 +376,7 @@ DCPVideoFrame::encode_remotely (ServerDescription const * serv)
  *  @param frame Frame index.
  */
 void
-EncodedData::write (shared_ptr<const Options> opt, int frame)
+EncodedData::write (shared_ptr<const EncodeOptions> opt, SourceFrame frame)
 {
        string const tmp_j2k = opt->frame_out_path (frame, true);
 
@@ -395,7 +395,7 @@ EncodedData::write (shared_ptr<const Options> opt, int frame)
        boost::filesystem::rename (tmp_j2k, real_j2k);
 
        /* Write a file containing the hash */
-       string const hash = real_j2k + ".md5";
+       string const hash = opt->hash_out_path (frame, false);
        ofstream h (hash.c_str());
        h << md5_digest (_data, _size) << "\n";
        h.close ();