AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Classes | Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::playlistParser::ContentDecrypter Class Reference

#include <ContentDecrypter.h>

Inheritance diagram for alexaClientSDK::playlistParser::ContentDecrypter:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::playlistParser::ContentDecrypter:
Collaboration graph
[legend]

Public Member Functions

 ContentDecrypter ()
 
void setMediaInitToDecryptedContent (const ByteVector &mediaInitSection, std::chrono::milliseconds totalDuration)
 
bool decryptAndWrite (const ByteVector &encryptedContent, const ByteVector &key, const avsCommon::utils::playlistParser::EncryptionInfo &encryptionInfo, const std::shared_ptr< avsCommon::avs::attachment::AttachmentWriter > &streamWriter, const std::shared_ptr< Id3TagsRemover > &id3TagRemover)
 
RequiresShutdown methods.
void doShutdown () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::RequiresShutdown
 RequiresShutdown (const std::string &name)
 
virtual ~RequiresShutdown ()
 Destructor. More...
 
const std::string & name () const
 
void shutdown ()
 
bool isShutdown () const
 

Static Public Member Functions

static bool convertIVToByteArray (const std::string &hexIV, ByteVector *ivByteArray)
 

Additional Inherited Members

Detailed Description

Helper class to decrypt downloaded media content.

Constructor & Destructor Documentation

◆ ContentDecrypter()

alexaClientSDK::playlistParser::ContentDecrypter::ContentDecrypter ( )

Constructor

Member Function Documentation

◆ convertIVToByteArray()

static bool alexaClientSDK::playlistParser::ContentDecrypter::convertIVToByteArray ( const std::string &  hexIV,
ByteVector ivByteArray 
)
static

Converts initialization vector from hex to byte array.

Parameters
hexIVThe initialization vector in HEX.
[out]ivByteArrayPointer to result byte array if successful.
Returns
true if conversion is successful or false if failed.

◆ decryptAndWrite()

bool alexaClientSDK::playlistParser::ContentDecrypter::decryptAndWrite ( const ByteVector encryptedContent,
const ByteVector key,
const avsCommon::utils::playlistParser::EncryptionInfo encryptionInfo,
const std::shared_ptr< avsCommon::avs::attachment::AttachmentWriter > &  streamWriter,
const std::shared_ptr< Id3TagsRemover > &  id3TagRemover 
)

Decrypts contents and writes to stream.

Parameters
encryptedContentThe content that needs to be decrypted.
keyThe encryption key.
encryptionInfoThe EncryptionInfo of the encrypted content.
streamWriterThe writer to write decrypted content.
id3TagRemoverA component to remove ID3 tags from content.
Returns
true if decryption and write to stream is successful or false otherwise.

◆ doShutdown()

void alexaClientSDK::playlistParser::ContentDecrypter::doShutdown ( )
overridevirtual

Prepares/enables this object to be deleted. This should be the last function called on this object prior to deleting (or resetting) its shared_ptr.

Warning
  • Attempting to call functions on this object after calling shutdown() can result in undefined behavior.
  • Neglecting to call shutdown() on this object can result in resource leaks or other undefined behavior.

Implements alexaClientSDK::avsCommon::utils::RequiresShutdown.

◆ setMediaInitToDecryptedContent()

void alexaClientSDK::playlistParser::ContentDecrypter::setMediaInitToDecryptedContent ( const ByteVector mediaInitSection,
std::chrono::milliseconds  totalDuration 
)

Sets Media initialization section to mp4a from enca.

Parameters
mediaInitSectionThe Media initialization section.
totalDurationTotal duration of the content

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0