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

Side by Side Diff: media/formats/mp2t/mp2t_stream_parser_unittest.cc

Issue 254473006: Add media::StreamParser::StreamParameter struct. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/formats/mp2t/mp2t_stream_parser.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 size_t append_size = std::min(piece_size, 51 size_t append_size = std::min(piece_size,
52 static_cast<size_t>(end - start)); 52 static_cast<size_t>(end - start));
53 if (!AppendData(start, append_size)) 53 if (!AppendData(start, append_size))
54 return false; 54 return false;
55 start += append_size; 55 start += append_size;
56 } 56 }
57 return true; 57 return true;
58 } 58 }
59 59
60 void OnInit(bool init_ok, 60 void OnInit(bool init_ok,
61 base::TimeDelta duration, 61 const StreamParser::InitParameters& params) {
62 base::Time wallclock_timeline_offset,
63 bool auto_update_timestamp_offset) {
64 DVLOG(1) << "OnInit: ok=" << init_ok 62 DVLOG(1) << "OnInit: ok=" << init_ok
65 << ", dur=" << duration.InMilliseconds() 63 << ", dur=" << params.duration.InMilliseconds()
66 << ", autoTimestampOffset=" << auto_update_timestamp_offset; 64 << ", autoTimestampOffset=" << params.auto_update_timestamp_offset;
67 } 65 }
68 66
69 bool OnNewConfig(const AudioDecoderConfig& ac, 67 bool OnNewConfig(const AudioDecoderConfig& ac,
70 const VideoDecoderConfig& vc, 68 const VideoDecoderConfig& vc,
71 const StreamParser::TextTrackConfigMap& tc) { 69 const StreamParser::TextTrackConfigMap& tc) {
72 DVLOG(1) << "OnNewConfig: audio=" << ac.IsValidConfig() 70 DVLOG(1) << "OnNewConfig: audio=" << ac.IsValidConfig()
73 << ", video=" << vc.IsValidConfig(); 71 << ", video=" << vc.IsValidConfig();
74 return true; 72 return true;
75 } 73 }
76 74
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // (close to 2^33 / 90000) which results in timestamps wrap around 177 // (close to 2^33 / 90000) which results in timestamps wrap around
180 // in the Mpeg2 TS stream. 178 // in the Mpeg2 TS stream.
181 ParseMpeg2TsFile("bear-1280x720_ptswraparound.ts", 512); 179 ParseMpeg2TsFile("bear-1280x720_ptswraparound.ts", 512);
182 EXPECT_EQ(video_frame_count_, 81); 180 EXPECT_EQ(video_frame_count_, 81);
183 EXPECT_GE(video_min_dts_, base::TimeDelta::FromSeconds(95443 - 10)); 181 EXPECT_GE(video_min_dts_, base::TimeDelta::FromSeconds(95443 - 10));
184 EXPECT_LE(video_max_dts_, base::TimeDelta::FromSeconds(95443 + 10)); 182 EXPECT_LE(video_max_dts_, base::TimeDelta::FromSeconds(95443 + 10));
185 } 183 }
186 184
187 } // namespace mp2t 185 } // namespace mp2t
188 } // namespace media 186 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp2t/mp2t_stream_parser.cc ('k') | media/formats/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698