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