OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 67 matching lines...) Loading... |
78 AddLocalStream(CreateStream(kStream2, "", kVideoTrack2)); | 78 AddLocalStream(CreateStream(kStream2, "", kVideoTrack2)); |
79 } | 79 } |
80 | 80 |
81 void ClearLocalStreams() { | 81 void ClearLocalStreams() { |
82 while (local_streams()->count() != 0) { | 82 while (local_streams()->count() != 0) { |
83 RemoveLocalStream(local_streams()->at(0)); | 83 RemoveLocalStream(local_streams()->at(0)); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 // Implements MediaStreamSignalingObserver. | 87 // Implements MediaStreamSignalingObserver. |
88 virtual void OnAddRemoteStream(webrtc::MediaStreamInterface* stream) { | 88 virtual void OnAddRemoteStream(webrtc::MediaStreamInterface* stream) {} |
89 } | 89 virtual void OnRemoveRemoteStream(webrtc::MediaStreamInterface* stream) {} |
90 virtual void OnRemoveRemoteStream(webrtc::MediaStreamInterface* stream) { | 90 virtual void OnAddDataChannel(webrtc::DataChannelInterface* data_channel) {} |
91 } | |
92 virtual void OnAddDataChannel(webrtc::DataChannelInterface* data_channel) { | |
93 } | |
94 virtual void OnAddLocalAudioTrack(webrtc::MediaStreamInterface* stream, | 91 virtual void OnAddLocalAudioTrack(webrtc::MediaStreamInterface* stream, |
95 webrtc::AudioTrackInterface* audio_track, | 92 webrtc::AudioTrackInterface* audio_track, |
96 uint32 ssrc) { | 93 uint32 ssrc) {} |
97 } | |
98 virtual void OnAddLocalVideoTrack(webrtc::MediaStreamInterface* stream, | 94 virtual void OnAddLocalVideoTrack(webrtc::MediaStreamInterface* stream, |
99 webrtc::VideoTrackInterface* video_track, | 95 webrtc::VideoTrackInterface* video_track, |
100 uint32 ssrc) { | 96 uint32 ssrc) {} |
101 } | |
102 virtual void OnAddRemoteAudioTrack(webrtc::MediaStreamInterface* stream, | 97 virtual void OnAddRemoteAudioTrack(webrtc::MediaStreamInterface* stream, |
103 webrtc::AudioTrackInterface* audio_track, | 98 webrtc::AudioTrackInterface* audio_track, |
104 uint32 ssrc) { | 99 uint32 ssrc) {} |
105 } | |
106 | |
107 virtual void OnAddRemoteVideoTrack(webrtc::MediaStreamInterface* stream, | 100 virtual void OnAddRemoteVideoTrack(webrtc::MediaStreamInterface* stream, |
108 webrtc::VideoTrackInterface* video_track, | 101 webrtc::VideoTrackInterface* video_track, |
109 uint32 ssrc) { | 102 uint32 ssrc) {} |
110 } | |
111 | |
112 virtual void OnRemoveRemoteAudioTrack( | 103 virtual void OnRemoveRemoteAudioTrack( |
113 webrtc::MediaStreamInterface* stream, | 104 webrtc::MediaStreamInterface* stream, |
114 webrtc::AudioTrackInterface* audio_track) { | 105 webrtc::AudioTrackInterface* audio_track) {} |
115 } | |
116 | |
117 virtual void OnRemoveRemoteVideoTrack( | 106 virtual void OnRemoveRemoteVideoTrack( |
118 webrtc::MediaStreamInterface* stream, | 107 webrtc::MediaStreamInterface* stream, |
119 webrtc::VideoTrackInterface* video_track) { | 108 webrtc::VideoTrackInterface* video_track) {} |
120 } | 109 virtual void OnRemoveLocalAudioTrack(webrtc::MediaStreamInterface* stream, |
121 | 110 webrtc::AudioTrackInterface* audio_track, |
122 virtual void OnRemoveLocalAudioTrack( | 111 uint32 ssrc) {} |
123 webrtc::MediaStreamInterface* stream, | |
124 webrtc::AudioTrackInterface* audio_track, | |
125 uint32 ssrc) { | |
126 } | |
127 virtual void OnRemoveLocalVideoTrack( | 112 virtual void OnRemoveLocalVideoTrack( |
128 webrtc::MediaStreamInterface* stream, | 113 webrtc::MediaStreamInterface* stream, |
129 webrtc::VideoTrackInterface* video_track) { | 114 webrtc::VideoTrackInterface* video_track) {} |
130 } | 115 virtual void OnRemoveLocalStream(webrtc::MediaStreamInterface* stream) {} |
131 virtual void OnRemoveLocalStream(webrtc::MediaStreamInterface* stream) { | |
132 } | |
133 | 116 |
134 private: | 117 private: |
135 rtc::scoped_refptr<webrtc::MediaStreamInterface> CreateStream( | 118 rtc::scoped_refptr<webrtc::MediaStreamInterface> CreateStream( |
136 const std::string& stream_label, | 119 const std::string& stream_label, |
137 const std::string& audio_track_id, | 120 const std::string& audio_track_id, |
138 const std::string& video_track_id) { | 121 const std::string& video_track_id) { |
139 rtc::scoped_refptr<webrtc::MediaStreamInterface> stream( | 122 rtc::scoped_refptr<webrtc::MediaStreamInterface> stream( |
140 webrtc::MediaStream::Create(stream_label)); | 123 webrtc::MediaStream::Create(stream_label)); |
141 | 124 |
142 if (!audio_track_id.empty()) { | 125 if (!audio_track_id.empty()) { |
143 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track( | 126 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track( |
144 webrtc::AudioTrack::Create(audio_track_id, NULL)); | 127 webrtc::AudioTrack::Create(audio_track_id, NULL)); |
145 stream->AddTrack(audio_track); | 128 stream->AddTrack(audio_track); |
146 } | 129 } |
147 | 130 |
148 if (!video_track_id.empty()) { | 131 if (!video_track_id.empty()) { |
149 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( | 132 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( |
150 webrtc::VideoTrack::Create(video_track_id, NULL)); | 133 webrtc::VideoTrack::Create(video_track_id, NULL)); |
151 stream->AddTrack(video_track); | 134 stream->AddTrack(video_track); |
152 } | 135 } |
153 return stream; | 136 return stream; |
154 } | 137 } |
155 }; | 138 }; |
156 | 139 |
157 #endif // TALK_APP_WEBRTC_TEST_FAKEMEDIASTREAMSIGNALING_H_ | 140 #endif // TALK_APP_WEBRTC_TEST_FAKEMEDIASTREAMSIGNALING_H_ |
OLD | NEW |