RDK Documentation (Open Sourced RDK Components)
FakeAampScheduler.cpp
1 /*
2 * If not stated otherwise in this file or this component's license file the
3 * following copyright and licenses apply:
4 *
5 * Copyright 2022 RDK Management
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19 
20 #include "MockAampScheduler.h"
21 #include "AampScheduler.h"
22 
23 MockAampScheduler *g_mockAampScheduler = nullptr;
24 
26 {
27 }
28 
30 {
31 }
32 
34 {
35 }
36 
38 {
39 }
40 
42 {
43 }
44 
46 {
47 }
48 
50 {
51 }
52 
54 {
55  if (g_mockAampScheduler != nullptr)
56  {
57  return g_mockAampScheduler->ScheduleTask(obj);
58  }
59  else
60  {
61  return 0;
62  }
63 }
64 
66 {
67  if (g_mockAampScheduler != nullptr)
68  {
69  return g_mockAampScheduler->SetState(sstate);
70  }
71 }
72 
73 bool AampScheduler::RemoveTask(int id)
74 {
75  return false;
76 }
AampScheduler::ScheduleTask
int ScheduleTask(AsyncTaskObj obj)
To schedule a task to be executed later.
Definition: AampScheduler.cpp:64
MockAampScheduler
Definition: MockAampScheduler.h:26
AampScheduler::SetState
void SetState(PrivAAMPState sstate)
To player state to Scheduler.
Definition: AampScheduler.cpp:254
AampScheduler::AampScheduler
AampScheduler()
AampScheduler Constructor.
Definition: AampScheduler.cpp:30
AampScheduler::StartScheduler
void StartScheduler()
To start scheduler thread.
Definition: AampScheduler.cpp:52
AsyncTaskObj
Async task operations.
Definition: AampScheduler.h:57
AampScheduler::~AampScheduler
virtual ~AampScheduler()
AampScheduler Destructor.
Definition: AampScheduler.cpp:41
AampScheduler::ResumeScheduler
void ResumeScheduler()
To release execution lock.
Definition: AampScheduler.cpp:208
AampScheduler::RemoveTask
bool RemoveTask(int id)
To remove a scheduled tasks with ID.
Definition: AampScheduler.cpp:218
AampScheduler::StopScheduler
void StopScheduler()
To stop scheduler and associated resources.
Definition: AampScheduler.cpp:173
AampScheduler.h
Class to schedule commands for async execution.
PrivAAMPState
PrivAAMPState
Mapping all required status codes based on JS player requirement. These requirements may be forced by...
Definition: AampEvent.h:156
AampScheduler::SuspendScheduler
void SuspendScheduler()
To acquire execution lock for synchronisation purposes.
Definition: AampScheduler.cpp:198
AampScheduler::RemoveAllTasks
void RemoveAllTasks()
To remove all scheduled tasks and prevent further tasks from scheduling.
Definition: AampScheduler.cpp:156