DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
shaka::media::HttpKeyFetcher Class Reference

#include <http_key_fetcher.h>

Inheritance diagram for shaka::media::HttpKeyFetcher:
shaka::media::KeyFetcher

Public Member Functions

 HttpKeyFetcher ()
 Creates a fetcher with no timeout.
 
 HttpKeyFetcher (uint32_t timeout_in_seconds)
 

KeyFetcher implementation overrides.

Status FetchKeys (const std::string &url, const std::string &request, std::string *response) override
 
virtual Status Get (const std::string &url, std::string *response)
 
virtual Status Post (const std::string &url, const std::string &data, std::string *response)
 

Detailed Description

A KeyFetcher implementation that retrieves keys over HTTP(s). This class is not fully thread safe. It can be used in multi-thread environment once constructed, but it may not be safe to create a HttpKeyFetcher object when any other thread is running due to use of curl_global_init.

Definition at line 26 of file http_key_fetcher.h.

Constructor & Destructor Documentation

shaka::media::HttpKeyFetcher::HttpKeyFetcher ( uint32_t  timeout_in_seconds)

Create a fetcher with timeout.

Parameters
timeout_in_secondsspecifies the timeout in seconds.

Definition at line 75 of file http_key_fetcher.cc.

Member Function Documentation

Status shaka::media::HttpKeyFetcher::FetchKeys ( const std::string &  service_address,
const std::string &  request,
std::string *  response 
)
overridevirtual

Fetch Keys from license service. |response| is owned by caller.

Parameters
service_addresslicense service address.
requestJSON formatted request.
responseJSON formatted response. Owned by caller.
Returns
OK on success.

Implements shaka::media::KeyFetcher.

Definition at line 80 of file http_key_fetcher.cc.

Status shaka::media::HttpKeyFetcher::Get ( const std::string &  url,
std::string *  response 
)
virtual

Fetch content using HTTP GET.

Parameters
urlspecifies the content URL.
[out]responsewill contain the body of the http response on success. It should not be NULL.
Returns
OK on success.

Definition at line 86 of file http_key_fetcher.cc.

Status shaka::media::HttpKeyFetcher::Post ( const std::string &  url,
const std::string &  data,
std::string *  response 
)
virtual

Fetch content using HTTP POST.

Parameters
urlspecifies the content URL.
[out]responsewill contain the body of the http response on success. It should not be NULL.
Returns
OK on success.

Definition at line 90 of file http_key_fetcher.cc.


The documentation for this class was generated from the following files: