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

Unified Diff: media/formats/mp2t/mp2t_stream_parser_unittest.cc

Issue 2239013002: Assign correct track ids to buffers emitted from StreamParsers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/formats/mp2t/mp2t_common.h ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp2t/mp2t_stream_parser_unittest.cc
diff --git a/media/formats/mp2t/mp2t_stream_parser_unittest.cc b/media/formats/mp2t/mp2t_stream_parser_unittest.cc
index 6c76023cc016ae011c28a1f5d36377fbde52cad1..5a8e2a0c545c8f05492530d8b82051eb1b7e1aeb 100644
--- a/media/formats/mp2t/mp2t_stream_parser_unittest.cc
+++ b/media/formats/mp2t/mp2t_stream_parser_unittest.cc
@@ -80,6 +80,8 @@ class Mp2tStreamParserTest : public testing::Test {
DecodeTimestamp audio_max_dts_;
DecodeTimestamp video_min_dts_;
DecodeTimestamp video_max_dts_;
+ StreamParser::TrackId audio_track_id_;
+ StreamParser::TrackId video_track_id_;
void ResetStats() {
segment_count_ = 0;
@@ -124,9 +126,11 @@ class Mp2tStreamParserTest : public testing::Test {
for (const auto& track : tracks->tracks()) {
const auto& track_id = track->bytestream_track_id();
if (track->type() == MediaTrack::Audio) {
+ audio_track_id_ = track_id;
found_audio_track = true;
EXPECT_TRUE(tracks->getAudioConfig(track_id).IsValidConfig());
} else if (track->type() == MediaTrack::Video) {
+ video_track_id_ = track_id;
found_video_track = true;
EXPECT_TRUE(tracks->getVideoConfig(track_id).IsValidConfig());
} else {
@@ -160,6 +164,14 @@ class Mp2tStreamParserTest : public testing::Test {
DumpBuffers("audio_buffers", audio_buffers);
DumpBuffers("video_buffers", video_buffers);
+ // Ensure that track ids are properly assigned on all emitted buffers.
+ for (const auto& buf : audio_buffers) {
+ EXPECT_EQ(audio_track_id_, buf->track_id());
+ }
+ for (const auto& buf : video_buffers) {
+ EXPECT_EQ(video_track_id_, buf->track_id());
+ }
+
// TODO(wolenetz/acolwell): Add text track support to more MSE parsers. See
// http://crbug.com/336926.
if (!text_map.empty())
« no previous file with comments | « media/formats/mp2t/mp2t_common.h ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698