OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 class VideoTrackInterface : public MediaStreamTrackInterface { | 141 class VideoTrackInterface : public MediaStreamTrackInterface { |
142 public: | 142 public: |
143 // Register a renderer that will render all frames received on this track. | 143 // Register a renderer that will render all frames received on this track. |
144 virtual void AddRenderer(VideoRendererInterface* renderer) = 0; | 144 virtual void AddRenderer(VideoRendererInterface* renderer) = 0; |
145 // Deregister a renderer. | 145 // Deregister a renderer. |
146 virtual void RemoveRenderer(VideoRendererInterface* renderer) = 0; | 146 virtual void RemoveRenderer(VideoRendererInterface* renderer) = 0; |
147 | 147 |
148 virtual VideoSourceInterface* GetSource() const = 0; | 148 virtual VideoSourceInterface* GetSource() const = 0; |
149 | 149 |
| 150 // Return the track input sink. I.e., frames sent to this sink are |
| 151 // propagated to all renderers registered with the track. The |
| 152 // returned sink must not change between calls. Currently, this |
| 153 // method is used for remote tracks (VideoRtpReceiver); further |
| 154 // refactoring is planned for this path, it's unclear if this method |
| 155 // belongs here long term. |
| 156 |
| 157 // We do this instead of simply implementing the |
| 158 // VideoSourceInterface directly, because if we did the latter, we'd |
| 159 // need an OnFrame method in VideoTrackProxy, with a thread jump on |
| 160 // each call. |
| 161 |
| 162 // TODO(nisse): It has a default implementation so that mock |
| 163 // objects, in particular, chrome's MockWebRtcVideoTrack, doesn't |
| 164 // need to know about it. Consider removing the implementation (or |
| 165 // this comment) after refactoring dust settles. |
| 166 virtual rtc::VideoSinkInterface<cricket::VideoFrame>* GetSink() { |
| 167 return nullptr; |
| 168 }; |
| 169 |
150 protected: | 170 protected: |
151 virtual ~VideoTrackInterface() {} | 171 virtual ~VideoTrackInterface() {} |
152 }; | 172 }; |
153 | 173 |
154 // Interface for receiving audio data from a AudioTrack. | 174 // Interface for receiving audio data from a AudioTrack. |
155 class AudioTrackSinkInterface { | 175 class AudioTrackSinkInterface { |
156 public: | 176 public: |
157 virtual void OnData(const void* audio_data, | 177 virtual void OnData(const void* audio_data, |
158 int bits_per_sample, | 178 int bits_per_sample, |
159 int sample_rate, | 179 int sample_rate, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; | 287 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; |
268 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; | 288 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; |
269 | 289 |
270 protected: | 290 protected: |
271 virtual ~MediaStreamInterface() {} | 291 virtual ~MediaStreamInterface() {} |
272 }; | 292 }; |
273 | 293 |
274 } // namespace webrtc | 294 } // namespace webrtc |
275 | 295 |
276 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ | 296 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ |
OLD | NEW |