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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual void OnRemoveRemoteStream(webrtc::MediaStreamInterface* stream) {} | 89 virtual void OnRemoveRemoteStream(webrtc::MediaStreamInterface* stream) {} |
90 virtual void OnAddDataChannel(webrtc::DataChannelInterface* data_channel) {} | 90 virtual void OnAddDataChannel(webrtc::DataChannelInterface* data_channel) {} |
91 virtual void OnAddLocalAudioTrack(webrtc::MediaStreamInterface* stream, | 91 virtual void OnAddLocalAudioTrack(webrtc::MediaStreamInterface* stream, |
92 webrtc::AudioTrackInterface* audio_track, | 92 webrtc::AudioTrackInterface* audio_track, |
93 uint32 ssrc) {} | 93 uint32_t ssrc) {} |
94 virtual void OnAddLocalVideoTrack(webrtc::MediaStreamInterface* stream, | 94 virtual void OnAddLocalVideoTrack(webrtc::MediaStreamInterface* stream, |
95 webrtc::VideoTrackInterface* video_track, | 95 webrtc::VideoTrackInterface* video_track, |
96 uint32 ssrc) {} | 96 uint32_t ssrc) {} |
97 virtual void OnAddRemoteAudioTrack(webrtc::MediaStreamInterface* stream, | 97 virtual void OnAddRemoteAudioTrack(webrtc::MediaStreamInterface* stream, |
98 webrtc::AudioTrackInterface* audio_track, | 98 webrtc::AudioTrackInterface* audio_track, |
99 uint32 ssrc) {} | 99 uint32_t ssrc) {} |
100 virtual void OnAddRemoteVideoTrack(webrtc::MediaStreamInterface* stream, | 100 virtual void OnAddRemoteVideoTrack(webrtc::MediaStreamInterface* stream, |
101 webrtc::VideoTrackInterface* video_track, | 101 webrtc::VideoTrackInterface* video_track, |
102 uint32 ssrc) {} | 102 uint32_t ssrc) {} |
103 virtual void OnRemoveRemoteAudioTrack( | 103 virtual void OnRemoveRemoteAudioTrack( |
104 webrtc::MediaStreamInterface* stream, | 104 webrtc::MediaStreamInterface* stream, |
105 webrtc::AudioTrackInterface* audio_track) {} | 105 webrtc::AudioTrackInterface* audio_track) {} |
106 virtual void OnRemoveRemoteVideoTrack( | 106 virtual void OnRemoveRemoteVideoTrack( |
107 webrtc::MediaStreamInterface* stream, | 107 webrtc::MediaStreamInterface* stream, |
108 webrtc::VideoTrackInterface* video_track) {} | 108 webrtc::VideoTrackInterface* video_track) {} |
109 virtual void OnRemoveLocalAudioTrack(webrtc::MediaStreamInterface* stream, | 109 virtual void OnRemoveLocalAudioTrack(webrtc::MediaStreamInterface* stream, |
110 webrtc::AudioTrackInterface* audio_track, | 110 webrtc::AudioTrackInterface* audio_track, |
111 uint32 ssrc) {} | 111 uint32_t ssrc) {} |
112 virtual void OnRemoveLocalVideoTrack( | 112 virtual void OnRemoveLocalVideoTrack( |
113 webrtc::MediaStreamInterface* stream, | 113 webrtc::MediaStreamInterface* stream, |
114 webrtc::VideoTrackInterface* video_track) {} | 114 webrtc::VideoTrackInterface* video_track) {} |
115 virtual void OnRemoveLocalStream(webrtc::MediaStreamInterface* stream) {} | 115 virtual void OnRemoveLocalStream(webrtc::MediaStreamInterface* stream) {} |
116 | 116 |
117 private: | 117 private: |
118 rtc::scoped_refptr<webrtc::MediaStreamInterface> CreateStream( | 118 rtc::scoped_refptr<webrtc::MediaStreamInterface> CreateStream( |
119 const std::string& stream_label, | 119 const std::string& stream_label, |
120 const std::string& audio_track_id, | 120 const std::string& audio_track_id, |
121 const std::string& video_track_id) { | 121 const std::string& video_track_id) { |
122 rtc::scoped_refptr<webrtc::MediaStreamInterface> stream( | 122 rtc::scoped_refptr<webrtc::MediaStreamInterface> stream( |
123 webrtc::MediaStream::Create(stream_label)); | 123 webrtc::MediaStream::Create(stream_label)); |
124 | 124 |
125 if (!audio_track_id.empty()) { | 125 if (!audio_track_id.empty()) { |
126 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track( | 126 rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track( |
127 webrtc::AudioTrack::Create(audio_track_id, NULL)); | 127 webrtc::AudioTrack::Create(audio_track_id, NULL)); |
128 stream->AddTrack(audio_track); | 128 stream->AddTrack(audio_track); |
129 } | 129 } |
130 | 130 |
131 if (!video_track_id.empty()) { | 131 if (!video_track_id.empty()) { |
132 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( | 132 rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track( |
133 webrtc::VideoTrack::Create(video_track_id, NULL)); | 133 webrtc::VideoTrack::Create(video_track_id, NULL)); |
134 stream->AddTrack(video_track); | 134 stream->AddTrack(video_track); |
135 } | 135 } |
136 return stream; | 136 return stream; |
137 } | 137 } |
138 }; | 138 }; |
139 | 139 |
140 #endif // TALK_APP_WEBRTC_TEST_FAKEMEDIASTREAMSIGNALING_H_ | 140 #endif // TALK_APP_WEBRTC_TEST_FAKEMEDIASTREAMSIGNALING_H_ |
OLD | NEW |