25 #ifndef AAMPCURLSTORE_H
26 #define AAMPCURLSTORE_H
34 #define eCURL_MAX_AGE_TIME ( (300) * (1000) )
42 eCURL_STORE_HOST_NOT_AVAILABLE,
43 eCURL_STORE_SOCK_NOT_AVAILABLE,
44 eCURL_STORE_HOST_SOCK_AVAILABLE
53 pthread_mutex_t mCurlSharedlock;
54 pthread_mutex_t mDnsCurlShareMutex;
55 pthread_mutex_t mSslCurlShareMutex;
59 pthread_mutex_init(&mCurlSharedlock, NULL);
60 pthread_mutex_init(&mDnsCurlShareMutex, NULL);
61 pthread_mutex_init(&mSslCurlShareMutex, NULL);
69 long long eHdlTimestamp;
71 curlstruct():curl(NULL), eHdlTimestamp(0),curlId(0){}
80 std::deque<CurlHandleStruct> mFreeQ;
84 unsigned int mCurlStoreUserCount;
87 curlstorestruct():mCurlShared(NULL), pstShareLocks(NULL), timestamp(0), mCurlStoreUserCount(0), mFreeQ()
104 static pthread_mutex_t mCurlInstLock;
107 typedef std::unordered_map <std::string, CurlSocketStoreStruct*> CurlSockData ;
108 typedef std::unordered_map <std::string, CurlSocketStoreStruct*>::iterator CurlSockDataIter;
109 CurlSockData umCurlSockDataStore;
169 void CurlInit(
void *privContext,
AampCurlInstance startIdx,
unsigned int instanceCount, std::string proxyName,
const std::string &remotehost=std::string(
"") );
177 void CurlTerm(
void *privContext,
AampCurlInstance startIdx,
unsigned int instanceCount,
const std::string &remotehost=std::string(
""));
236 std::vector<std::string> allResponseHeadersForErrorLogging;
240 bool downloadIsEncoded;
242 bool chunkedDownload;
243 std::string remoteUrl;
244 size_t contentLength;
245 long long downloadStartTime;
247 CurlCallbackContext() : aamp(NULL), buffer(NULL), responseHeaderData(NULL),bitrate(0),downloadIsEncoded(
false), chunkedDownload(
false), fileType(
eMEDIATYPE_DEFAULT), remoteUrl(
""), allResponseHeadersForErrorLogging{
""}, contentLength(0),downloadStartTime(-1)
251 CurlCallbackContext(
PrivateInstanceAAMP *_aamp,
GrowableBuffer *_buffer) : aamp(_aamp), buffer(_buffer), responseHeaderData(NULL),bitrate(0),downloadIsEncoded(
false), chunkedDownload(
false), fileType(
eMEDIATYPE_DEFAULT), remoteUrl(
""), allResponseHeadersForErrorLogging{
""}, contentLength(0),downloadStartTime(-1){}
267 CurlProgressCbContext() : aamp(NULL), fileType(
eMEDIATYPE_DEFAULT), downloadStartTime(-1), abortReason(eCURL_ABORT_REASON_NONE), downloadUpdatedTime(-1), startTimeout(-1), stallTimeout(-1), downloadSize(-1), downloadNow(-1), downloadNowUpdatedTime(-1), dlStarted(
false), fragmentDurationMs(-1), remoteUrl(
""), lowBWTimeout(-1) {}
268 CurlProgressCbContext(
PrivateInstanceAAMP *_aamp,
long long _downloadStartTime) : aamp(_aamp), fileType(
eMEDIATYPE_DEFAULT),downloadStartTime(_downloadStartTime), abortReason(eCURL_ABORT_REASON_NONE), downloadUpdatedTime(-1), startTimeout(-1), stallTimeout(-1), downloadSize(-1), downloadNow(-1), downloadNowUpdatedTime(-1), dlStarted(
false), fragmentDurationMs(-1), remoteUrl(
""), lowBWTimeout(-1) {}
275 long long downloadStartTime;
276 long long downloadUpdatedTime;
283 long long downloadNowUpdatedTime;
285 int fragmentDurationMs;
286 std::string remoteUrl;
289 #endif //AAMPCURLSTORE_H