OLD | NEW |
---|---|
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" |
11 #include "base/memory/scoped_ptr.h" | |
11 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
13 #include "media/formats/mp4/bitstream_converter.h" | |
12 | 14 |
13 namespace media { | 15 namespace media { |
14 | 16 |
15 struct SubsampleEntry; | 17 struct SubsampleEntry; |
16 | 18 |
17 namespace mp4 { | 19 namespace mp4 { |
18 | 20 |
19 struct AVCDecoderConfigurationRecord; | 21 struct AVCDecoderConfigurationRecord; |
20 | 22 |
21 class MEDIA_EXPORT AVC { | 23 class MEDIA_EXPORT AVC { |
(...skipping 28 matching lines...) Expand all Loading... | |
50 static bool IsValidAnnexB(const uint8* buffer, size_t size, | 52 static bool IsValidAnnexB(const uint8* buffer, size_t size, |
51 const std::vector<SubsampleEntry>& subsamples); | 53 const std::vector<SubsampleEntry>& subsamples); |
52 | 54 |
53 // Given a |buffer| and |subsamples| information and |pts| pointer into the | 55 // Given a |buffer| and |subsamples| information and |pts| pointer into the |
54 // |buffer| finds the index of the subsample |ptr| is pointing into. | 56 // |buffer| finds the index of the subsample |ptr| is pointing into. |
55 static int FindSubsampleIndex(const std::vector<uint8>& buffer, | 57 static int FindSubsampleIndex(const std::vector<uint8>& buffer, |
56 const std::vector<SubsampleEntry>* subsamples, | 58 const std::vector<SubsampleEntry>* subsamples, |
57 const uint8* ptr); | 59 const uint8* ptr); |
58 }; | 60 }; |
59 | 61 |
62 class AVCBitstreamConverter : public BitstreamConverter { | |
sandersd (OOO until July 31)
2015/08/17 18:24:07
Comment exact what this converts to/from.
servolk
2015/08/17 22:06:24
Done.
| |
63 public: | |
64 explicit AVCBitstreamConverter( | |
65 scoped_ptr<AVCDecoderConfigurationRecord> avc_config); | |
66 | |
67 // BitstreamConverter interface | |
68 bool ConvertFrame(std::vector<uint8>* frame_buf, | |
69 bool is_keyframe, | |
70 std::vector<SubsampleEntry>* subsamples) const override; | |
71 private: | |
72 ~AVCBitstreamConverter() override; | |
73 scoped_ptr<AVCDecoderConfigurationRecord> avc_config_; | |
74 }; | |
75 | |
60 } // namespace mp4 | 76 } // namespace mp4 |
61 } // namespace media | 77 } // namespace media |
62 | 78 |
63 #endif // MEDIA_FORMATS_MP4_AVC_H_ | 79 #endif // MEDIA_FORMATS_MP4_AVC_H_ |
OLD | NEW |