OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This is the main interface for the cast transport sender. It accepts encoded | 5 // This is the main interface for the cast transport sender. It accepts encoded |
6 // frames (both audio and video), encrypts their encoded data, packetizes them | 6 // frames (both audio and video), encrypts their encoded data, packetizes them |
7 // and feeds them into a transport (e.g., UDP). | 7 // and feeds them into a transport (e.g., UDP). |
8 | 8 |
9 // Construction of the Cast Sender and the Cast Transport should be done | 9 // Construction of the Cast Sender and the Cast Transport should be done |
10 // in the following order: | 10 // in the following order: |
11 // 1. Create CastTransport. | 11 // 1. Create CastTransport. |
12 // 2. Create CastSender (accepts CastTransport as an input). | 12 // 2. Create CastSender (accepts CastTransport as an input). |
13 | 13 |
14 // Destruction: The CastTransport is assumed to be valid as long as the | 14 // Destruction: The CastTransport is assumed to be valid as long as the |
15 // CastSender is alive. Therefore the CastSender should be destructed before the | 15 // CastSender is alive. Therefore the CastSender should be destructed before the |
16 // CastTransport. | 16 // CastTransport. |
17 | 17 |
18 #ifndef MEDIA_CAST_NET_CAST_TRANSPORT_H_ | 18 #ifndef MEDIA_CAST_NET_CAST_TRANSPORT_H_ |
19 #define MEDIA_CAST_NET_CAST_TRANSPORT_H_ | 19 #define MEDIA_CAST_NET_CAST_TRANSPORT_H_ |
20 | 20 |
21 #include <stdint.h> | 21 #include <stdint.h> |
22 | 22 |
23 #include <memory> | 23 #include <memory> |
24 | 24 |
25 #include "base/callback.h" | 25 #include "base/callback.h" |
26 #include "base/single_thread_task_runner.h" | 26 #include "base/single_thread_task_runner.h" |
27 #include "base/threading/non_thread_safe.h" | |
28 #include "base/time/tick_clock.h" | 27 #include "base/time/tick_clock.h" |
29 #include "base/values.h" | 28 #include "base/values.h" |
30 #include "media/cast/logging/logging_defines.h" | 29 #include "media/cast/logging/logging_defines.h" |
31 #include "media/cast/net/cast_transport_config.h" | 30 #include "media/cast/net/cast_transport_config.h" |
32 #include "media/cast/net/cast_transport_defines.h" | 31 #include "media/cast/net/cast_transport_defines.h" |
33 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" | 32 #include "media/cast/net/rtcp/receiver_rtcp_event_subscriber.h" |
34 #include "media/cast/net/rtcp/rtcp_defines.h" | 33 #include "media/cast/net/rtcp/rtcp_defines.h" |
35 #include "net/base/ip_endpoint.h" | 34 #include "net/base/ip_endpoint.h" |
36 | 35 |
37 namespace base { | 36 namespace base { |
(...skipping 26 matching lines...) Expand all Loading... |
64 virtual void OnReceivedRtt(base::TimeDelta round_trip_time) = 0; | 63 virtual void OnReceivedRtt(base::TimeDelta round_trip_time) = 0; |
65 | 64 |
66 // Called on receiving PLI from RTP receiver. | 65 // Called on receiving PLI from RTP receiver. |
67 virtual void OnReceivedPli() = 0; | 66 virtual void OnReceivedPli() = 0; |
68 | 67 |
69 // Called on receiving RTP receiver logs. | 68 // Called on receiving RTP receiver logs. |
70 virtual void OnReceivedReceiverLog(const RtcpReceiverLogMessage& log) {} | 69 virtual void OnReceivedReceiverLog(const RtcpReceiverLogMessage& log) {} |
71 }; | 70 }; |
72 | 71 |
73 // The application should only trigger this class from the transport thread. | 72 // The application should only trigger this class from the transport thread. |
74 class CastTransport : public base::NonThreadSafe { | 73 class CastTransport { |
75 public: | 74 public: |
76 // Interface used for receiving status updates, raw events, and RTP packets | 75 // Interface used for receiving status updates, raw events, and RTP packets |
77 // from CastTransport. | 76 // from CastTransport. |
78 class Client { | 77 class Client { |
79 public: | 78 public: |
80 virtual ~Client(){}; | 79 virtual ~Client(){}; |
81 | 80 |
82 // Audio and Video transport status change is reported on this callback. | 81 // Audio and Video transport status change is reported on this callback. |
83 virtual void OnStatusChanged(CastTransportStatus status) = 0; | 82 virtual void OnStatusChanged(CastTransportStatus status) = 0; |
84 | 83 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 virtual void SendRtcpFromRtpReceiver() = 0; | 162 virtual void SendRtcpFromRtpReceiver() = 0; |
164 | 163 |
165 // Set options for the PacedSender and Wifi. | 164 // Set options for the PacedSender and Wifi. |
166 virtual void SetOptions(const base::DictionaryValue& options) = 0; | 165 virtual void SetOptions(const base::DictionaryValue& options) = 0; |
167 }; | 166 }; |
168 | 167 |
169 } // namespace cast | 168 } // namespace cast |
170 } // namespace media | 169 } // namespace media |
171 | 170 |
172 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_H_ | 171 #endif // MEDIA_CAST_NET_CAST_TRANSPORT_H_ |
OLD | NEW |