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 sender. All configuration are done | 5 // This is the main interface for the cast sender. All configuration are done |
6 // at creation. | 6 // at creation. |
7 // | 7 // |
8 // The FrameInput and PacketReciever interfaces should normally be accessed from | 8 // The FrameInput and PacketReciever interfaces should normally be accessed from |
9 // the IO thread. However they are allowed to be called from any thread. | 9 // the IO thread. However they are allowed to be called from any thread. |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 const base::Closure callback) = 0; | 49 const base::Closure callback) = 0; |
50 | 50 |
51 // The audio_frame must be valid until the callback is called. | 51 // The audio_frame must be valid until the callback is called. |
52 // The callback is called from the main cast thread as soon as | 52 // The callback is called from the main cast thread as soon as |
53 // the cast sender is done with the frame; it does not mean that the encoded | 53 // the cast sender is done with the frame; it does not mean that the encoded |
54 // frame has been sent out. | 54 // frame has been sent out. |
55 virtual void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame, | 55 virtual void InsertCodedAudioFrame(const EncodedAudioFrame* audio_frame, |
56 const base::TimeTicks& recorded_time, | 56 const base::TimeTicks& recorded_time, |
57 const base::Closure callback) = 0; | 57 const base::Closure callback) = 0; |
58 | 58 |
| 59 protected: |
59 virtual ~FrameInput() {} | 60 virtual ~FrameInput() {} |
| 61 |
| 62 private: |
| 63 friend class base::RefCountedThreadSafe<FrameInput>; |
60 }; | 64 }; |
61 | 65 |
62 // This Class is thread safe. | 66 // This Class is thread safe. |
63 // The provided PacketSender object will always be called form the main cast | 67 // The provided PacketSender object will always be called form the main cast |
64 // thread. | 68 // thread. |
65 class CastSender { | 69 class CastSender { |
66 public: | 70 public: |
67 static CastSender* CreateCastSender( | 71 static CastSender* CreateCastSender( |
68 scoped_refptr<CastThread> cast_thread, | 72 scoped_refptr<CastThread> cast_thread, |
69 const AudioSenderConfig& audio_config, | 73 const AudioSenderConfig& audio_config, |
(...skipping 10 matching lines...) Expand all Loading... |
80 | 84 |
81 // All RTCP packets for the session should be inserted to this object. | 85 // All RTCP packets for the session should be inserted to this object. |
82 // Can be called from any thread. | 86 // Can be called from any thread. |
83 virtual scoped_refptr<PacketReceiver> packet_receiver() = 0; | 87 virtual scoped_refptr<PacketReceiver> packet_receiver() = 0; |
84 }; | 88 }; |
85 | 89 |
86 } // namespace cast | 90 } // namespace cast |
87 } // namespace media | 91 } // namespace media |
88 | 92 |
89 #endif // MEDIA_CAST_CAST_SENDER_H_ | 93 #endif // MEDIA_CAST_CAST_SENDER_H_ |
OLD | NEW |