DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs Enumerator
Classes | Enumerations | Functions | Variables
edash_packager Namespace Reference

Classes

struct  Element
 
struct  ContentProtectionElement
 
class  DashIopMpdNotifier
 
class  MockMpdBuilder
 
class  MockAdaptationSet
 
class  MockRepresentation
 
class  MockMpdNotifier
 
class  MpdBuilder
 This class generates DASH MPDs (Media Presentation Descriptions). More...
 
class  AdaptationSet
 
class  RepresentationStateChangeListener
 
class  Representation
 
class  MpdNotifier
 
struct  MpdOptions
 Defines Mpd Options. More...
 
struct  SegmentInfo
 
class  SimpleMpdNotifier
 
class  MpdNotifierFactory
 
class  MpdWriter
 

Enumerations

enum  DashProfile { kUnknownProfile, kOnDemandProfile, kLiveProfile }
 
enum  ContentType { kContentTypeUnknown, kContentTypeVideo, kContentTypeAudio, kContentTypeText }
 

Functions

bool ValidateFixedCryptoFlags ()
 
bool ValidateFlag (const char *flag_name, const std::string &flag_value, bool condition, bool optional, const char *label)
 
void PrintError (const std::string &error_message)
 
bool ValidateWidevineCryptoFlags ()
 
std::string LanguageToShortestForm (const std::string &language)
 
std::string LanguageToISO_639_2 (const std::string &language)
 
bool WriteMpdToFile (const std::string &output_path, MpdBuilder *mpd_builder)
 
ContentType GetContentType (const MediaInfo &media_info)
 
std::string Uint8VectorToBase64 (const std::vector< uint8_t > &input)
 Converts uint8 vector into base64 encoded string.
 
bool HasVODOnlyFields (const MediaInfo &media_info)
 
bool HasLiveOnlyFields (const MediaInfo &media_info)
 
void RemoveDuplicateAttributes (ContentProtectionElement *content_protection_element)
 
std::string GetCodecs (const MediaInfo &media_info)
 
std::string SecondsToXmlDuration (double seconds)
 
bool GetDurationAttribute (xmlNodePtr node, float *duration)
 
bool MoreThanOneTrue (bool b1, bool b2, bool b3)
 
bool AtLeastOneTrue (bool b1, bool b2, bool b3)
 
bool OnlyOneTrue (bool b1, bool b2, bool b3)
 
bool HexToUUID (const std::string &data, std::string *uuid_format)
 
void UpdateContentProtectionPsshHelper (const std::string &drm_uuid, const std::string &pssh, std::list< ContentProtectionElement > *content_protection_elements)
 
void AddContentProtectionElements (const MediaInfo &media_info, Representation *parent)
 
void AddContentProtectionElements (const MediaInfo &media_info, AdaptationSet *parent)
 

Variables

const char kEncryptedMp4Scheme [] = "urn:mpeg:dash:mp4protection:2011"
 
const char kPsshElementName [] = "cenc:pssh"
 
const char kEncryptedMp4Value [] = "cenc"
 

Detailed Description

NOTE: Inclusion of this module will cause curl_global_init and curl_global_cleanup to be called at static initialization / deinitialization time.

All the methods that are virtual are virtual for mocking. NOTE: Inclusion of this module will cause xmlInitParser and xmlCleanupParser to be called at static initialization / deinitialization time.

This file contains helper functions and enums for MpdNotifier implementations.

Function Documentation

void edash_packager::AddContentProtectionElements ( const MediaInfo &  media_info,
Representation *  parent 
)

Adds <ContentProtection> elements specified by media_info to adaptation_set. Note that this will add the elements as direct chlidren of AdaptationSet.

Parameters
media_infomay or may not have protected_content field.
adaptation_setis the parent element that owns the ContentProtection elements.

Definition at line 253 of file mpd_utils.cc.

void edash_packager::AddContentProtectionElements ( const MediaInfo &  media_info,
AdaptationSet *  parent 
)

Adds <ContentProtection> elements specified by media_info to representation.

Parameters
media_infomay or may not have protected_content field.
representationis the parent element that owns the ContentProtection elements.

Definition at line 258 of file mpd_utils.cc.

ContentType edash_packager::GetContentType ( const MediaInfo &  media_info)

Determines the content type of |media_info|.

Parameters
media_infois the information about the media.
Returns
content type of the media_info.

Definition at line 51 of file mpd_notifier_util.cc.

bool edash_packager::HexToUUID ( const std::string &  data,
std::string *  uuid_format 
)

Converts hex data to UUID format. Hex data must be size 16.

Parameters
datainput hex data.
uuid_formatis the UUID format of the input.

Definition at line 97 of file mpd_utils.cc.

std::string edash_packager::LanguageToISO_639_2 ( const std::string &  language)

Convert a language tag to a 3-letter ISO-639-2 code, as required by the ISO BMFF spec. The input is assumed to be a valid ISO-639-2 or ISO-639-1 language code. Regions and variants are not supported.

Definition at line 96 of file language_utils.cc.

std::string edash_packager::LanguageToShortestForm ( const std::string &  language)

Convert a language tag to its shortest form, as required by RFC 5646 indicated in the MPD spec. Assumes the input is a valid ISO-639-2 or ISO-639-1 language tag. Regions and variants are not supported.

Definition at line 77 of file language_utils.cc.

void edash_packager::PrintError ( const std::string &  error_message)

Format and print error message.

Parameters
error_messagespecifies the error message.

Definition at line 36 of file validate_flag.cc.

bool edash_packager::ValidateFixedCryptoFlags ( )

Validate fixed encryption/decryption flags.

Returns
true on success, false otherwise.

Definition at line 29 of file fixed_key_encryption_flags.cc.

bool edash_packager::ValidateFlag ( const char *  flag_name,
const std::string &  flag_value,
bool  condition,
bool  optional,
const char *  label 
)

Validate a flag against the given condition.

Parameters
flag_nameis the name of the flag.
flag_valueis the value of the flag.
condition,optionaldetermines how the flag should be validated. If condition is true and optional is false, then this flag is required
labelspecifies the label associated with the condition. It is used to generate the error message on validation failure.
Returns
true on success, false otherwise.

Definition at line 17 of file validate_flag.cc.

bool edash_packager::ValidateWidevineCryptoFlags ( )

Validate widevine encryption/decryption flags.

Returns
true on success, false otherwise.

Definition at line 55 of file widevine_encryption_flags.cc.

bool edash_packager::WriteMpdToFile ( const std::string &  output_path,
MpdBuilder *  mpd_builder 
)

Outputs MPD to output_path.

Parameters
output_pathis the path to the MPD output location.
mpd_builderis the MPD builder instance.

Definition at line 20 of file mpd_notifier_util.cc.