Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: media/cdm/ppapi/stub/stub_cdm.h

Issue 1043673002: Allow widevinecdmadapter to be built in Chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cdm/ppapi/stub/stub_cdm.h
diff --git a/media/cdm/ppapi/stub/stub_cdm.h b/media/cdm/ppapi/stub/stub_cdm.h
new file mode 100644
index 0000000000000000000000000000000000000000..5dc90906f739378420ec2396e8981c88d1b2e9bc
--- /dev/null
+++ b/media/cdm/ppapi/stub/stub_cdm.h
@@ -0,0 +1,77 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_CDM_PPAPI_STUB_STUB_CDM_H_
+#define MEDIA_CDM_PPAPI_STUB_STUB_CDM_H_
xhwang 2015/03/30 17:23:50 ddorwin/jrummell: Actually "external_clear_key" a
jrummell 2015/04/01 23:37:36 Moved stub to cdm/. external_clear_key can move la
+
+#include "base/basictypes.h"
+#include "media/cdm/ppapi/api/content_decryption_module.h"
+
+namespace media {
+
+typedef cdm::ContentDecryptionModule_8 StubCdmInterface;
+
+// Dummy implementation of the cdm::ContentDecryptionModule interface.
+class StubCdm : public StubCdmInterface {
+ public:
+ StubCdm(Host* host);
xhwang 2015/03/30 17:23:50 explicit
jrummell 2015/04/01 23:37:36 Done.
+ ~StubCdm() override;
+
+ // ContentDecryptionModule implementation.
xhwang 2015/03/30 17:23:50 s/CDM/StubCdmInterface/
jrummell 2015/04/01 23:37:36 Done.
+ void Initialize(bool allow_distinctive_identifier,
+ bool allow_persistent_state) override;
+ void CreateSessionAndGenerateRequest(uint32 promise_id,
+ cdm::SessionType session_type,
+ cdm::InitDataType init_data_type,
+ const uint8* init_data,
+ uint32 init_data_size) override;
+ void LoadSession(uint32 promise_id,
+ cdm::SessionType session_type,
+ const char* session_id,
+ uint32_t session_id_length) override;
+ void UpdateSession(uint32 promise_id,
+ const char* session_id,
+ uint32_t session_id_length,
+ const uint8* response,
+ uint32 response_size) override;
+ void CloseSession(uint32 promise_id,
+ const char* session_id,
+ uint32_t session_id_length) override;
+ void RemoveSession(uint32 promise_id,
+ const char* session_id,
+ uint32_t session_id_length) override;
+ void SetServerCertificate(uint32 promise_id,
+ const uint8_t* server_certificate_data,
+ uint32_t server_certificate_data_size) override;
+ void TimerExpired(void* context) override;
+ cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer,
+ cdm::DecryptedBlock* decrypted_block) override;
+ cdm::Status InitializeAudioDecoder(
+ const cdm::AudioDecoderConfig& audio_decoder_config) override;
+ cdm::Status InitializeVideoDecoder(
+ const cdm::VideoDecoderConfig& video_decoder_config) override;
+ void DeinitializeDecoder(cdm::StreamType decoder_type) override;
+ void ResetDecoder(cdm::StreamType decoder_type) override;
+ cdm::Status DecryptAndDecodeFrame(const cdm::InputBuffer& encrypted_buffer,
+ cdm::VideoFrame* video_frame) override;
+ cdm::Status DecryptAndDecodeSamples(const cdm::InputBuffer& encrypted_buffer,
+ cdm::AudioFrames* audio_frames) override;
+ void Destroy() override;
+ void OnPlatformChallengeResponse(
+ const cdm::PlatformChallengeResponse& response) override;
+ void OnQueryOutputProtectionStatus(cdm::QueryResult result,
+ uint32_t link_mask,
+ uint32_t output_protection_mask) override;
+
+ private:
+ void FailRequest(uint32 promise_id);
xhwang 2015/03/30 17:23:50 Add comment.
jrummell 2015/04/01 23:37:36 Done.
+
+ Host* host_;
+
+ DISALLOW_COPY_AND_ASSIGN(StubCdm);
+};
+
+} // namespace media
+
+#endif // MEDIA_CDM_PPAPI_STUB_STUB_CDM_H_

Powered by Google App Engine
This is Rietveld 408576698