OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 size_t* bytes_to_send, | 43 size_t* bytes_to_send, |
44 bool* last_packet) = 0; | 44 bool* last_packet) = 0; |
45 | 45 |
46 virtual ProtectionType GetProtectionType() = 0; | 46 virtual ProtectionType GetProtectionType() = 0; |
47 | 47 |
48 virtual StorageType GetStorageType(uint32_t retransmission_settings) = 0; | 48 virtual StorageType GetStorageType(uint32_t retransmission_settings) = 0; |
49 | 49 |
50 virtual std::string ToString() = 0; | 50 virtual std::string ToString() = 0; |
51 }; | 51 }; |
52 | 52 |
| 53 // TODO(sprang): Update the depacketizer to return a std::unqie_ptr with a copy |
| 54 // of the parsed payload, rather than just a pointer into the incoming buffer. |
| 55 // This way we can move some parsing out from the jitter buffer into here, and |
| 56 // the jitter buffer can just store that pointer rather than doing a copy there. |
53 class RtpDepacketizer { | 57 class RtpDepacketizer { |
54 public: | 58 public: |
55 struct ParsedPayload { | 59 struct ParsedPayload { |
56 const uint8_t* payload; | 60 const uint8_t* payload; |
57 size_t payload_length; | 61 size_t payload_length; |
58 FrameType frame_type; | 62 FrameType frame_type; |
59 RTPTypeHeader type; | 63 RTPTypeHeader type; |
60 }; | 64 }; |
61 | 65 |
62 static RtpDepacketizer* Create(RtpVideoCodecTypes type); | 66 static RtpDepacketizer* Create(RtpVideoCodecTypes type); |
63 | 67 |
64 virtual ~RtpDepacketizer() {} | 68 virtual ~RtpDepacketizer() {} |
65 | 69 |
66 // Parses the RTP payload, parsed result will be saved in |parsed_payload|. | 70 // Parses the RTP payload, parsed result will be saved in |parsed_payload|. |
67 virtual bool Parse(ParsedPayload* parsed_payload, | 71 virtual bool Parse(ParsedPayload* parsed_payload, |
68 const uint8_t* payload_data, | 72 const uint8_t* payload_data, |
69 size_t payload_data_length) = 0; | 73 size_t payload_data_length) = 0; |
70 }; | 74 }; |
71 } // namespace webrtc | 75 } // namespace webrtc |
72 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_H_ | 76 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_H_ |
OLD | NEW |