Report errors from ChromiumEnv::GetChildren in Posix.
[chromium-blink-merge.git] / media / cast / rtp_sender / rtp_sender.h
blob45fd987f7bdb079c8cc2260c01b148301cdd48d2
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.
5 // This file contains the interface to the cast RTP sender.
7 #ifndef MEDIA_CAST_RTP_SENDER_RTP_SENDER_H_
8 #define MEDIA_CAST_RTP_SENDER_RTP_SENDER_H_
10 #include <map>
11 #include <set>
13 #include "base/memory/scoped_ptr.h"
14 #include "base/time/tick_clock.h"
15 #include "base/time/time.h"
16 #include "media/cast/cast_config.h"
17 #include "media/cast/rtp_sender/packet_storage/packet_storage.h"
18 #include "media/cast/rtp_sender/rtp_packetizer/rtp_packetizer.h"
19 #include "media/cast/rtp_sender/rtp_packetizer/rtp_packetizer_config.h"
21 namespace media {
22 namespace cast {
24 class PacedPacketSender;
25 struct RtcpSenderInfo;
27 // This object is only called from the main cast thread.
28 // This class handles splitting encoded audio and video frames into packets and
29 // add an RTP header to each packet. The sent packets are stored until they are
30 // acknowledged by the remote peer or timed out.
31 class RtpSender {
32 public:
33 RtpSender(base::TickClock* clock,
34 const AudioSenderConfig* audio_config,
35 const VideoSenderConfig* video_config,
36 PacedPacketSender* transport);
38 ~RtpSender();
40 // The video_frame objects ownership is handled by the main cast thread.
41 void IncomingEncodedVideoFrame(const EncodedVideoFrame* video_frame,
42 const base::TimeTicks& capture_time);
44 // The audio_frame objects ownership is handled by the main cast thread.
45 void IncomingEncodedAudioFrame(const EncodedAudioFrame* audio_frame,
46 const base::TimeTicks& recorded_time);
48 void ResendPackets(const MissingFramesAndPacketsMap& missing_packets);
50 void RtpStatistics(const base::TimeTicks& now, RtcpSenderInfo* sender_info);
52 private:
53 void UpdateSequenceNumber(std::vector<uint8>* packet);
55 base::TickClock* const clock_; // Not owned by this class.
56 RtpPacketizerConfig config_;
57 scoped_ptr<RtpPacketizer> packetizer_;
58 scoped_ptr<PacketStorage> storage_;
59 PacedPacketSender* transport_;
62 } // namespace cast
63 } // namespace media
65 #endif // MEDIA_CAST_RTP_SENDER_RTP_SENDER_H_