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

Side by Side Diff: media/cast/transport/rtp_sender/rtp_packetizer/rtp_packetizer.h

Issue 388663003: Cast: Reshuffle files under media/cast (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: missing includes Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_PACKETIZER_RTP_PACKETIZER_H_
6 #define MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_PACKETIZER_RTP_PACKETIZER_H_
7
8 #include <cmath>
9 #include <list>
10 #include <map>
11
12 #include "base/time/time.h"
13 #include "media/cast/transport/rtp_sender/packet_storage/packet_storage.h"
14
15 namespace base {
16 class TickClock;
17 }
18
19 namespace media {
20 namespace cast {
21
22 namespace transport {
23
24 class PacedSender;
25
26 struct RtpPacketizerConfig {
27 RtpPacketizerConfig();
28 ~RtpPacketizerConfig();
29
30 // General.
31 int payload_type;
32 uint16 max_payload_length;
33 uint16 sequence_number;
34
35 // SSRC.
36 unsigned int ssrc;
37 };
38
39 // This object is only called from the main cast thread.
40 // This class break encoded audio and video frames into packets and add an RTP
41 // header to each packet.
42 class RtpPacketizer {
43 public:
44 RtpPacketizer(PacedSender* const transport,
45 PacketStorage* packet_storage,
46 RtpPacketizerConfig rtp_packetizer_config);
47 ~RtpPacketizer();
48
49 void SendFrameAsPackets(const EncodedFrame& frame);
50
51 // Return the next sequence number, and increment by one. Enables unique
52 // incremental sequence numbers for every packet (including retransmissions).
53 uint16 NextSequenceNumber();
54
55 size_t send_packet_count() const { return send_packet_count_; }
56 size_t send_octet_count() const { return send_octet_count_; }
57
58 private:
59 void BuildCommonRTPheader(Packet* packet, bool marker_bit, uint32 time_stamp);
60
61 RtpPacketizerConfig config_;
62 PacedSender* const transport_; // Not owned by this class.
63 PacketStorage* packet_storage_;
64
65 uint16 sequence_number_;
66 uint32 rtp_timestamp_;
67 uint16 packet_id_;
68
69 size_t send_packet_count_;
70 size_t send_octet_count_;
71 };
72
73 } // namespace transport
74 } // namespace cast
75 } // namespace media
76
77 #endif // MEDIA_CAST_TRANSPORT_RTP_SENDER_RTP_PACKETIZER_RTP_PACKETIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698