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 22 matching lines...) Expand all Loading... |
912 demuxer_->Stop(event.GetClosure()); | 918 demuxer_->Stop(event.GetClosure()); |
913 event.RunAndWait(); | 919 event.RunAndWait(); |
914 demuxer_.reset(); | 920 demuxer_.reset(); |
915 data_source_.reset(); | 921 data_source_.reset(); |
916 } | 922 } |
917 } | 923 } |
918 | 924 |
919 #endif | 925 #endif |
920 | 926 |
921 } // namespace media | 927 } // namespace media |
OLD | NEW |