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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h

Issue 2871173008: Fix packetization logic to leave space for extensions in the last packet (Closed)
Patch Set: Implemented Danilchap@ comments Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h b/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h
index 118166fbf3089bd9b507f0145e20ab49034373a0..10930fa83f06c9b271e0e82582142c43c700f5b3 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.h
@@ -27,20 +27,21 @@ class RtpPacketizerGeneric : public RtpPacketizer {
public:
// Initialize with payload from encoder.
// The payload_data must be exactly one encoded generic frame.
- RtpPacketizerGeneric(FrameType frametype, size_t max_payload_len);
+ RtpPacketizerGeneric(FrameType frametype,
+ size_t max_payload_len,
+ size_t last_packet_extension_len);
virtual ~RtpPacketizerGeneric();
- void SetPayloadData(const uint8_t* payload_data,
- size_t payload_size,
- const RTPFragmentationHeader* fragmentation) override;
+ // Returns total number of packets to be generated.
+ size_t SetPayloadData(const uint8_t* payload_data,
+ size_t payload_size,
+ const RTPFragmentationHeader* fragmentation) override;
// Get the next payload with generic payload header.
// Write payload and set marker bit of the |packet|.
- // The parameter |last_packet| is true for the last packet of the frame, false
- // otherwise (i.e., call the function again to get the next packet).
// Returns true on success, false otherwise.
- bool NextPacket(RtpPacketToSend* packet, bool* last_packet) override;
+ bool NextPacket(RtpPacketToSend* packet) override;
ProtectionType GetProtectionType() override;
@@ -52,9 +53,12 @@ class RtpPacketizerGeneric : public RtpPacketizer {
const uint8_t* payload_data_;
size_t payload_size_;
const size_t max_payload_len_;
+ const size_t last_packet_extension_len_;
FrameType frame_type_;
- size_t payload_length_;
+ size_t payload_per_packet_;
danilchap 2017/05/12 13:56:10 payload_length_per_packet_?
ilnik 2017/05/12 14:46:08 Done.
uint8_t generic_header_;
+ size_t num_packets_;
danilchap 2017/05/12 13:56:10 Likely this member deserve a comment: it is not ob
ilnik 2017/05/12 14:46:08 Changed to num_packets_left_. Now it's clear that
+ size_t smaller_packets_;
danilchap 2017/05/12 13:56:10 can you add comment what this member is for? https
ilnik 2017/05/12 14:46:08 Done.
RTC_DISALLOW_COPY_AND_ASSIGN(RtpPacketizerGeneric);
};

Powered by Google App Engine
This is Rietveld 408576698