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 #ifndef MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_ | 5 #ifndef MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_ |
6 #define MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_ | 6 #define MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 TransportAudioSender( | 25 TransportAudioSender( |
26 const CastTransportAudioConfig& config, | 26 const CastTransportAudioConfig& config, |
27 base::TickClock* clock, | 27 base::TickClock* clock, |
28 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, | 28 const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner, |
29 PacedSender* const paced_packet_sender); | 29 PacedSender* const paced_packet_sender); |
30 | 30 |
31 virtual ~TransportAudioSender(); | 31 virtual ~TransportAudioSender(); |
32 | 32 |
33 // Handles the encoded audio frames to be processed. | 33 // Handles the encoded audio frames to be processed. |
34 // Frames will be encrypted, packetized and transmitted to the network. | 34 // Frames will be encrypted, packetized and transmitted to the network. |
35 void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame, | 35 void SendFrame(const EncodedFrame& audio_frame); |
36 const base::TimeTicks& recorded_time); | |
37 | 36 |
38 // Retransmision request. | 37 // Retransmision request. |
39 void ResendPackets( | 38 void ResendPackets( |
40 const MissingFramesAndPacketsMap& missing_frames_and_packets); | 39 const MissingFramesAndPacketsMap& missing_frames_and_packets); |
41 | 40 |
42 bool initialized() const { return initialized_; } | 41 bool initialized() const { return initialized_; } |
43 | 42 |
44 // Subscribe callback to get RTP Audio stats. | 43 // Subscribe callback to get RTP Audio stats. |
45 void SubscribeAudioRtpStatsCallback( | 44 void SubscribeAudioRtpStatsCallback( |
46 const CastTransportRtpStatistics& callback); | 45 const CastTransportRtpStatistics& callback); |
47 | 46 |
48 private: | 47 private: |
49 friend class LocalRtcpAudioSenderFeedback; | 48 friend class LocalRtcpAudioSenderFeedback; |
50 | 49 |
51 // Caller must allocate the destination |encrypted_frame|. The data member | 50 // Caller must allocate the destination |encrypted_frame|. The data member |
52 // will be resized to hold the encrypted size. | 51 // will be resized to hold the encrypted size. |
53 bool EncryptAudioFrame(const EncodedAudioFrame& audio_frame, | 52 bool EncryptAudioFrame(const EncodedFrame& audio_frame, |
54 EncodedAudioFrame* encrypted_frame); | 53 EncodedFrame* encrypted_frame); |
55 | 54 |
56 RtpSender rtp_sender_; | 55 RtpSender rtp_sender_; |
57 TransportEncryptionHandler encryptor_; | 56 TransportEncryptionHandler encryptor_; |
58 bool initialized_; | 57 bool initialized_; |
59 | 58 |
60 DISALLOW_IMPLICIT_CONSTRUCTORS(TransportAudioSender); | 59 DISALLOW_IMPLICIT_CONSTRUCTORS(TransportAudioSender); |
61 }; | 60 }; |
62 | 61 |
63 } // namespace transport | 62 } // namespace transport |
64 } // namespace cast | 63 } // namespace cast |
65 } // namespace media | 64 } // namespace media |
66 | 65 |
67 #endif // MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_ | 66 #endif // MEDIA_CAST_TRANSPORT_TRANSPORT_AUDIO_SENDER_H_ |
OLD | NEW |