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

Side by Side Diff: media/formats/mp4/avc.h

Issue 379983002: Fix AnnexB validation logic to work with encrypted content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address CR comment Created 6 years, 4 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/h264_parser.cc ('k') | media/formats/mp4/avc.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 #ifndef MEDIA_FORMATS_MP4_AVC_H_ 5 #ifndef MEDIA_FORMATS_MP4_AVC_H_
6 #define MEDIA_FORMATS_MP4_AVC_H_ 6 #define MEDIA_FORMATS_MP4_AVC_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 21 matching lines...) Expand all
32 std::vector<uint8>* buffer, 32 std::vector<uint8>* buffer,
33 std::vector<SubsampleEntry>* subsamples); 33 std::vector<SubsampleEntry>* subsamples);
34 34
35 static bool ConvertConfigToAnnexB( 35 static bool ConvertConfigToAnnexB(
36 const AVCDecoderConfigurationRecord& avc_config, 36 const AVCDecoderConfigurationRecord& avc_config,
37 std::vector<uint8>* buffer, 37 std::vector<uint8>* buffer,
38 std::vector<SubsampleEntry>* subsamples); 38 std::vector<SubsampleEntry>* subsamples);
39 39
40 // Verifies that the contents of |buffer| conform to 40 // Verifies that the contents of |buffer| conform to
41 // Section 7.4.1.2.3 of ISO/IEC 14496-10. 41 // Section 7.4.1.2.3 of ISO/IEC 14496-10.
42 // |subsamples| contains the information about what parts of the buffer are
43 // encrypted and which parts are clear.
42 // Returns true if |buffer| contains conformant Annex B data 44 // Returns true if |buffer| contains conformant Annex B data
43 // TODO(acolwell): Remove the std::vector version when we can use, 45 // TODO(acolwell): Remove the std::vector version when we can use,
44 // C++11's std::vector<T>::data() method. 46 // C++11's std::vector<T>::data() method.
45 static bool IsValidAnnexB(const std::vector<uint8>& buffer); 47 static bool IsValidAnnexB(const std::vector<uint8>& buffer,
46 static bool IsValidAnnexB(const uint8* buffer, size_t size); 48 const std::vector<SubsampleEntry>& subsamples);
49 static bool IsValidAnnexB(const uint8* buffer, size_t size,
50 const std::vector<SubsampleEntry>& subsamples);
47 }; 51 };
48 52
49 } // namespace mp4 53 } // namespace mp4
50 } // namespace media 54 } // namespace media
51 55
52 #endif // MEDIA_FORMATS_MP4_AVC_H_ 56 #endif // MEDIA_FORMATS_MP4_AVC_H_
OLDNEW
« no previous file with comments | « media/filters/h264_parser.cc ('k') | media/formats/mp4/avc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698