OLD | NEW |
(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 #ifndef MEDIA_FORMATS_MP4_HEVC_H_ |
| 6 #define MEDIA_FORMATS_MP4_HEVC_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "media/base/media_export.h" |
| 12 |
| 13 namespace media { |
| 14 |
| 15 struct SubsampleEntry; |
| 16 |
| 17 namespace mp4 { |
| 18 |
| 19 struct HEVCDecoderConfigurationRecord; |
| 20 |
| 21 class MEDIA_EXPORT HEVC { |
| 22 public: |
| 23 static bool ConvertConfigToAnnexB( |
| 24 const HEVCDecoderConfigurationRecord& hevc_config, |
| 25 std::vector<uint8>* buffer); |
| 26 |
| 27 static bool InsertParamSetsAnnexB( |
| 28 const HEVCDecoderConfigurationRecord& hevc_config, |
| 29 std::vector<uint8>* buffer, |
| 30 std::vector<SubsampleEntry>* subsamples); |
| 31 |
| 32 // Verifies that the contents of |buffer| conform to |
| 33 // Section 7.4.2.4.4 of ISO/IEC 23008-2. |
| 34 // |subsamples| contains the information about what parts of the buffer are |
| 35 // encrypted and which parts are clear. |
| 36 // Returns true if |buffer| contains conformant Annex B data |
| 37 // TODO(servolk): Remove the std::vector version when we can use, |
| 38 // C++11's std::vector<T>::data() method. |
| 39 static bool IsValidAnnexB(const std::vector<uint8>& buffer, |
| 40 const std::vector<SubsampleEntry>& subsamples); |
| 41 static bool IsValidAnnexB(const uint8* buffer, size_t size, |
| 42 const std::vector<SubsampleEntry>& subsamples); |
| 43 }; |
| 44 |
| 45 } // namespace mp4 |
| 46 } // namespace media |
| 47 |
| 48 #endif // MEDIA_FORMATS_MP4_HEVC_H_ |
OLD | NEW |