OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 // The payload_data must be exactly one encoded VP8 frame. | 58 // The payload_data must be exactly one encoded VP8 frame. |
59 RtpPacketizerVp8(const RTPVideoHeaderVP8& hdr_info, size_t max_payload_len); | 59 RtpPacketizerVp8(const RTPVideoHeaderVP8& hdr_info, size_t max_payload_len); |
60 | 60 |
61 virtual ~RtpPacketizerVp8(); | 61 virtual ~RtpPacketizerVp8(); |
62 | 62 |
63 void SetPayloadData(const uint8_t* payload_data, | 63 void SetPayloadData(const uint8_t* payload_data, |
64 size_t payload_size, | 64 size_t payload_size, |
65 const RTPFragmentationHeader* fragmentation) override; | 65 const RTPFragmentationHeader* fragmentation) override; |
66 | 66 |
67 // Get the next payload with VP8 payload header. | 67 // Get the next payload with VP8 payload header. |
68 // max_payload_len limits the sum length of payload and VP8 payload header. | 68 // Write payload and set marker bit of the |packet|. |
69 // buffer is a pointer to where the output will be written. | 69 // The parameter |last_packet| is true for the last packet of the frame, false |
70 // bytes_to_send is an output variable that will contain number of bytes | 70 // otherwise (i.e., call the function again to get the next packet). |
71 // written to buffer. Parameter last_packet is true for the last packet of | 71 // Returns true on success, false otherwise. |
72 // the frame, false otherwise (i.e., call the function again to get the | 72 bool NextPacket(RtpPacketToSend* packet, bool* last_packet) override; |
73 // next packet). | |
74 // For the kStrict and kAggregate mode: returns the partition index from which | |
75 // the first payload byte in the packet is taken, with the first partition | |
76 // having index 0; returns negative on error. | |
77 // For the kEqualSize mode: returns 0 on success, return negative on error. | |
78 bool NextPacket(uint8_t* buffer, | |
79 size_t* bytes_to_send, | |
80 bool* last_packet) override; | |
81 | 73 |
82 ProtectionType GetProtectionType() override; | 74 ProtectionType GetProtectionType() override; |
83 | 75 |
84 StorageType GetStorageType(uint32_t retransmission_settings) override; | 76 StorageType GetStorageType(uint32_t retransmission_settings) override; |
85 | 77 |
86 std::string ToString() override; | 78 std::string ToString() override; |
87 | 79 |
88 private: | 80 private: |
89 typedef struct { | 81 typedef struct { |
90 size_t payload_start_pos; | 82 size_t payload_start_pos; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 class RtpDepacketizerVp8 : public RtpDepacketizer { | 211 class RtpDepacketizerVp8 : public RtpDepacketizer { |
220 public: | 212 public: |
221 virtual ~RtpDepacketizerVp8() {} | 213 virtual ~RtpDepacketizerVp8() {} |
222 | 214 |
223 bool Parse(ParsedPayload* parsed_payload, | 215 bool Parse(ParsedPayload* parsed_payload, |
224 const uint8_t* payload_data, | 216 const uint8_t* payload_data, |
225 size_t payload_data_length) override; | 217 size_t payload_data_length) override; |
226 }; | 218 }; |
227 } // namespace webrtc | 219 } // namespace webrtc |
228 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VP8_H_ | 220 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VP8_H_ |
OLD | NEW |