chromium/third_party/mediapipe/src/mediapipe/framework/scheduler.cc

// Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "mediapipe/framework/scheduler.h"

#include <memory>
#include <queue>
#include <utility>
#include <vector>

#include "absl/log/absl_check.h"
#include "absl/memory/memory.h"
#include "absl/synchronization/mutex.h"
#include "mediapipe/framework/calculator_graph.h"
#include "mediapipe/framework/executor.h"
#include "mediapipe/framework/port.h"
#include "mediapipe/framework/port/canonical_errors.h"
#include "mediapipe/framework/port/logging.h"
#include "mediapipe/framework/port/ret_check.h"
#include "mediapipe/framework/port/status.h"
#include "mediapipe/framework/timestamp.h"
#include "mediapipe/framework/tool/status_util.h"

namespace mediapipe {

namespace internal {

Scheduler::Scheduler(CalculatorGraph* graph)
    :{}

Scheduler::~Scheduler() {}

void Scheduler::Reset() {}

void Scheduler::CloseAllSourceNodes() {}

void Scheduler::SetExecutor(Executor* executor) {}

// TODO: Consider renaming this method CreateNonDefaultQueue.
absl::Status Scheduler::SetNonDefaultExecutor(const std::string& name,
                                              Executor* executor) {}

void Scheduler::SetQueuesRunning(bool running) {}

void Scheduler::SubmitWaitingTasksOnQueues() {}

// Note: state_mutex_ is held when this function is entered or
// exited.
void Scheduler::HandleIdle() {}

// Note: state_mutex_ is held when this function is entered or exited.
// Once this function returns, the scheduler may be destructed as soon as
// state_mutex_ is unlocked.
void Scheduler::Quit() {}

void Scheduler::Start() {}

void Scheduler::AddApplicationThreadTask(std::function<void()> task) {}

void Scheduler::ThrottledGraphInputStream() {}

void Scheduler::UnthrottledGraphInputStream() {}

void Scheduler::WaitUntilGraphInputStreamUnthrottled(
    absl::Mutex* secondary_mutex) {}

void Scheduler::EmittedObservedOutput() {}

absl::Status Scheduler::WaitForObservedOutput() {}

absl::Status Scheduler::WaitUntilIdle() {}

absl::Status Scheduler::WaitUntilDone() {}

void Scheduler::ApplicationThreadAwait(
    const std::function<bool()>& stop_condition) {}

bool Scheduler::IsIdle() {}

void Scheduler::AddedPacketToGraphInputStream() {}

// Note: This may be called while we are already in STATE_TERMINATED.
void Scheduler::ClosedAllGraphInputStreams() {}

// TODO: If the node isn't successfully scheduled, we must properly
// handle the pending calculator context. For example, the caller should dispose
// of the calculator context and put it into a pending calculator context
// container.
void Scheduler::ScheduleNodeIfNotThrottled(
    CalculatorNode* node, CalculatorContext* calculator_context) {}

void Scheduler::ScheduleNodeForOpen(CalculatorNode* node) {}

void Scheduler::ScheduleUnthrottledReadyNodes(
    const std::vector<CalculatorNode*>& nodes_to_schedule) {}

void Scheduler::CleanupActiveSources() {}

bool Scheduler::TryToScheduleNextSourceLayer() {}

void Scheduler::AddUnopenedSourceNode(CalculatorNode* node) {}

void Scheduler::AddNodeToSourcesQueue(CalculatorNode* node) {}

void Scheduler::AssignNodeToSchedulerQueue(CalculatorNode* node) {}

void Scheduler::QueueIdleStateChanged(bool idle) {}

void Scheduler::Pause() {}

void Scheduler::Resume() {}

void Scheduler::Cancel() {}

bool Scheduler::IsPaused() {}

bool Scheduler::IsTerminated() {}

void Scheduler::CleanupAfterRun() {}

internal::SchedulerTimes Scheduler::GetSchedulerTimes() {}

}  // namespace internal
}  // namespace mediapipe