OLD | NEW |
| (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 // This is the main interface for the cast net sender. The cast sender handles | |
6 // the cast pipeline from encoded frames (both audio and video), to encryption, | |
7 // packetization and transport. | |
8 // All configurations are done at creation. | |
9 | |
10 #ifndef MEDIA_CAST_NET_CAST_NET_SENDER_H_ | |
11 #define MEDIA_CAST_NET_CAST_NET_SENDER_H_ | |
12 | |
13 #include "base/basictypes.h" | |
14 #include "base/threading/non_thread_safe.h" | |
15 #include "base/time/tick_clock.h" | |
16 #include "media/cast/net/cast_net_defines.h" | |
17 | |
18 namespace media { | |
19 class AudioBus; | |
20 class VideoFrame; | |
21 } | |
22 | |
23 namespace media { | |
24 namespace cast { | |
25 namespace transport { | |
26 | |
27 class CastNetNotification { | |
28 public: | |
29 enum CastNetStatus { | |
30 UNINITIALIZED, | |
31 INITIALIZED, | |
32 INVALID_CRYPTO_CONFIG, | |
33 SOCKET_ERROR, | |
34 // TODO(mikhal): Add. | |
35 }; | |
36 | |
37 virtual void NotifyStatusChange(CastNetStatus result) = 0; | |
38 virtual ~CastNetNotification() {} | |
39 }; | |
40 | |
41 // This Class is not thread safe. | |
42 // The application should only trigger this class from one thread. | |
43 class CastNetSender : public base::NonThreadSafe { | |
44 public: | |
45 static CastNetSender* CreateCastNetSender( | |
46 base::TickClock* clock, | |
47 const CastNetConfig& config, | |
48 CastNetNotification* const notifier, | |
49 scoped_refptr<PacketReceiver> packet_receiver); | |
50 | |
51 virtual ~CastNetSender() {} | |
52 virtual void InsertCodedAudioFrame(const AudioBus* audio_bus, | |
53 const base::TimeTicks& recorded_time) = 0; | |
54 | |
55 virtual void InsertCodedVideoFrame(const EncodedVideoFrame* video_frame, | |
56 const base::TimeTicks& capture_time) = 0; | |
57 | |
58 virtual void SendRtcpFromRtpSender( | |
59 uint32 packet_type_flags, | |
60 const RtcpSenderInfo& sender_info, | |
61 const RtcpDlrrReportBlock& dlrr, | |
62 const RtcpSenderLogMessage& sender_log) = 0; | |
63 | |
64 virtual void ResendPackets( | |
65 const MissingFramesAndPacketsMap& missing_packets) = 0; | |
66 }; | |
67 | |
68 } // namespace transport | |
69 } // namespace cast | |
70 } // namespace media | |
71 | |
72 #endif // MEDIA_CAST_NET_CAST_NET_SENDER_H_ | |
OLD | NEW |