bool const b = _db->pass ();
if (_job) {
- _job->set_progress (float (_last_frame) / _da->decoding_frames ());
+ _job->set_progress (float (_last_frame) / _fs_a->dcp_length());
}
if (a && b) {
*/
int64_t const audio_short_by_frames =
- ((int64_t) decoding_frames() * _fs->target_sample_rate() / _fs->frames_per_second)
+ ((int64_t) _fs->dcp_length() * _fs->target_sample_rate() / _fs->frames_per_second)
- _audio_frames_processed;
if (audio_short_by_frames >= 0) {
while (pass () == false) {
if (_job && !_ignore_length) {
- _job->set_progress (float (_video_frame) / decoding_frames ());
+ _job->set_progress (float (_video_frame) / _fs->dcp_length());
}
}
process_end ();
}
-/** @return Number of frames that we will be decoding */
-int
-Decoder::decoding_frames () const
-{
- if (_opt->num_frames > 0) {
- return _opt->num_frames;
- }
-
- return _fs->length;
-}
-
/** Run one pass. This may or may not generate any actual video / audio data;
* some decoders may require several passes to generate a single frame.
* @return true if we have finished processing all data; otherwise false.
_have_setup_video_filters = true;
}
- if (_opt->num_frames != 0 && _video_frame >= _opt->num_frames) {
+ if (_video_frame >= _fs->dcp_length()) {
return true;
}
return _video_frame;
}
- int decoding_frames () const;
-
/** Emitted when a video frame is ready.
* First parameter is the frame.
* Second parameter is its index within the content.
o->out_size = format()->dcp_size ();
if (dcp_frames() == 0) {
/* Decode the whole film, no blacking */
- o->num_frames = 0;
o->black_after = 0;
} else {
switch (dcp_trim_action()) {
case CUT:
/* Decode only part of the film, no blacking */
- o->num_frames = dcp_frames ();
o->black_after = 0;
break;
case BLACK_OUT:
/* Decode the whole film, but black some frames out */
- o->num_frames = 0;
o->black_after = dcp_frames ();
}
}
Options (std::string f, std::string e, std::string m)
: padding (0)
, apply_crop (true)
- , num_frames (0)
, decode_video (true)
, decode_video_frequency (0)
, decode_audio (true)
float ratio; ///< ratio of the wanted output image (not considering padding)
int padding; ///< number of pixels of padding (in terms of the output size) each side of the image
bool apply_crop; ///< true to apply cropping
- int num_frames; ///< number of video frames to run for, or 0 for all
int black_after; ///< first frame for which to output a black frame, rather than the actual video content, or 0 for none
bool decode_video; ///< true to decode video, otherwise false
int decode_video_frequency; ///< skip frames so that this many are decoded in all (or 0) (for generating thumbnails)