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_TEST_IN_PROCESS_RECEIVER_H_ | 5 #ifndef MEDIA_CAST_TEST_IN_PROCESS_RECEIVER_H_ |
6 #define MEDIA_CAST_TEST_IN_PROCESS_RECEIVER_H_ | 6 #define MEDIA_CAST_TEST_IN_PROCESS_RECEIVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 const FrameReceiverConfig& video_config() const { return video_config_; } | 57 const FrameReceiverConfig& video_config() const { return video_config_; } |
58 | 58 |
59 // Begin delivering any received audio/video frames to the OnXXXFrame() | 59 // Begin delivering any received audio/video frames to the OnXXXFrame() |
60 // methods. | 60 // methods. |
61 virtual void Start(); | 61 virtual void Start(); |
62 | 62 |
63 // Destroy the sub-compontents of this class. | 63 // Destroy the sub-compontents of this class. |
64 // After this call, it is safe to destroy this object on any thread. | 64 // After this call, it is safe to destroy this object on any thread. |
65 virtual void Stop(); | 65 virtual void Stop(); |
66 | 66 |
67 void ReceivePacket(scoped_ptr<Packet> packet); | |
miu
2016/02/22 22:38:48
Don't make this method public. Instead, make the
xjz
2016/02/23 21:51:47
Done.
| |
68 | |
67 protected: | 69 protected: |
68 // To be implemented by subclasses. These are called on the Cast MAIN thread | 70 // To be implemented by subclasses. These are called on the Cast MAIN thread |
69 // as each frame is received. | 71 // as each frame is received. |
70 virtual void OnAudioFrame(scoped_ptr<AudioBus> audio_frame, | 72 virtual void OnAudioFrame(scoped_ptr<AudioBus> audio_frame, |
71 const base::TimeTicks& playout_time, | 73 const base::TimeTicks& playout_time, |
72 bool is_continuous) = 0; | 74 bool is_continuous) = 0; |
73 virtual void OnVideoFrame(const scoped_refptr<VideoFrame>& video_frame, | 75 virtual void OnVideoFrame(const scoped_refptr<VideoFrame>& video_frame, |
74 const base::TimeTicks& playout_time, | 76 const base::TimeTicks& playout_time, |
75 bool is_continuous) = 0; | 77 bool is_continuous) = 0; |
76 | 78 |
(...skipping 18 matching lines...) Expand all Loading... | |
95 // argument description and semantics. | 97 // argument description and semantics. |
96 void GotAudioFrame(scoped_ptr<AudioBus> audio_frame, | 98 void GotAudioFrame(scoped_ptr<AudioBus> audio_frame, |
97 const base::TimeTicks& playout_time, | 99 const base::TimeTicks& playout_time, |
98 bool is_continuous); | 100 bool is_continuous); |
99 void GotVideoFrame(const scoped_refptr<VideoFrame>& video_frame, | 101 void GotVideoFrame(const scoped_refptr<VideoFrame>& video_frame, |
100 const base::TimeTicks& playout_time, | 102 const base::TimeTicks& playout_time, |
101 bool is_continuous); | 103 bool is_continuous); |
102 void PullNextAudioFrame(); | 104 void PullNextAudioFrame(); |
103 void PullNextVideoFrame(); | 105 void PullNextVideoFrame(); |
104 | 106 |
105 void ReceivePacket(scoped_ptr<Packet> packet); | |
106 | |
107 const scoped_refptr<CastEnvironment> cast_environment_; | 107 const scoped_refptr<CastEnvironment> cast_environment_; |
108 const net::IPEndPoint local_end_point_; | 108 const net::IPEndPoint local_end_point_; |
109 const net::IPEndPoint remote_end_point_; | 109 const net::IPEndPoint remote_end_point_; |
110 const FrameReceiverConfig audio_config_; | 110 const FrameReceiverConfig audio_config_; |
111 const FrameReceiverConfig video_config_; | 111 const FrameReceiverConfig video_config_; |
112 | 112 |
113 scoped_ptr<CastTransportSender> transport_; | 113 scoped_ptr<CastTransportSender> transport_; |
114 scoped_ptr<CastReceiver> cast_receiver_; | 114 scoped_ptr<CastReceiver> cast_receiver_; |
115 | 115 |
116 // NOTE: Weak pointers must be invalidated before all other member variables. | 116 // NOTE: Weak pointers must be invalidated before all other member variables. |
117 base::WeakPtrFactory<InProcessReceiver> weak_factory_; | 117 base::WeakPtrFactory<InProcessReceiver> weak_factory_; |
118 | 118 |
119 DISALLOW_COPY_AND_ASSIGN(InProcessReceiver); | 119 DISALLOW_COPY_AND_ASSIGN(InProcessReceiver); |
120 }; | 120 }; |
121 | 121 |
122 } // namespace cast | 122 } // namespace cast |
123 } // namespace media | 123 } // namespace media |
124 | 124 |
125 #endif // MEDIA_CAST_TEST_IN_PROCESS_RECEIVER_H_ | 125 #endif // MEDIA_CAST_TEST_IN_PROCESS_RECEIVER_H_ |
OLD | NEW |