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

Unified Diff: media/filters/pipeline_integration_test_base.cc

Issue 10829470: Support for parsing encrypted WebM streams by src. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tool player_x11 Created 7 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
« no previous file with comments | « media/filters/pipeline_integration_test_base.h ('k') | media/media.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/pipeline_integration_test_base.cc
diff --git a/media/filters/pipeline_integration_test_base.cc b/media/filters/pipeline_integration_test_base.cc
index c43cc9296c83c1beacd5094b5b31591041aae55d..ed47c41c1933fddf786f39b500df7ca949486a9c 100644
--- a/media/filters/pipeline_integration_test_base.cc
+++ b/media/filters/pipeline_integration_test_base.cc
@@ -59,6 +59,16 @@ PipelineStatusCB PipelineIntegrationTestBase::QuitOnStatusCB(
expected_status);
}
+void PipelineIntegrationTestBase::DemuxerNeedKeyCB(
+ const std::string& type,
+ scoped_array<uint8> init_data,
+ int init_data_size) {
+ DCHECK(init_data.get());
+ DCHECK_GT(init_data_size, 0);
+ CHECK(!need_key_cb_.is_null());
+ need_key_cb_.Run("", "", type, init_data.Pass(), init_data_size);
+}
+
void PipelineIntegrationTestBase::OnEnded() {
DCHECK(!ended_);
ended_ = true;
@@ -94,7 +104,7 @@ bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path,
EXPECT_CALL(*this, OnBufferingState(Pipeline::kPrerollCompleted))
.Times(AtMost(1));
pipeline_->Start(
- CreateFilterCollection(file_path),
+ CreateFilterCollection(file_path, NULL),
base::Bind(&PipelineIntegrationTestBase::OnEnded, base::Unretained(this)),
base::Bind(&PipelineIntegrationTestBase::OnError, base::Unretained(this)),
QuitOnStatusCB(expected_status),
@@ -113,12 +123,17 @@ bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path,
}
bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path) {
+ return Start(file_path, NULL);
+}
+
+bool PipelineIntegrationTestBase::Start(const base::FilePath& file_path,
+ Decryptor* decryptor) {
EXPECT_CALL(*this, OnBufferingState(Pipeline::kHaveMetadata))
.Times(AtMost(1));
EXPECT_CALL(*this, OnBufferingState(Pipeline::kPrerollCompleted))
.Times(AtMost(1));
pipeline_->Start(
- CreateFilterCollection(file_path),
+ CreateFilterCollection(file_path, decryptor),
base::Bind(&PipelineIntegrationTestBase::OnEnded, base::Unretained(this)),
base::Bind(&PipelineIntegrationTestBase::OnError, base::Unretained(this)),
base::Bind(&PipelineIntegrationTestBase::OnStatusCallback,
@@ -186,12 +201,18 @@ bool PipelineIntegrationTestBase::WaitUntilCurrentTimeIsAfter(
scoped_ptr<FilterCollection>
PipelineIntegrationTestBase::CreateFilterCollection(
- const base::FilePath& file_path) {
+ const base::FilePath& file_path,
+ Decryptor* decryptor) {
scoped_refptr<FileDataSource> data_source = new FileDataSource();
CHECK(data_source->Initialize(file_path));
+ media::FFmpegNeedKeyCB need_key_cb =
+ base::Bind(&PipelineIntegrationTestBase::DemuxerNeedKeyCB,
+ base::Unretained(this));
return CreateFilterCollection(
- new FFmpegDemuxer(message_loop_.message_loop_proxy(), data_source),
- NULL);
+ new FFmpegDemuxer(message_loop_.message_loop_proxy(),
+ data_source,
+ need_key_cb),
+ decryptor);
}
scoped_ptr<FilterCollection>
« no previous file with comments | « media/filters/pipeline_integration_test_base.h ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698