using boost::weak_ptr;
using boost::dynamic_pointer_cast;
-int const Writer::_maximum_frames_in_memory = Config::instance()->num_local_encoding_threads() + 4;
-
Writer::Writer (shared_ptr<const Film> f, weak_ptr<Job> j)
: _film (f)
, _job (j)
{
boost::mutex::scoped_lock lock (_mutex);
- while (_queued_full_in_memory > _maximum_frames_in_memory) {
+ while (_queued_full_in_memory > maximum_frames_in_memory ()) {
/* The queue is too big; wait until that is sorted out */
_full_condition.wait (lock);
}
{
boost::mutex::scoped_lock lock (_mutex);
- while (_queued_full_in_memory > _maximum_frames_in_memory) {
+ while (_queued_full_in_memory > maximum_frames_in_memory ()) {
/* The queue is too big; wait until that is sorted out */
_full_condition.wait (lock);
}
while (true) {
- if (_finish || _queued_full_in_memory > _maximum_frames_in_memory || have_sequenced_image_at_queue_head ()) {
+ if (_finish || _queued_full_in_memory > maximum_frames_in_memory () || have_sequenced_image_at_queue_head ()) {
/* We've got something to do: go and do it */
break;
}
}
}
- while (_queued_full_in_memory > _maximum_frames_in_memory) {
+ while (_queued_full_in_memory > maximum_frames_in_memory ()) {
done_something = true;
/* Too many frames in memory which can't yet be written to the stream.
Write some FULL frames to disk.
{
return a.frame == b.frame && a.eyes == b.eyes;
}
+
+int
+Writer::maximum_frames_in_memory () const
+{
+ return Config::instance()->num_local_encoding_threads() + 4;
+}
void check_existing_picture_mxf ();
bool check_existing_picture_mxf_frame (FILE *, int, Eyes);
bool have_sequenced_image_at_queue_head ();
+ /** maximum number of frames to hold in memory, for when we are managing
+ * ordering
+ */
+ int maximum_frames_in_memory () const;
/** our Film */
boost::shared_ptr<const Film> _film;
/** the index of the last written frame */
int _last_written_frame;
Eyes _last_written_eyes;
- /** maximum number of frames to hold in memory, for when we are managing
- ordering
- */
- static const int _maximum_frames_in_memory;
/** number of FULL written frames */
int _full_written;