| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <deque> | 6 #include <deque> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 DemuxerStream::Status status, | 868 DemuxerStream::Status status, |
| 869 const scoped_refptr<DecoderBuffer>& buffer) { | 869 const scoped_refptr<DecoderBuffer>& buffer) { |
| 870 EXPECT_EQ(status, DemuxerStream::kOk); | 870 EXPECT_EQ(status, DemuxerStream::kOk); |
| 871 | 871 |
| 872 if (buffer->end_of_stream()) { | 872 if (buffer->end_of_stream()) { |
| 873 base::MessageLoop::current()->PostTask( | 873 base::MessageLoop::current()->PostTask( |
| 874 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 874 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
| 875 return; | 875 return; |
| 876 } | 876 } |
| 877 | 877 |
| 878 std::vector<SubsampleEntry> subsamples; |
| 879 |
| 880 if (buffer->decrypt_config()) |
| 881 subsamples = buffer->decrypt_config()->subsamples(); |
| 882 |
| 878 bool is_valid = | 883 bool is_valid = |
| 879 mp4::AVC::IsValidAnnexB(buffer->data(), buffer->data_size()); | 884 mp4::AVC::IsValidAnnexB(buffer->data(), buffer->data_size(), |
| 885 subsamples); |
| 880 EXPECT_TRUE(is_valid); | 886 EXPECT_TRUE(is_valid); |
| 881 | 887 |
| 882 if (!is_valid) { | 888 if (!is_valid) { |
| 883 LOG(ERROR) << "Buffer contains invalid Annex B data."; | 889 LOG(ERROR) << "Buffer contains invalid Annex B data."; |
| 884 base::MessageLoop::current()->PostTask( | 890 base::MessageLoop::current()->PostTask( |
| 885 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | 891 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); |
| 886 return; | 892 return; |
| 887 } | 893 } |
| 888 | 894 |
| 889 stream->Read(base::Bind(&ValidateAnnexB, stream)); | 895 stream->Read(base::Bind(&ValidateAnnexB, stream)); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 InitializeDemuxer(); | 954 InitializeDemuxer(); |
| 949 | 955 |
| 950 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); | 956 DemuxerStream* stream = demuxer_->GetStream(DemuxerStream::VIDEO); |
| 951 ASSERT_TRUE(stream); | 957 ASSERT_TRUE(stream); |
| 952 ASSERT_EQ(VIDEO_ROTATION_270, stream->video_rotation()); | 958 ASSERT_EQ(VIDEO_ROTATION_270, stream->video_rotation()); |
| 953 } | 959 } |
| 954 | 960 |
| 955 #endif | 961 #endif |
| 956 | 962 |
| 957 } // namespace media | 963 } // namespace media |
| OLD | NEW |