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 receiver. All configuration are done | 5 // This is the main interface for the cast receiver. All configuration are done |
6 // at creation. | 6 // at creation. |
7 | 7 |
8 #ifndef MEDIA_CAST_CAST_RECEIVER_H_ | 8 #ifndef MEDIA_CAST_CAST_RECEIVER_H_ |
9 #define MEDIA_CAST_CAST_RECEIVER_H_ | 9 #define MEDIA_CAST_CAST_RECEIVER_H_ |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 virtual bool GetRawAudioFrame(int number_of_10ms_blocks, | 41 virtual bool GetRawAudioFrame(int number_of_10ms_blocks, |
42 int desired_frequency, | 42 int desired_frequency, |
43 const AudioFrameDecodedCallback callback) = 0; | 43 const AudioFrameDecodedCallback callback) = 0; |
44 | 44 |
45 virtual bool GetCodedAudioFrame(EncodedAudioFrame* audio_frame, | 45 virtual bool GetCodedAudioFrame(EncodedAudioFrame* audio_frame, |
46 base::TimeTicks* playout_time) = 0; | 46 base::TimeTicks* playout_time) = 0; |
47 | 47 |
48 virtual void ReleaseCodedAudioFrame(uint8 frame_id) = 0; | 48 virtual void ReleaseCodedAudioFrame(uint8 frame_id) = 0; |
49 | 49 |
| 50 protected: |
50 virtual ~FrameReceiver() {} | 51 virtual ~FrameReceiver() {} |
| 52 |
| 53 private: |
| 54 friend class base::RefCountedThreadSafe<FrameReceiver>; |
51 }; | 55 }; |
52 | 56 |
53 // This Class is thread safe. | 57 // This Class is thread safe. |
54 class CastReceiver { | 58 class CastReceiver { |
55 public: | 59 public: |
56 static CastReceiver* CreateCastReceiver( | 60 static CastReceiver* CreateCastReceiver( |
57 scoped_refptr<CastThread> cast_thread, | 61 scoped_refptr<CastThread> cast_thread, |
58 const AudioReceiverConfig& audio_config, | 62 const AudioReceiverConfig& audio_config, |
59 const VideoReceiverConfig& video_config, | 63 const VideoReceiverConfig& video_config, |
60 PacketSender* const packet_sender); | 64 PacketSender* const packet_sender); |
61 | 65 |
62 // All received RTP and RTCP packets for the call should be inserted to this | 66 // All received RTP and RTCP packets for the call should be inserted to this |
63 // PacketReceiver. | 67 // PacketReceiver. |
64 virtual scoped_refptr<PacketReceiver> packet_receiver() = 0; | 68 virtual scoped_refptr<PacketReceiver> packet_receiver() = 0; |
65 | 69 |
66 // Polling interface to get audio and video frames from the CastReceiver. | 70 // Polling interface to get audio and video frames from the CastReceiver. |
67 virtual scoped_refptr<FrameReceiver> frame_receiver() = 0; | 71 virtual scoped_refptr<FrameReceiver> frame_receiver() = 0; |
68 | 72 |
69 virtual ~CastReceiver() {}; | 73 virtual ~CastReceiver() {}; |
70 }; | 74 }; |
71 | 75 |
72 } // namespace cast | 76 } // namespace cast |
73 } // namespace media | 77 } // namespace media |
74 | 78 |
75 #endif // MEDIA_CAST_CAST_RECEIVER_H_ | 79 #endif // MEDIA_CAST_CAST_RECEIVER_H_ |
OLD | NEW |