summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 18:06:50 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-31 18:06:50 +0000
commitf5634f212be43f8349c86ab655c405cb0fac8485 (patch)
tree44f7dfd8b9376c99af2f4f77447ab6e9b375902a
parentcad80d4c6a01135aa61275d39b45e5696f97816c (diff)
downloadchromium_src-f5634f212be43f8349c86ab655c405cb0fac8485.zip
chromium_src-f5634f212be43f8349c86ab655c405cb0fac8485.tar.gz
chromium_src-f5634f212be43f8349c86ab655c405cb0fac8485.tar.bz2
Revert 232092 "Revert 232043 "Update ClearKeyCdm to use CDM::Host and CDM::Host...""
This relands r232043: Update ClearKeyCdm to use CDM::Host and CDM::Host::kVersion. R=ddorwin@chromium.org TBR=ddorwin@chromium.org, tommyw@chromium.org BUG=none TEST=none Review URL: https://codereview.chromium.org/54973002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232161 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--media/cdm/ppapi/cdm_video_decoder.cc2
-rw-r--r--media/cdm/ppapi/cdm_video_decoder.h3
-rw-r--r--media/cdm/ppapi/clear_key_cdm.cc9
-rw-r--r--media/cdm/ppapi/clear_key_cdm.h8
-rw-r--r--media/cdm/ppapi/clear_key_cdm_common.h18
-rw-r--r--media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc6
-rw-r--r--media/cdm/ppapi/ffmpeg_cdm_audio_decoder.h6
-rw-r--r--media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc4
-rw-r--r--media/cdm/ppapi/ffmpeg_cdm_video_decoder.h6
-rw-r--r--media/cdm/ppapi/libvpx_cdm_video_decoder.cc4
-rw-r--r--media/cdm/ppapi/libvpx_cdm_video_decoder.h4
-rw-r--r--media/media_cdm.gypi1
13 files changed, 46 insertions, 27 deletions
diff --git a/DEPS b/DEPS
index e25b61b..ea53918 100644
--- a/DEPS
+++ b/DEPS
@@ -253,7 +253,7 @@ deps = {
"/trunk/deps/third_party/opus@185324",
"src/media/cdm/ppapi/api":
- "/trunk/deps/cdm@230180",
+ "/trunk/deps/cdm@231683",
"src/third_party/mesa/src":
"/trunk/deps/third_party/mesa@229994",
diff --git a/media/cdm/ppapi/cdm_video_decoder.cc b/media/cdm/ppapi/cdm_video_decoder.cc
index 95523d4..f41af3d 100644
--- a/media/cdm/ppapi/cdm_video_decoder.cc
+++ b/media/cdm/ppapi/cdm_video_decoder.cc
@@ -21,7 +21,7 @@
namespace media {
scoped_ptr<CdmVideoDecoder> CreateVideoDecoder(
- cdm::Host* host, const cdm::VideoDecoderConfig& config) {
+ CdmHost* host, const cdm::VideoDecoderConfig& config) {
scoped_ptr<CdmVideoDecoder> video_decoder;
#if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER)
video_decoder.reset(new FakeCdmVideoDecoder(host));
diff --git a/media/cdm/ppapi/cdm_video_decoder.h b/media/cdm/ppapi/cdm_video_decoder.h
index 25d48f4..3f3b439 100644
--- a/media/cdm/ppapi/cdm_video_decoder.h
+++ b/media/cdm/ppapi/cdm_video_decoder.h
@@ -8,6 +8,7 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "media/cdm/ppapi/api/content_decryption_module.h"
+#include "media/cdm/ppapi/clear_key_cdm_common.h"
namespace media {
@@ -36,7 +37,7 @@ class CdmVideoDecoder {
// |config.codec|. Returns a scoped_ptr containing a non-null initialized
// CdmVideoDecoder* upon success.
scoped_ptr<CdmVideoDecoder> CreateVideoDecoder(
- cdm::Host* host, const cdm::VideoDecoderConfig& config);
+ CdmHost* host, const cdm::VideoDecoderConfig& config);
} // namespace media
diff --git a/media/cdm/ppapi/clear_key_cdm.cc b/media/cdm/ppapi/clear_key_cdm.cc
index d7cd206..c037aae 100644
--- a/media/cdm/ppapi/clear_key_cdm.cc
+++ b/media/cdm/ppapi/clear_key_cdm.cc
@@ -136,12 +136,11 @@ void* CreateCdmInstance(
return NULL;
}
- if (cdm_interface_version != cdm::ContentDecryptionModule_2::kVersion)
+ if (cdm_interface_version != media::CdmInterface::kVersion)
return NULL;
- cdm::ContentDecryptionModule_2::Host* host =
- static_cast<cdm::ContentDecryptionModule_2::Host*>(get_cdm_host_func(
- cdm::ContentDecryptionModule_2::Host::kVersion, user_data));
+ media::CdmHost* host = static_cast<media::CdmHost*>(
+ get_cdm_host_func(media::CdmHost::kVersion, user_data));
if (!host)
return NULL;
@@ -186,7 +185,7 @@ void ClearKeyCdm::Client::KeyMessage(const std::string& session_id,
default_url_ = default_url;
}
-ClearKeyCdm::ClearKeyCdm(cdm::Host* host)
+ClearKeyCdm::ClearKeyCdm(CdmHost* host)
: decryptor_(base::Bind(&Client::KeyAdded, base::Unretained(&client_)),
base::Bind(&Client::KeyError, base::Unretained(&client_)),
base::Bind(&Client::KeyMessage, base::Unretained(&client_))),
diff --git a/media/cdm/ppapi/clear_key_cdm.h b/media/cdm/ppapi/clear_key_cdm.h
index 5702905..84a8655 100644
--- a/media/cdm/ppapi/clear_key_cdm.h
+++ b/media/cdm/ppapi/clear_key_cdm.h
@@ -14,7 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
#include "media/cdm/aes_decryptor.h"
-#include "media/cdm/ppapi/api/content_decryption_module.h"
+#include "media/cdm/ppapi/clear_key_cdm_common.h"
// Enable this to use the fake decoder for testing.
// TODO(tomfinegan): Move fake audio decoder into a separate class.
@@ -28,9 +28,9 @@ class DecoderBuffer;
class FFmpegCdmAudioDecoder;
// Clear key implementation of the cdm::ContentDecryptionModule interface.
-class ClearKeyCdm : public cdm::ContentDecryptionModule_2 {
+class ClearKeyCdm : public CdmInterface {
public:
- explicit ClearKeyCdm(cdm::Host* host);
+ explicit ClearKeyCdm(Host* host);
virtual ~ClearKeyCdm();
// ContentDecryptionModule implementation.
@@ -139,7 +139,7 @@ class ClearKeyCdm : public cdm::ContentDecryptionModule_2 {
// simultaneously.
base::Lock client_lock_;
- cdm::Host* host_;
+ CdmHost* host_;
std::string heartbeat_session_id_;
std::string next_heartbeat_message_;
diff --git a/media/cdm/ppapi/clear_key_cdm_common.h b/media/cdm/ppapi/clear_key_cdm_common.h
new file mode 100644
index 0000000..01804ac
--- /dev/null
+++ b/media/cdm/ppapi/clear_key_cdm_common.h
@@ -0,0 +1,18 @@
+// Copyright 2013 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_CLEAR_KEY_CDM_COMMON_H_
+#define MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_COMMON_H_
+
+#include "media/cdm/ppapi/api/content_decryption_module.h"
+
+namespace media {
+
+// Aliases for the version of the interfaces that this CDM implements.
+typedef cdm::ContentDecryptionModule CdmInterface;
+typedef CdmInterface::Host CdmHost;
+
+} // namespace media
+
+#endif // MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_COMMON_H_
diff --git a/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc b/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc
index 97d04e8..5bc52a8 100644
--- a/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc
+++ b/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.cc
@@ -130,7 +130,7 @@ static void CopySamples(cdm::AudioFormat cdm_format,
}
}
-FFmpegCdmAudioDecoder::FFmpegCdmAudioDecoder(cdm::Host* host)
+FFmpegCdmAudioDecoder::FFmpegCdmAudioDecoder(CdmHost* host)
: is_initialized_(false),
host_(host),
samples_per_second_(0),
@@ -354,7 +354,7 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer(
const uint32_t buffer_size = decoded_audio_size + sizeof(int64) * 2;
decoded_frames->SetFrameBuffer(host_->Allocate(buffer_size));
if (!decoded_frames->FrameBuffer()) {
- LOG(ERROR) << "DecodeBuffer() cdm::Host::Allocate failed.";
+ LOG(ERROR) << "DecodeBuffer() CdmHost::Allocate failed.";
return cdm::kDecodeError;
}
decoded_frames->FrameBuffer()->SetSize(buffer_size);
@@ -392,7 +392,7 @@ cdm::Status FFmpegCdmAudioDecoder::DecodeBuffer(
decoded_frames->SetFrameBuffer(
host_->Allocate(serialized_audio_frames_.size()));
if (!decoded_frames->FrameBuffer()) {
- LOG(ERROR) << "DecodeBuffer() cdm::Host::Allocate failed.";
+ LOG(ERROR) << "DecodeBuffer() CdmHost::Allocate failed.";
return cdm::kDecodeError;
}
memcpy(decoded_frames->FrameBuffer()->Data(),
diff --git a/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.h b/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.h
index 6e170ad..c06d347 100644
--- a/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.h
+++ b/media/cdm/ppapi/ffmpeg_cdm_audio_decoder.h
@@ -11,7 +11,7 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
-#include "media/cdm/ppapi/api/content_decryption_module.h"
+#include "media/cdm/ppapi/clear_key_cdm_common.h"
struct AVCodecContext;
struct AVFrame;
@@ -30,7 +30,7 @@ namespace media {
// http://crbug.com/169203
class FFmpegCdmAudioDecoder {
public:
- explicit FFmpegCdmAudioDecoder(cdm::Host* host);
+ explicit FFmpegCdmAudioDecoder(CdmHost* host);
~FFmpegCdmAudioDecoder();
bool Initialize(const cdm::AudioDecoderConfig& config);
void Deinitialize();
@@ -61,7 +61,7 @@ class FFmpegCdmAudioDecoder {
bool is_initialized_;
- cdm::Host* const host_;
+ CdmHost* const host_;
// FFmpeg structures owned by this object.
scoped_ptr_malloc<AVCodecContext, ScopedPtrAVFreeContext> codec_context_;
diff --git a/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc b/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc
index 515db04..66c5fb0 100644
--- a/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc
+++ b/media/cdm/ppapi/ffmpeg_cdm_video_decoder.cc
@@ -128,7 +128,7 @@ static void CopyPlane(const uint8_t* source,
}
}
-FFmpegCdmVideoDecoder::FFmpegCdmVideoDecoder(cdm::Host* host)
+FFmpegCdmVideoDecoder::FFmpegCdmVideoDecoder(CdmHost* host)
: is_initialized_(false),
host_(host) {
}
@@ -275,7 +275,7 @@ bool FFmpegCdmVideoDecoder::CopyAvFrameTo(cdm::VideoFrame* cdm_video_frame) {
DCHECK(!cdm_video_frame->FrameBuffer());
cdm_video_frame->SetFrameBuffer(host_->Allocate(space_required));
if (!cdm_video_frame->FrameBuffer()) {
- LOG(ERROR) << "CopyAvFrameTo() cdm::Host::Allocate failed.";
+ LOG(ERROR) << "CopyAvFrameTo() CdmHost::Allocate failed.";
return false;
}
cdm_video_frame->FrameBuffer()->SetSize(space_required);
diff --git a/media/cdm/ppapi/ffmpeg_cdm_video_decoder.h b/media/cdm/ppapi/ffmpeg_cdm_video_decoder.h
index 06a3967..f65e9a0 100644
--- a/media/cdm/ppapi/ffmpeg_cdm_video_decoder.h
+++ b/media/cdm/ppapi/ffmpeg_cdm_video_decoder.h
@@ -8,8 +8,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "media/cdm/ppapi/api/content_decryption_module.h"
#include "media/cdm/ppapi/cdm_video_decoder.h"
+#include "media/cdm/ppapi/clear_key_cdm_common.h"
struct AVCodecContext;
struct AVFrame;
@@ -21,7 +21,7 @@ class ScopedPtrAVFreeFrame;
class FFmpegCdmVideoDecoder : public CdmVideoDecoder {
public:
- explicit FFmpegCdmVideoDecoder(cdm::Host* host);
+ explicit FFmpegCdmVideoDecoder(CdmHost* host);
virtual ~FFmpegCdmVideoDecoder();
// CdmVideoDecoder implementation.
@@ -52,7 +52,7 @@ class FFmpegCdmVideoDecoder : public CdmVideoDecoder {
bool is_initialized_;
- cdm::Host* const host_;
+ CdmHost* const host_;
DISALLOW_COPY_AND_ASSIGN(FFmpegCdmVideoDecoder);
};
diff --git a/media/cdm/ppapi/libvpx_cdm_video_decoder.cc b/media/cdm/ppapi/libvpx_cdm_video_decoder.cc
index a81c485..cb8f19e 100644
--- a/media/cdm/ppapi/libvpx_cdm_video_decoder.cc
+++ b/media/cdm/ppapi/libvpx_cdm_video_decoder.cc
@@ -27,7 +27,7 @@ namespace media {
static const int kDecodeThreads = 2;
-LibvpxCdmVideoDecoder::LibvpxCdmVideoDecoder(cdm::Host* host)
+LibvpxCdmVideoDecoder::LibvpxCdmVideoDecoder(CdmHost* host)
: is_initialized_(false),
host_(host),
vpx_codec_(NULL),
@@ -155,7 +155,7 @@ bool LibvpxCdmVideoDecoder::CopyVpxImageTo(cdm::VideoFrame* cdm_video_frame) {
DCHECK(!cdm_video_frame->FrameBuffer());
cdm_video_frame->SetFrameBuffer(host_->Allocate(space_required));
if (!cdm_video_frame->FrameBuffer()) {
- LOG(ERROR) << "CopyVpxImageTo() cdm::Host::Allocate failed.";
+ LOG(ERROR) << "CopyVpxImageTo() CdmHost::Allocate failed.";
return false;
}
cdm_video_frame->FrameBuffer()->SetSize(space_required);
diff --git a/media/cdm/ppapi/libvpx_cdm_video_decoder.h b/media/cdm/ppapi/libvpx_cdm_video_decoder.h
index 3edaa07..d3ad264 100644
--- a/media/cdm/ppapi/libvpx_cdm_video_decoder.h
+++ b/media/cdm/ppapi/libvpx_cdm_video_decoder.h
@@ -17,7 +17,7 @@ namespace media {
class LibvpxCdmVideoDecoder : public CdmVideoDecoder {
public:
- explicit LibvpxCdmVideoDecoder(cdm::Host* host);
+ explicit LibvpxCdmVideoDecoder(CdmHost* host);
virtual ~LibvpxCdmVideoDecoder();
// CdmVideoDecoder implementation.
@@ -42,7 +42,7 @@ class LibvpxCdmVideoDecoder : public CdmVideoDecoder {
bool is_initialized_;
- cdm::Host* const host_;
+ CdmHost* const host_;
vpx_codec_ctx* vpx_codec_;
vpx_image* vpx_image_;
diff --git a/media/media_cdm.gypi b/media/media_cdm.gypi
index b62e6dd..0a594dd 100644
--- a/media/media_cdm.gypi
+++ b/media/media_cdm.gypi
@@ -83,6 +83,7 @@
'cdm/ppapi/cdm_video_decoder.h',
'cdm/ppapi/clear_key_cdm.cc',
'cdm/ppapi/clear_key_cdm.h',
+ 'cdm/ppapi/clear_key_cdm_common.h',
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [ 4267, ],