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

Unified Diff: media/test/pipeline_integration_test_base.cc

Issue 2050043002: Generate and assign media track ids in demuxers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-streamparser-trackid
Patch Set: rebase to ToT Created 4 years, 6 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/test/pipeline_integration_test.cc ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/test/pipeline_integration_test_base.cc
diff --git a/media/test/pipeline_integration_test_base.cc b/media/test/pipeline_integration_test_base.cc
index 42e3511c142709c62da8dfb436d9333888dd5288..72a47734e2059fb3a1e1a431d9a775ba75a67116 100644
--- a/media/test/pipeline_integration_test_base.cc
+++ b/media/test/pipeline_integration_test_base.cc
@@ -84,6 +84,14 @@ void PipelineIntegrationTestBase::DemuxerEncryptedMediaInitDataCB(
void PipelineIntegrationTestBase::DemuxerMediaTracksUpdatedCB(
std::unique_ptr<MediaTracks> tracks) {
CHECK(tracks);
+ CHECK_GT(tracks->tracks().size(), 0u);
+
+ // Verify that track ids are unique.
+ std::set<MediaTrack::Id> track_ids;
+ for (const auto& track : tracks->tracks()) {
+ EXPECT_EQ(track_ids.end(), track_ids.find(track->id()));
+ track_ids.insert(track->id());
+ }
}
void PipelineIntegrationTestBase::OnEnded() {
@@ -266,16 +274,14 @@ void PipelineIntegrationTestBase::CreateDemuxer(
std::unique_ptr<DataSource> data_source) {
data_source_ = std::move(data_source);
- Demuxer::MediaTracksUpdatedCB tracks_updated_cb =
- base::Bind(&PipelineIntegrationTestBase::DemuxerMediaTracksUpdatedCB,
- base::Unretained(this));
-
#if !defined(MEDIA_DISABLE_FFMPEG)
demuxer_ = std::unique_ptr<Demuxer>(new FFmpegDemuxer(
message_loop_.task_runner(), data_source_.get(),
base::Bind(&PipelineIntegrationTestBase::DemuxerEncryptedMediaInitDataCB,
base::Unretained(this)),
- tracks_updated_cb, new MediaLog()));
+ base::Bind(&PipelineIntegrationTestBase::DemuxerMediaTracksUpdatedCB,
+ base::Unretained(this)),
+ new MediaLog()));
#endif
}
« no previous file with comments | « media/test/pipeline_integration_test.cc ('k') | third_party/WebKit/Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698