Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_COMMON_GPU_MEDIA_AVC_CONFIG_RECORD_BUILDER_H_ | |
| 6 #define CONTENT_COMMON_GPU_MEDIA_AVC_CONFIG_RECORD_BUILDER_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/memory/ref_counted.h" | |
|
Ami GONE FROM CHROMIUM
2012/05/23 19:41:19
unnecessary?
sail
2012/05/28 21:45:46
used for scoped_refptr
| |
| 11 #include "base/memory/ref_counted_memory.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 struct H264NALU; | |
| 16 class H264Parser; | |
| 17 | |
| 18 // Utility class to build an AVC configuration record given a stream of NALUs | |
| 19 // containing SPS and PPS data. | |
| 20 class AVCConfigRecordBuilder { | |
| 21 public: | |
| 22 AVCConfigRecordBuilder(); | |
| 23 ~AVCConfigRecordBuilder(); | |
| 24 | |
| 25 // Processes the given NALU. Returns true on success, false on failure. | |
| 26 bool ProcessNextNALU(H264Parser* parser, | |
| 27 const H264NALU* nalu, | |
| 28 bool* did_consume_nalu); | |
| 29 | |
| 30 // Builds the AVC decoder configuration record. | |
| 31 std::vector<uint8_t> BuildConfigRecord(); | |
| 32 | |
| 33 bool can_build_record() const { return can_build_record_; } | |
| 34 int coded_width() const { return coded_width_; } | |
| 35 int coded_height() const { return coded_height_; } | |
| 36 | |
| 37 private: | |
| 38 bool ProcessSPS(H264Parser* parser, const H264NALU* nalu); | |
| 39 bool ProcessPPS(H264Parser* parser, const H264NALU* nalu); | |
| 40 | |
| 41 typedef std::vector<scoped_refptr<base::RefCountedBytes> > NALUVector; | |
| 42 // Data for each SPS. | |
| 43 NALUVector sps_nalus_; | |
| 44 // Data for each PPS. | |
| 45 NALUVector pps_nalus_; | |
| 46 // The video codec profile stored in the SPS. | |
| 47 int sps_profile_idc_; | |
| 48 // The constraint setx flags stored in the SPS. | |
| 49 int sps_constraint_setx_flag_; | |
| 50 // The avc level stored in the SPS. | |
| 51 int sps_level_idc_; | |
| 52 // The width of the video as enocded in the SPS. | |
| 53 uint32_t coded_width_; | |
| 54 // The height of the video as enocded in the SPS. | |
| 55 uint32_t coded_height_; | |
| 56 // Flag to check if the AVC configuration record can be built. | |
| 57 bool can_build_record_; | |
| 58 }; | |
| 59 | |
| 60 } // namespace content | |
| 61 | |
| 62 #endif // CONTENT_COMMON_GPU_MEDIA_AVC_CONFIG_RECORD_BUILDER_H_ | |
| OLD | NEW |