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

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

Issue 506943003: Support MPEG1 audio in the MPEG2-TS stream parser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments from patch set #5. Created 6 years, 3 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/es_parser_test_base.h ('k') | media/formats/mp2t/mp2t_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 "media/formats/mp2t/es_parser_test_base.h" 5 #include "media/formats/mp2t/es_parser_test_base.h"
6 6
7 #include "base/files/memory_mapped_file.h" 7 #include "base/files/memory_mapped_file.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 for (size_t k = 0; k < packets->size() - 1; k++) { 97 for (size_t k = 0; k < packets->size() - 1; k++) {
98 Packet* next = &(*packets)[k + 1]; 98 Packet* next = &(*packets)[k + 1];
99 DCHECK_GE(next->offset, cur->offset); 99 DCHECK_GE(next->offset, cur->offset);
100 cur->size = next->offset - cur->offset; 100 cur->size = next->offset - cur->offset;
101 cur = next; 101 cur = next;
102 } 102 }
103 DCHECK_GE(stream_.size(), cur->offset); 103 DCHECK_GE(stream_.size(), cur->offset);
104 cur->size = stream_.size() - cur->offset; 104 cur->size = stream_.size() - cur->offset;
105 } 105 }
106 106
107 std::vector<EsParserTestBase::Packet>
108 EsParserTestBase::GenerateFixedSizePesPacket(size_t pes_size) {
109 DCHECK_GT(stream_.size(), 0u);
110 std::vector<Packet> pes_packets;
111
112 Packet cur_pes_packet;
113 cur_pes_packet.offset = 0;
114 cur_pes_packet.pts = kNoTimestamp();
115 while (cur_pes_packet.offset < stream_.size()) {
116 pes_packets.push_back(cur_pes_packet);
117 cur_pes_packet.offset += pes_size;
118 }
119 ComputePacketSize(&pes_packets);
120
121 return pes_packets;
122 }
123
107 } // namespace mp2t 124 } // namespace mp2t
108 } // namespace media 125 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp2t/es_parser_test_base.h ('k') | media/formats/mp2t/mp2t_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698