OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_ |
12 #define WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_ |
13 | 13 |
14 #include <cstdint> | 14 #include <cstdint> |
15 #include <map> | 15 #include <map> |
16 #include <memory> | 16 #include <memory> |
| 17 #include <vector> |
17 | 18 |
18 #include "webrtc/modules/include/module_common_types.h" | 19 #include "webrtc/modules/include/module_common_types.h" |
19 | 20 |
20 namespace webrtc { | 21 namespace webrtc { |
21 | 22 |
22 class VCMPacket; | 23 class VCMPacket; |
23 | 24 |
24 namespace video_coding { | 25 namespace video_coding { |
25 | 26 |
26 class H264SpsPpsTracker { | 27 class H264SpsPpsTracker { |
27 public: | 28 public: |
28 enum PacketAction { kInsert, kDrop, kRequestKeyframe }; | 29 enum PacketAction { kInsert, kDrop, kRequestKeyframe }; |
29 | 30 |
30 PacketAction CopyAndFixBitstream(VCMPacket* packet); | 31 PacketAction CopyAndFixBitstream(VCMPacket* packet); |
| 32 void InsertSpsPps(const std::vector<uint8_t>& sps, |
| 33 const std::vector<uint8_t>& pps); |
31 | 34 |
32 private: | 35 private: |
33 struct PpsInfo { | 36 struct PpsInfo { |
34 int sps_id = -1; | 37 int sps_id = -1; |
35 size_t size = 0; | 38 size_t size = 0; |
36 std::unique_ptr<uint8_t[]> data; | 39 std::unique_ptr<uint8_t[]> data; |
37 }; | 40 }; |
38 | 41 |
39 struct SpsInfo { | 42 struct SpsInfo { |
40 size_t size = 0; | 43 size_t size = 0; |
41 std::unique_ptr<uint8_t[]> data; | 44 std::unique_ptr<uint8_t[]> data; |
42 }; | 45 }; |
43 | 46 |
44 std::map<uint32_t, PpsInfo> pps_data_; | 47 std::map<uint32_t, PpsInfo> pps_data_; |
45 std::map<uint32_t, SpsInfo> sps_data_; | 48 std::map<uint32_t, SpsInfo> sps_data_; |
46 }; | 49 }; |
47 | 50 |
48 } // namespace video_coding | 51 } // namespace video_coding |
49 } // namespace webrtc | 52 } // namespace webrtc |
50 | 53 |
51 #endif // WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_ | 54 #endif // WEBRTC_MODULES_VIDEO_CODING_H264_SPS_PPS_TRACKER_H_ |
OLD | NEW |