| 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: | |
| 51 virtual ~FrameReceiver() {} | 50 virtual ~FrameReceiver() {} |
| 52 | |
| 53 private: | |
| 54 friend class base::RefCountedThreadSafe<FrameReceiver>; | |
| 55 }; | 51 }; |
| 56 | 52 |
| 57 // This Class is thread safe. | 53 // This Class is thread safe. |
| 58 class CastReceiver { | 54 class CastReceiver { |
| 59 public: | 55 public: |
| 60 static CastReceiver* CreateCastReceiver( | 56 static CastReceiver* CreateCastReceiver( |
| 61 scoped_refptr<CastThread> cast_thread, | 57 scoped_refptr<CastThread> cast_thread, |
| 62 const AudioReceiverConfig& audio_config, | 58 const AudioReceiverConfig& audio_config, |
| 63 const VideoReceiverConfig& video_config, | 59 const VideoReceiverConfig& video_config, |
| 64 PacketSender* const packet_sender); | 60 PacketSender* const packet_sender); |
| 65 | 61 |
| 66 // All received RTP and RTCP packets for the call should be inserted to this | 62 // All received RTP and RTCP packets for the call should be inserted to this |
| 67 // PacketReceiver. | 63 // PacketReceiver. |
| 68 virtual scoped_refptr<PacketReceiver> packet_receiver() = 0; | 64 virtual scoped_refptr<PacketReceiver> packet_receiver() = 0; |
| 69 | 65 |
| 70 // Polling interface to get audio and video frames from the CastReceiver. | 66 // Polling interface to get audio and video frames from the CastReceiver. |
| 71 virtual scoped_refptr<FrameReceiver> frame_receiver() = 0; | 67 virtual scoped_refptr<FrameReceiver> frame_receiver() = 0; |
| 72 | 68 |
| 73 virtual ~CastReceiver() {}; | 69 virtual ~CastReceiver() {}; |
| 74 }; | 70 }; |
| 75 | 71 |
| 76 } // namespace cast | 72 } // namespace cast |
| 77 } // namespace media | 73 } // namespace media |
| 78 | 74 |
| 79 #endif // MEDIA_CAST_CAST_RECEIVER_H_ | 75 #endif // MEDIA_CAST_CAST_RECEIVER_H_ |
| OLD | NEW |