summaryrefslogtreecommitdiffstats
path: root/media/base/test_data_util.cc
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-08 05:09:27 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-08 05:09:27 +0000
commit08819ae89715143453b592abe0115ac1d3076003 (patch)
tree2f271a0ad88893d89a49703a5f6873ede8b5c073 /media/base/test_data_util.cc
parenta8076b782e9d36f69651c84d5aee2a5ae321dca7 (diff)
downloadchromium_src-08819ae89715143453b592abe0115ac1d3076003.zip
chromium_src-08819ae89715143453b592abe0115ac1d3076003.tar.gz
chromium_src-08819ae89715143453b592abe0115ac1d3076003.tar.bz2
Add AES decryptor and tests.
For now we support decryption in video only. The first encryption key ID in ContentEncodings element will be used as the decryption key ID. Also we assume decryption key is the same as key ID. BUG=117060 TEST=test page with encrypted content plays; added media_unittest Review URL: http://codereview.chromium.org/9298021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@125560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/test_data_util.cc')
-rw-r--r--media/base/test_data_util.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/media/base/test_data_util.cc b/media/base/test_data_util.cc
index 15284da..bb08175 100644
--- a/media/base/test_data_util.cc
+++ b/media/base/test_data_util.cc
@@ -7,6 +7,8 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
+#include "media/base/buffers.h"
+#include "media/base/data_buffer.h"
#include "media/ffmpeg/ffmpeg_common.h"
namespace media {
@@ -51,11 +53,19 @@ void ReadTestDataFile(const std::string& name, scoped_array<uint8>* buffer,
*size = file_size;
}
-void ReadTestDataFile(const std::string& name, scoped_refptr<Buffer>* buffer) {
+void ReadTestDataFile(const std::string& name,
+ scoped_refptr<DataBuffer>* buffer) {
scoped_array<uint8> buf;
int buf_size;
ReadTestDataFile(name, &buf, &buf_size);
*buffer = new DataBuffer(buf.Pass(), buf_size);
}
+void ReadTestDataFile(const std::string& name,
+ scoped_refptr<Buffer>* buffer) {
+ scoped_refptr<DataBuffer> data_buffer;
+ ReadTestDataFile(name, &data_buffer);
+ *buffer = data_buffer;
+}
+
} // namespace media