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

Side by Side Diff: media/filters/h265_parser_unittest.cc

Issue 816353010: Implemented HEVC video demuxing and parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved back h265_parser_unittest.cc in media/BUILD.gn Created 5 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
« no previous file with comments | « media/filters/h265_parser.cc ('k') | media/filters/stream_parser_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/files/memory_mapped_file.h"
6 #include "base/logging.h"
7 #include "media/base/test_data_util.h"
8 #include "media/filters/h265_parser.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace media {
12
13 TEST(H265ParserTest, RawHevcStreamFileParsing) {
14 base::FilePath file_path = GetTestDataFilePath("bear.hevc");
15 // Number of NALUs in the test stream to be parsed.
16 const int num_nalus = 35;
17
18 base::MemoryMappedFile stream;
19 ASSERT_TRUE(stream.Initialize(file_path))
20 << "Couldn't open stream file: " << file_path.MaybeAsASCII();
21
22 H265Parser parser;
23 parser.SetStream(stream.data(), stream.length());
24
25 // Parse until the end of stream/unsupported stream/error in stream is found.
26 int num_parsed_nalus = 0;
27 while (true) {
28 H265NALU nalu;
29 H265Parser::Result res = parser.AdvanceToNextNALU(&nalu);
30 if (res == H265Parser::kEOStream) {
31 DVLOG(1) << "Number of successfully parsed NALUs before EOS: "
32 << num_parsed_nalus;
33 ASSERT_EQ(num_nalus, num_parsed_nalus);
34 return;
35 }
36 ASSERT_EQ(res, H265Parser::kOk);
37
38 ++num_parsed_nalus;
39 DVLOG(4) << "Found NALU " << nalu.nal_unit_type;
40 }
41 }
42
43 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/h265_parser.cc ('k') | media/filters/stream_parser_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698