RDK Documentation (Open Sourced RDK Components)
FakeAampUtils.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 "AampUtils.h"
21 
22 long long aamp_GetCurrentTimeMS(void)
23 {
24  return 0;
25 }
26 
27 float getWorkingTrickplayRate(float rate)
28 {
29  return 0.0;
30 }
31 
32 void aamp_DecodeUrlParameter( std::string &uriParam )
33 {
34 }
35 
36 bool replace(std::string &str, const char *existingSubStringToReplace, const char *replacementString)
37 {
38  return false;
39 }
40 
41 bool aamp_IsLocalHost ( std::string Hostname )
42 {
43  return false;
44 }
45 
46 struct timespec aamp_GetTimespec(int timeInMs)
47 {
48  struct timespec tspec;
49  return tspec;
50 }
51 
52 float getPseudoTrickplayRate(float rate)
53 {
54  return 0.0;
55 }
56 
57 std::string aamp_getHostFromURL(std::string url)
58 {
59  return "";
60 }
61 
63 {
64  return 0;
65 }
66 
67 void getDefaultHarvestPath(std::string &value)
68 {
69 }
70 
71 bool aamp_WriteFile(std::string fileName, const char* data, size_t len, MediaType &fileType, unsigned int count,const char *prefix)
72 {
73  return false;
74 }
75 
76 std::size_t GetPrintableThreadID( const std::thread &t )
77 {
78  return 0;
79 }
replace
static int replace(std::string &str, const std::string &from, uint64_t toNumber)
Replace matching token with given number.
Definition: fragmentcollector_mpd.cpp:906
getHarvestConfigForMedia
int getHarvestConfigForMedia(MediaType fileType)
Get harvest config corresponds to Media type.
Definition: AampUtils.cpp:807
aamp_DecodeUrlParameter
void aamp_DecodeUrlParameter(std::string &uriParam)
unescape uri-encoded uri parameter
Definition: AampUtils.cpp:366
aamp_WriteFile
bool aamp_WriteFile(std::string fileName, const char *data, size_t len, MediaType &fileType, unsigned int count, const char *prefix)
Write - file to storage.
Definition: AampUtils.cpp:882
MediaType
MediaType
Media types.
Definition: AampMediaType.h:37
aamp_IsLocalHost
bool aamp_IsLocalHost(std::string Hostname)
check is local or not from given hostname
Definition: AampUtils.cpp:267
aamp_GetTimespec
struct timespec aamp_GetTimespec(int timeInMs)
To get the timespec.
Definition: AampUtils.cpp:741
getWorkingTrickplayRate
float getWorkingTrickplayRate(float rate)
Get compatible trickplay for 6s cadense of iframe track from the given rates.
Definition: AampUtils.cpp:944
getPseudoTrickplayRate
float getPseudoTrickplayRate(float rate)
Get reverse map the working rates to the rates given by platform player.
Definition: AampUtils.cpp:975
aamp_getHostFromURL
std::string aamp_getHostFromURL(std::string url)
Extract host string from url.
Definition: AampUtils.cpp:232
getDefaultHarvestPath
void getDefaultHarvestPath(std::string &value)
Get harvest path to dump the files.
Definition: AampUtils.cpp:102
aamp_GetCurrentTimeMS
long long aamp_GetCurrentTimeMS(void)
Get current time from epoch is milliseconds.
Definition: AampUtils.cpp:92