Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h

Issue 2522553002: RtpPacketizer::NextPacket fills RtpPacket instead of payload. (Closed)
Patch Set: Named kTheMagicSix Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VIDEO_GENERIC_H_ 10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VIDEO_GENERIC_H_
(...skipping 18 matching lines...) Expand all
29 // The payload_data must be exactly one encoded generic frame. 29 // The payload_data must be exactly one encoded generic frame.
30 RtpPacketizerGeneric(FrameType frametype, size_t max_payload_len); 30 RtpPacketizerGeneric(FrameType frametype, size_t max_payload_len);
31 31
32 virtual ~RtpPacketizerGeneric(); 32 virtual ~RtpPacketizerGeneric();
33 33
34 void SetPayloadData(const uint8_t* payload_data, 34 void SetPayloadData(const uint8_t* payload_data,
35 size_t payload_size, 35 size_t payload_size,
36 const RTPFragmentationHeader* fragmentation) override; 36 const RTPFragmentationHeader* fragmentation) override;
37 37
38 // Get the next payload with generic payload header. 38 // Get the next payload with generic payload header.
39 // buffer is a pointer to where the output will be written. 39 // Write payload and set marker bit of the |packet|.
40 // bytes_to_send is an output variable that will contain number of bytes 40 // The parameter |last_packet| is true for the last packet of the frame, false
41 // written to buffer. The parameter last_packet is true for the last packet of 41 // otherwise (i.e., call the function again to get the next packet).
42 // the frame, false otherwise (i.e., call the function again to get the 42 // Returns true on success, false otherwise.
43 // next packet). 43 bool NextPacket(RtpPacketToSend* packet, bool* last_packet) override;
44 // Returns true on success or false if there was no payload to packetize.
45 bool NextPacket(uint8_t* buffer,
46 size_t* bytes_to_send,
47 bool* last_packet) override;
48 44
49 ProtectionType GetProtectionType() override; 45 ProtectionType GetProtectionType() override;
50 46
51 StorageType GetStorageType(uint32_t retransmission_settings) override; 47 StorageType GetStorageType(uint32_t retransmission_settings) override;
52 48
53 std::string ToString() override; 49 std::string ToString() override;
54 50
55 private: 51 private:
56 const uint8_t* payload_data_; 52 const uint8_t* payload_data_;
57 size_t payload_size_; 53 size_t payload_size_;
58 const size_t max_payload_len_; 54 const size_t max_payload_len_;
59 FrameType frame_type_; 55 FrameType frame_type_;
60 size_t payload_length_; 56 size_t payload_length_;
61 uint8_t generic_header_; 57 uint8_t generic_header_;
62 58
63 RTC_DISALLOW_COPY_AND_ASSIGN(RtpPacketizerGeneric); 59 RTC_DISALLOW_COPY_AND_ASSIGN(RtpPacketizerGeneric);
64 }; 60 };
65 61
66 // Depacketizer for generic codec. 62 // Depacketizer for generic codec.
67 class RtpDepacketizerGeneric : public RtpDepacketizer { 63 class RtpDepacketizerGeneric : public RtpDepacketizer {
68 public: 64 public:
69 virtual ~RtpDepacketizerGeneric() {} 65 virtual ~RtpDepacketizerGeneric() {}
70 66
71 bool Parse(ParsedPayload* parsed_payload, 67 bool Parse(ParsedPayload* parsed_payload,
72 const uint8_t* payload_data, 68 const uint8_t* payload_data,
73 size_t payload_data_length) override; 69 size_t payload_data_length) override;
74 }; 70 };
75 } // namespace webrtc 71 } // namespace webrtc
76 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VIDEO_GENERIC_H_ 72 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VIDEO_GENERIC_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698