2023-07-21 10:41:49 +00:00
|
|
|
// Copyright 2020 Google LLC. All rights reserved.
|
2020-10-20 21:08:46 +00:00
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file or at
|
|
|
|
// https://developers.google.com/open-source/licenses/bsd
|
|
|
|
|
|
|
|
#ifndef PACKAGER_APP_SINGLE_THREAD_JOB_MANAGER_H_
|
|
|
|
#define PACKAGER_APP_SINGLE_THREAD_JOB_MANAGER_H_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2023-10-10 23:51:11 +00:00
|
|
|
#include <packager/app/job_manager.h>
|
2020-10-20 21:08:46 +00:00
|
|
|
|
|
|
|
namespace shaka {
|
|
|
|
namespace media {
|
|
|
|
|
|
|
|
// A subclass of JobManager that runs all the jobs in a single thread.
|
|
|
|
class SingleThreadJobManager : public JobManager {
|
|
|
|
public:
|
|
|
|
// @param sync_points is an optional SyncPointQueue used to synchronize and
|
|
|
|
// align cue points. JobManager cancels @a sync_points when any job
|
|
|
|
// fails or is cancelled. It can be NULL.
|
|
|
|
explicit SingleThreadJobManager(std::unique_ptr<SyncPointQueue> sync_points);
|
|
|
|
|
2023-07-21 10:41:49 +00:00
|
|
|
// Run all registered jobs serially in this thread.
|
2020-10-20 21:08:46 +00:00
|
|
|
Status RunJobs() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace media
|
|
|
|
} // namespace shaka
|
|
|
|
|
|
|
|
#endif // PACKAGER_APP_SINGLE_THREAD_JOB_MANAGER_H_
|