OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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. The cast sender | 5 // This is the main interface for the cast transport sender. The cast sender |
6 // handles the cast pipeline from encoded frames (both audio and video), to | 6 // handles the cast pipeline from encoded frames (both audio and video), to |
7 // encryption, packetization and transport. | 7 // encryption, packetization and transport. |
8 | 8 |
9 // Construction of the Cast Sender and the Cast Transport Sender should be done | 9 // Construction of the Cast Sender and the Cast Transport Sender should be done |
10 // in the following order: | 10 // in the following order: |
11 // 1. Create CastTransportSender. | 11 // 1. Create CastTransportSender. |
12 // 2. Create CastSender (accepts CastTransportSender as an input). | 12 // 2. Create CastSender (accepts CastTransportSender as an input). |
13 // 3. Call CastTransportSender::SetPacketReceiver to ensure that the packets | 13 // 3. Call CastTransportSender::SetPacketReceiver to ensure that the packets |
14 // received by the CastTransportSender will be sent to the CastSender. | 14 // received by the CastTransportSender will be sent to the CastSender. |
15 // Steps 3 can be done interchangeably. | 15 // 4. Initialize audio and/or video. |
| 16 // Steps 3 & 4 can be done interchangeably. |
16 | 17 |
17 // Destruction: The CastTransportSender is assumed to be valid as long as the | 18 // Destruction: The CastTransportSender is assumed to be valid as long as the |
18 // CastSender is alive. Therefore the CastSender should be destructed before the | 19 // CastSender is alive. Therefore the CastSender should be destructed before the |
19 // CastTransportSender. | 20 // CastTransportSender. |
20 // This also works when the CastSender acts as a receiver for the RTCP packets | 21 // This also works when the CastSender acts as a receiver for the RTCP packets |
21 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc. | 22 // due to the weak pointers in the ReceivedPacket method in cast_sender_impl.cc. |
22 | 23 |
23 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 24 #ifndef MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
24 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 25 #define MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
25 | 26 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 const net::IPEndPoint& remote_end_point, | 62 const net::IPEndPoint& remote_end_point, |
62 const CastTransportStatusCallback& status_callback, | 63 const CastTransportStatusCallback& status_callback, |
63 const BulkRawEventsCallback& raw_events_callback, | 64 const BulkRawEventsCallback& raw_events_callback, |
64 base::TimeDelta raw_events_callback_interval, | 65 base::TimeDelta raw_events_callback_interval, |
65 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); | 66 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); |
66 | 67 |
67 virtual ~CastTransportSender() {} | 68 virtual ~CastTransportSender() {} |
68 | 69 |
69 // Audio/Video initialization. | 70 // Audio/Video initialization. |
70 // Encoded frames cannot be transmitted until the relevant initialize method | 71 // Encoded frames cannot be transmitted until the relevant initialize method |
71 // is called. Usually called by CastSender. | 72 // is called. |
72 virtual void InitializeAudio(const CastTransportAudioConfig& config) = 0; | 73 virtual void InitializeAudio(const CastTransportAudioConfig& config) = 0; |
73 | 74 |
74 virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0; | 75 virtual void InitializeVideo(const CastTransportVideoConfig& config) = 0; |
75 | 76 |
76 // Sets the Cast packet receiver. Should be called after creation on the | 77 // Sets the Cast packet receiver. Should be called after creation on the |
77 // Cast sender. Packets won't be received until this function is called. | 78 // Cast sender. Packets won't be received until this function is called. |
78 virtual void SetPacketReceiver( | 79 virtual void SetPacketReceiver( |
79 const PacketReceiverCallback& packet_receiver) = 0; | 80 const PacketReceiverCallback& packet_receiver) = 0; |
80 | 81 |
81 // The following two functions handle the encoded media frames (audio and | 82 // The following two functions handle the encoded media frames (audio and |
(...skipping 26 matching lines...) Expand all Loading... |
108 | 109 |
109 virtual void SubscribeVideoRtpStatsCallback( | 110 virtual void SubscribeVideoRtpStatsCallback( |
110 const CastTransportRtpStatistics& callback) = 0; | 111 const CastTransportRtpStatistics& callback) = 0; |
111 }; | 112 }; |
112 | 113 |
113 } // namespace transport | 114 } // namespace transport |
114 } // namespace cast | 115 } // namespace cast |
115 } // namespace media | 116 } // namespace media |
116 | 117 |
117 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ | 118 #endif // MEDIA_CAST_TRANSPORT_CAST_TRANSPORT_SENDER_H_ |
OLD | NEW |