style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
+61
-61
@@ -37,7 +37,7 @@ RenderTask::~RenderTask()
|
||||
{
|
||||
}
|
||||
|
||||
bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
bool RenderTask::render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
const TimeRangeList &audio_range,
|
||||
const TimeRange &subtitle_range, RenderMode::Mode mode,
|
||||
FrameHashCache *cache, const QSize &force_size,
|
||||
@@ -65,14 +65,14 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
//total_length += r.length().toDouble();
|
||||
|
||||
RenderManager::RenderAudioParams rap(
|
||||
viewer_->GetConnectedSampleOutput(), range, audio_params_,
|
||||
RenderMode::kOnline);
|
||||
viewer_->get_connected_sample_output(), range, audio_params_,
|
||||
RenderMode::k_online);
|
||||
|
||||
RenderTicketWatcher *watcher = new RenderTicketWatcher();
|
||||
watcher->setProperty("range", QVariant::fromValue(range));
|
||||
PrepareWatcher(watcher, &watcher_thread);
|
||||
IncrementRunningTickets();
|
||||
watcher->SetTicket(RenderManager::instance()->RenderAudio(rap));
|
||||
prepare_watcher(watcher, &watcher_thread);
|
||||
increment_running_tickets();
|
||||
watcher->set_ticket(RenderManager::instance()->render_audio(rap));
|
||||
}
|
||||
|
||||
// Look up hashes
|
||||
@@ -87,10 +87,10 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
// each of the system's threads are utilized as memory allows.
|
||||
const int maximum_rendered_frames = QThread::idealThreadCount();
|
||||
|
||||
rational next_frame;
|
||||
Rational next_frame;
|
||||
for (int i = 0;
|
||||
i < maximum_rendered_frames && iterator.GetNext(&next_frame); i++) {
|
||||
StartTicket(&watcher_thread, manager, next_frame, mode, cache,
|
||||
i < maximum_rendered_frames && iterator.get_next(&next_frame); i++) {
|
||||
start_ticket(&watcher_thread, manager, next_frame, mode, cache,
|
||||
force_size, force_matrix, force_format, force_channel_count,
|
||||
force_color_output, force_color_transform);
|
||||
}
|
||||
@@ -100,37 +100,37 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
// Subtitle loop, loops over all blocks in sequence on all tracks
|
||||
if (!subtitle_range.length().isNull()) {
|
||||
if (Sequence *sequence = dynamic_cast<Sequence *>(viewer_)) {
|
||||
TrackList *list = sequence->track_list(Track::kSubtitle);
|
||||
QVector<int> block_indexes(list->GetTrackCount(), 0);
|
||||
TrackList *list = sequence->track_list(Track::k_subtitle);
|
||||
QVector<int> block_indexes(list->get_track_count(), 0);
|
||||
|
||||
QVector<int> tracks_to_push;
|
||||
do {
|
||||
tracks_to_push.clear();
|
||||
|
||||
for (int i = 0; i < block_indexes.size(); i++) {
|
||||
Track *this_track = list->GetTrackAt(i);
|
||||
if (this_track->IsMuted()) {
|
||||
Track *this_track = list->get_track_at(i);
|
||||
if (this_track->is_muted()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int &this_block_index = block_indexes[i];
|
||||
if (this_block_index >= this_track->Blocks().size()) {
|
||||
if (this_block_index >= this_track->blocks().size()) {
|
||||
continue;
|
||||
}
|
||||
Block *this_block =
|
||||
this_track->Blocks().at(this_block_index);
|
||||
this_track->blocks().at(this_block_index);
|
||||
|
||||
Track *compare_track =
|
||||
tracks_to_push.isEmpty() ?
|
||||
nullptr :
|
||||
list->GetTrackAt(tracks_to_push.first());
|
||||
list->get_track_at(tracks_to_push.first());
|
||||
const int &compare_block_index =
|
||||
tracks_to_push.isEmpty() ?
|
||||
-1 :
|
||||
block_indexes.at(tracks_to_push.first());
|
||||
Block *compare_block =
|
||||
compare_track ?
|
||||
compare_track->Blocks().at(compare_block_index) :
|
||||
compare_track->blocks().at(compare_block_index) :
|
||||
nullptr;
|
||||
if (!compare_track ||
|
||||
compare_block->in() >= this_block->in()) {
|
||||
@@ -143,14 +143,14 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
}
|
||||
|
||||
for (int i = 0; i < tracks_to_push.size(); i++) {
|
||||
Track *this_track = list->GetTrackAt(tracks_to_push.at(i));
|
||||
Block *this_block = this_track->Blocks().at(
|
||||
Track *this_track = list->get_track_at(tracks_to_push.at(i));
|
||||
Block *this_block = this_track->blocks().at(
|
||||
block_indexes.at(tracks_to_push.at(i)));
|
||||
|
||||
if (const SubtitleBlock *sub =
|
||||
dynamic_cast<const SubtitleBlock *>(this_block)) {
|
||||
if (sub->is_enabled()) {
|
||||
if (!EncodeSubtitle(sub)) {
|
||||
if (!encode_subtitle(sub)) {
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
@@ -165,8 +165,8 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
|
||||
finished_watcher_mutex_.lock();
|
||||
|
||||
while (result && !IsCancelled()) {
|
||||
while (!finished_watchers_.empty() && !IsCancelled() && result) {
|
||||
while (result && !is_cancelled()) {
|
||||
while (!finished_watchers_.empty() && !is_cancelled() && result) {
|
||||
RenderTicketWatcher *watcher = finished_watchers_.front();
|
||||
finished_watchers_.pop_front();
|
||||
|
||||
@@ -174,15 +174,15 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
|
||||
// Analyze watcher here
|
||||
RenderManager::TicketType ticket_type =
|
||||
watcher->GetTicket()
|
||||
watcher->get_ticket()
|
||||
->property("type")
|
||||
.value<RenderManager::TicketType>();
|
||||
|
||||
if (ticket_type == RenderManager::kTypeAudio) {
|
||||
if (ticket_type == RenderManager::k_type_audio) {
|
||||
TimeRange range = watcher->property("range").value<TimeRange>();
|
||||
|
||||
if (!AudioDownloaded(range,
|
||||
watcher->Get().value<SampleBuffer>())) {
|
||||
if (!audio_downloaded(range,
|
||||
watcher->get().value<SampleBuffer>())) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
@@ -191,39 +191,39 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
//progress_counter += range.length().toDouble();
|
||||
//emit ProgressChanged(progress_counter / total_length);
|
||||
|
||||
} else if (ticket_type == RenderManager::kTypeVideo &&
|
||||
TwoStepFrameRendering()) {
|
||||
if (!DownloadFrame(
|
||||
&watcher_thread, watcher->Get().value<FramePtr>(),
|
||||
watcher->property("time").value<rational>())) {
|
||||
} else if (ticket_type == RenderManager::k_type_video &&
|
||||
two_step_frame_rendering()) {
|
||||
if (!download_frame(
|
||||
&watcher_thread, watcher->get().value<FramePtr>(),
|
||||
watcher->property("time").value<Rational>())) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
if (native_progress_signalling_) {
|
||||
progress_counter += 0.5;
|
||||
emit ProgressChanged(progress_counter / total_length);
|
||||
emit progress_changed(progress_counter / total_length);
|
||||
}
|
||||
|
||||
} else {
|
||||
// Assume single-step video or video download ticket
|
||||
if (!FrameDownloaded(
|
||||
watcher->Get().value<FramePtr>(),
|
||||
watcher->property("time").value<rational>())) {
|
||||
if (!frame_downloaded(
|
||||
watcher->get().value<FramePtr>(),
|
||||
watcher->property("time").value<Rational>())) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
if (native_progress_signalling_) {
|
||||
double progress_to_add = 1.0;
|
||||
if (TwoStepFrameRendering()) {
|
||||
if (two_step_frame_rendering()) {
|
||||
progress_to_add *= 0.5;
|
||||
}
|
||||
progress_counter += progress_to_add;
|
||||
|
||||
emit ProgressChanged(progress_counter / total_length);
|
||||
emit progress_changed(progress_counter / total_length);
|
||||
}
|
||||
|
||||
if (iterator.GetNext(&next_frame)) {
|
||||
StartTicket(&watcher_thread, manager, next_frame, mode,
|
||||
if (iterator.get_next(&next_frame)) {
|
||||
start_ticket(&watcher_thread, manager, next_frame, mode,
|
||||
cache, force_size, force_matrix, force_format,
|
||||
force_channel_count, force_color_output,
|
||||
force_color_transform);
|
||||
@@ -236,7 +236,7 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
finished_watcher_mutex_.lock();
|
||||
}
|
||||
|
||||
if (IsCancelled() || !result) {
|
||||
if (is_cancelled() || !result) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -251,17 +251,17 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
|
||||
finished_watcher_mutex_.unlock();
|
||||
|
||||
if (IsCancelled() || !result) {
|
||||
if (is_cancelled() || !result) {
|
||||
// Cancel every watcher we created
|
||||
foreach (RenderTicketWatcher *watcher, running_watchers_) {
|
||||
watcher->Cancel();
|
||||
disconnect(watcher, &RenderTicketWatcher::Finished, this,
|
||||
&RenderTask::TicketDone);
|
||||
RenderManager::instance()->RemoveTicket(watcher->GetTicket());
|
||||
watcher->cancel();
|
||||
disconnect(watcher, &RenderTicketWatcher::finished, this,
|
||||
&RenderTask::ticket_done);
|
||||
RenderManager::instance()->remove_ticket(watcher->get_ticket());
|
||||
}
|
||||
|
||||
foreach (RenderTicketWatcher *watcher, running_watchers_) {
|
||||
watcher->WaitForFinished();
|
||||
watcher->wait_for_finished();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,8 +275,8 @@ bool RenderTask::Render(ColorManager *manager, const TimeRangeList &video_range,
|
||||
return result;
|
||||
}
|
||||
|
||||
bool RenderTask::DownloadFrame(QThread *thread, FramePtr frame,
|
||||
const rational &time)
|
||||
bool RenderTask::download_frame(QThread *thread, FramePtr frame,
|
||||
const Rational &time)
|
||||
{
|
||||
//RenderTicketWatcher* watcher = new RenderTicketWatcher();
|
||||
//PrepareWatcher(watcher, thread);
|
||||
@@ -289,36 +289,36 @@ bool RenderTask::DownloadFrame(QThread *thread, FramePtr frame,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RenderTask::EncodeSubtitle(const SubtitleBlock *subtitle)
|
||||
bool RenderTask::encode_subtitle(const SubtitleBlock *subtitle)
|
||||
{
|
||||
Q_UNUSED(subtitle)
|
||||
return true;
|
||||
}
|
||||
|
||||
void RenderTask::PrepareWatcher(RenderTicketWatcher *watcher, QThread *thread)
|
||||
void RenderTask::prepare_watcher(RenderTicketWatcher *watcher, QThread *thread)
|
||||
{
|
||||
watcher->moveToThread(thread);
|
||||
connect(watcher, &RenderTicketWatcher::Finished, this,
|
||||
&RenderTask::TicketDone, Qt::DirectConnection);
|
||||
connect(watcher, &RenderTicketWatcher::finished, this,
|
||||
&RenderTask::ticket_done, Qt::DirectConnection);
|
||||
running_watchers_.append(watcher);
|
||||
}
|
||||
|
||||
void RenderTask::IncrementRunningTickets()
|
||||
void RenderTask::increment_running_tickets()
|
||||
{
|
||||
finished_watcher_mutex_.lock();
|
||||
running_tickets_++;
|
||||
finished_watcher_mutex_.unlock();
|
||||
}
|
||||
|
||||
void RenderTask::StartTicket(QThread *watcher_thread, ColorManager *manager,
|
||||
const rational &time, RenderMode::Mode mode,
|
||||
void RenderTask::start_ticket(QThread *watcher_thread, ColorManager *manager,
|
||||
const Rational &time, RenderMode::Mode mode,
|
||||
FrameHashCache *cache, const QSize &force_size,
|
||||
const QMatrix4x4 &force_matrix,
|
||||
PixelFormat force_format, int force_channel_count,
|
||||
ColorProcessorPtr force_color_output,
|
||||
const ColorTransform &force_color_transform)
|
||||
{
|
||||
RenderManager::RenderVideoParams rvp(viewer_->GetConnectedTextureOutput(),
|
||||
RenderManager::RenderVideoParams rvp(viewer_->get_connected_texture_output(),
|
||||
video_params_, audio_params_, time,
|
||||
manager, mode);
|
||||
|
||||
@@ -330,17 +330,17 @@ void RenderTask::StartTicket(QThread *watcher_thread, ColorManager *manager,
|
||||
rvp.force_channel_count = force_channel_count;
|
||||
|
||||
if (cache) {
|
||||
rvp.AddCache(cache);
|
||||
rvp.add_cache(cache);
|
||||
}
|
||||
|
||||
RenderTicketWatcher *watcher = new RenderTicketWatcher();
|
||||
watcher->setProperty("time", QVariant::fromValue(time));
|
||||
PrepareWatcher(watcher, watcher_thread);
|
||||
IncrementRunningTickets();
|
||||
watcher->SetTicket(RenderManager::instance()->RenderFrame(rvp));
|
||||
prepare_watcher(watcher, watcher_thread);
|
||||
increment_running_tickets();
|
||||
watcher->set_ticket(RenderManager::instance()->render_frame(rvp));
|
||||
}
|
||||
|
||||
void RenderTask::TicketDone(RenderTicketWatcher *watcher)
|
||||
void RenderTask::ticket_done(RenderTicketWatcher *watcher)
|
||||
{
|
||||
finished_watcher_mutex_.lock();
|
||||
finished_watchers_.push_back(watcher);
|
||||
|
||||
Reference in New Issue
Block a user