Source release v2.1.3-2-789 + third_party libs
Change-Id: I8648756dab3fe1f53d6da18b83cd1294581d1abe
This commit is contained in:
@@ -269,6 +269,9 @@ class ContentDecryptionModule_1 {
|
||||
const uint8_t* key, int key_size,
|
||||
const uint8_t* key_id, int key_id_size) = 0;
|
||||
|
||||
// Tests whether |key_id| is known to any current session.
|
||||
virtual bool IsKeyValid(const uint8_t* key_id, int key_id_size) = 0;
|
||||
|
||||
// Cancels any pending key request made to the CDM for |session_id|.
|
||||
//
|
||||
// Returns kSuccess if all pending key requests for |session_id| were
|
||||
@@ -293,80 +296,6 @@ class ContentDecryptionModule_1 {
|
||||
virtual Status Decrypt(const InputBuffer& encrypted_buffer,
|
||||
DecryptedBlock* decrypted_buffer) = 0;
|
||||
|
||||
// Initializes the CDM audio decoder with |audio_decoder_config|.
|
||||
// This function is only needed if DecryptAndDecodeSamples() or
|
||||
// DecryptDecodeAndRenderSamples() is used. It must be called before either
|
||||
// of these routines is called.
|
||||
//
|
||||
// Returns kSuccess if the |audio_decoder_config| is supported and the CDM
|
||||
// audio decoder is successfully initialized.
|
||||
// Returns kSessionError if |audio_decoder_config| is not supported. The CDM
|
||||
// may still be able to do Decrypt().
|
||||
//
|
||||
virtual Status InitializeAudioDecoder(
|
||||
const AudioDecoderConfig& audio_decoder_config) = 0;
|
||||
|
||||
// Initializes the CDM video decoder with |video_decoder_config|.
|
||||
// This function is only needed if DecryptAndDecodeFrame() or
|
||||
// DecryptDecodeAndRenderFrame() is used. It must be called before either
|
||||
// of these routines is called.
|
||||
//
|
||||
// Returns kSuccess if the |video_decoder_config| is supported and the CDM
|
||||
// video decoder is successfully initialized.
|
||||
// Returns kSessionError if |video_decoder_config| is not supported. The CDM
|
||||
// may still be able to do Decrypt().
|
||||
//
|
||||
virtual Status InitializeVideoDecoder(
|
||||
const VideoDecoderConfig& video_decoder_config) = 0;
|
||||
|
||||
// De-initializes the CDM decoder and sets it to an uninitialized state. The
|
||||
// caller can initialize the decoder again after this call to re-initialize
|
||||
// it. This can be used to reconfigure the decoder if the configuration
|
||||
// changes.
|
||||
virtual void DeinitializeDecoder(StreamType decoder_type) = 0;
|
||||
|
||||
// Resets the CDM decoder to an initialized clean state. All internal buffers
|
||||
// MUST be flushed.
|
||||
virtual void ResetDecoder(StreamType decoder_type) = 0;
|
||||
|
||||
// Decrypts the |encrypted_buffer| and decodes the decrypted buffer into a
|
||||
// |video_frame|. Upon end-of-stream, the caller should call this function
|
||||
// repeatedly with empty |encrypted_buffer| (|data| == NULL) until only empty
|
||||
// |video_frame| (|format| == kEmptyVideoFrame) is produced.
|
||||
//
|
||||
// Returns kSuccess if decryption and decoding both succeeded, in which case
|
||||
// the callee will have filled the |video_frame| and passed the ownership of
|
||||
// |frame_buffer| in |video_frame| to the caller.
|
||||
// Returns kNoKey if the CDM did not have the necessary decryption key
|
||||
// to decrypt.
|
||||
// Returns kNeedMoreData if more data was needed by the decoder to generate
|
||||
// a decoded frame (e.g. during initialization and end-of-stream).
|
||||
// Returns kDecryptError if any decryption error happened.
|
||||
// Returns kDecodeError if any decoding error happened.
|
||||
// If the return value is not kSuccess, |video_frame| should be ignored by
|
||||
// the caller.
|
||||
virtual Status DecryptAndDecodeFrame(const InputBuffer& encrypted_buffer,
|
||||
VideoFrame* video_frame) = 0;
|
||||
|
||||
// Decrypts the |encrypted_buffer| and decodes the decrypted buffer into
|
||||
// |audio_frames|. Upon end-of-stream, the caller should call this function
|
||||
// repeatedly with empty |encrypted_buffer| (|data| == NULL) until only empty
|
||||
// |audio_frames| is produced.
|
||||
//
|
||||
// Returns kSuccess if decryption and decoding both succeeded, in which case
|
||||
// the callee will have filled |audio_frames| and passed the ownership of
|
||||
// |data| in |audio_frames| to the caller.
|
||||
// Returns kNoKey if the CDM did not have the necessary decryption key
|
||||
// to decrypt.
|
||||
// Returns kNeedMoreData if more data was needed by the decoder to generate
|
||||
// audio samples (e.g. during initialization and end-of-stream).
|
||||
// Returns kDecryptError if any decryption error happened.
|
||||
// Returns kDecodeError if any decoding error happened.
|
||||
// If the return value is not kSuccess, |audio_frames| should be ignored by
|
||||
// the caller.
|
||||
virtual Status DecryptAndDecodeSamples(const InputBuffer& encrypted_buffer,
|
||||
AudioFrames* audio_frames) = 0;
|
||||
|
||||
// Decrypts the |encrypted_buffer|, decodes the decrypted buffer into a
|
||||
// video frame, and passes the frame to the rendering FW/HW. No data
|
||||
// is returned.
|
||||
@@ -471,28 +400,18 @@ class Host_1 {
|
||||
MediaKeyError error_code,
|
||||
uint32_t system_code) = 0;
|
||||
|
||||
// Get private data from the host. This function is limited to internal use.
|
||||
typedef const void* (*GetPrivateInterface)(const char* interface_name);
|
||||
virtual void GetPrivateData(int32_t* instance,
|
||||
GetPrivateInterface* get_interface) = 0;
|
||||
// Version 1.3:
|
||||
// These virtual member functions extend the cdm::Host interface to allow
|
||||
// the CDM to query the host for various information.
|
||||
|
||||
//Version 1.3
|
||||
// These Virtual member functions extend the cdm::Host interface to allow
|
||||
// the sharing for platform specific information, between the cdm::Host and
|
||||
// the CDM.
|
||||
// Asks the host to persist a name-value pair.
|
||||
virtual void SetPlatformString(const std::string& name,
|
||||
const std::string& value) = 0;
|
||||
|
||||
virtual int GetPlatformString(const std::string& name,
|
||||
std::string* value) = 0;
|
||||
virtual int SetPlatformString(const std::string& name,
|
||||
const std::string& value) = 0;
|
||||
virtual int PersistPlatformString(const std::string& name,
|
||||
const std::string& value) = 0;
|
||||
virtual int GetPlatformByteArray(const std::string& name,
|
||||
std::vector<uint8_t>* value) = 0;
|
||||
virtual int SetPlatformByteArray(const std::string& name,
|
||||
const std::vector<uint8_t>& value) = 0;
|
||||
virtual int PersistPlatformByteArray(const std::string& name,
|
||||
const std::vector<uint8_t>& value) = 0;
|
||||
// Retrieves a value by name. If there is no such value, the Host should
|
||||
// set value to an empty string.
|
||||
virtual void GetPlatformString(const std::string& name,
|
||||
std::string* value) = 0;
|
||||
|
||||
protected:
|
||||
Host_1() {}
|
||||
|
||||
Reference in New Issue
Block a user