place timecode conversion functions into a Timecode class rather than an olive namespace
Code cleanup and improvement.
This commit is contained in:
@@ -162,19 +162,19 @@ QString Footage::duration()
|
||||
|
||||
if (video_stream->timebase() != frame_rate_timebase) {
|
||||
// Convert from timebase to frame rate
|
||||
rational duration_time = olive::timestamp_to_time(duration, video_stream->timebase());
|
||||
duration = olive::time_to_timestamp(duration_time, frame_rate_timebase);
|
||||
rational duration_time = Timecode::timestamp_to_time(duration, video_stream->timebase());
|
||||
duration = Timecode::time_to_timestamp(duration_time, frame_rate_timebase);
|
||||
}
|
||||
|
||||
return olive::timestamp_to_timecode(duration,
|
||||
frame_rate_timebase,
|
||||
olive::CurrentTimecodeDisplay());
|
||||
return Timecode::timestamp_to_timecode(duration,
|
||||
frame_rate_timebase,
|
||||
Timecode::CurrentDisplay());
|
||||
} else if (streams_.first()->type() == Stream::kAudio) {
|
||||
AudioStreamPtr audio_stream = std::static_pointer_cast<AudioStream>(streams_.first());
|
||||
|
||||
return olive::timestamp_to_timecode(streams_.first()->duration(),
|
||||
streams_.first()->timebase(),
|
||||
olive::CurrentTimecodeDisplay());
|
||||
return Timecode::timestamp_to_timecode(streams_.first()->duration(),
|
||||
streams_.first()->timebase(),
|
||||
Timecode::CurrentDisplay());
|
||||
}
|
||||
|
||||
return QString();
|
||||
|
||||
@@ -95,9 +95,9 @@ QString Sequence::duration()
|
||||
|
||||
rational timeline_length = timeline_output_->length();
|
||||
|
||||
int64_t timestamp = olive::time_to_timestamp(timeline_length, video_params_.time_base());
|
||||
int64_t timestamp = Timecode::time_to_timestamp(timeline_length, video_params_.time_base());
|
||||
|
||||
return olive::timestamp_to_timecode(timestamp, video_params_.time_base(), olive::CurrentTimecodeDisplay());
|
||||
return Timecode::timestamp_to_timecode(timestamp, video_params_.time_base(), Timecode::CurrentDisplay());
|
||||
}
|
||||
|
||||
QString Sequence::rate()
|
||||
|
||||
Reference in New Issue
Block a user