Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: webrtc/media/engine/fakewebrtccall.h

Issue 2770233003: Implemented the GetSources() in native code. (Closed)
Patch Set: Merge and add the tests. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 #include "webrtc/api/video/video_frame.h" 27 #include "webrtc/api/video/video_frame.h"
28 #include "webrtc/base/buffer.h" 28 #include "webrtc/base/buffer.h"
29 #include "webrtc/call/audio_receive_stream.h" 29 #include "webrtc/call/audio_receive_stream.h"
30 #include "webrtc/call/audio_send_stream.h" 30 #include "webrtc/call/audio_send_stream.h"
31 #include "webrtc/call/call.h" 31 #include "webrtc/call/call.h"
32 #include "webrtc/call/flexfec_receive_stream.h" 32 #include "webrtc/call/flexfec_receive_stream.h"
33 #include "webrtc/video_receive_stream.h" 33 #include "webrtc/video_receive_stream.h"
34 #include "webrtc/video_send_stream.h" 34 #include "webrtc/video_send_stream.h"
35 35
36 namespace webrtc {
37 class RtpContributingSources;
38 } // namespace webrtc
39
36 namespace cricket { 40 namespace cricket {
37 class FakeAudioSendStream final : public webrtc::AudioSendStream { 41 class FakeAudioSendStream final : public webrtc::AudioSendStream {
38 public: 42 public:
39 struct TelephoneEvent { 43 struct TelephoneEvent {
40 int payload_type = -1; 44 int payload_type = -1;
41 int payload_frequency = -1; 45 int payload_frequency = -1;
42 int event_code = 0; 46 int event_code = 0;
43 int duration_ms = 0; 47 int duration_ms = 0;
44 }; 48 };
45 49
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 94
91 private: 95 private:
92 // webrtc::AudioReceiveStream implementation. 96 // webrtc::AudioReceiveStream implementation.
93 void Start() override { started_ = true; } 97 void Start() override { started_ = true; }
94 void Stop() override { started_ = false; } 98 void Stop() override { started_ = false; }
95 99
96 webrtc::AudioReceiveStream::Stats GetStats() const override; 100 webrtc::AudioReceiveStream::Stats GetStats() const override;
97 int GetOutputLevel() const override { return 0; } 101 int GetOutputLevel() const override { return 0; }
98 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override; 102 void SetSink(std::unique_ptr<webrtc::AudioSinkInterface> sink) override;
99 void SetGain(float gain) override; 103 void SetGain(float gain) override;
104 const std::vector<webrtc::RtpContributingSource*>& GetContributingSources()
105 override {
106 return contributing_sources_;
107 }
100 108
101 int id_ = -1; 109 int id_ = -1;
102 webrtc::AudioReceiveStream::Config config_; 110 webrtc::AudioReceiveStream::Config config_;
103 webrtc::AudioReceiveStream::Stats stats_; 111 webrtc::AudioReceiveStream::Stats stats_;
104 int received_packets_ = 0; 112 int received_packets_ = 0;
105 std::unique_ptr<webrtc::AudioSinkInterface> sink_; 113 std::unique_ptr<webrtc::AudioSinkInterface> sink_;
106 float gain_ = 1.0f; 114 float gain_ = 1.0f;
107 rtc::Buffer last_packet_; 115 rtc::Buffer last_packet_;
108 bool started_ = false; 116 bool started_ = false;
117 std::vector<webrtc::RtpContributingSource*> contributing_sources_;
109 }; 118 };
110 119
111 class FakeVideoSendStream final 120 class FakeVideoSendStream final
112 : public webrtc::VideoSendStream, 121 : public webrtc::VideoSendStream,
113 public rtc::VideoSinkInterface<webrtc::VideoFrame> { 122 public rtc::VideoSinkInterface<webrtc::VideoFrame> {
114 public: 123 public:
115 FakeVideoSendStream(webrtc::VideoSendStream::Config config, 124 FakeVideoSendStream(webrtc::VideoSendStream::Config config,
116 webrtc::VideoEncoderConfig encoder_config); 125 webrtc::VideoEncoderConfig encoder_config);
117 ~FakeVideoSendStream() override; 126 ~FakeVideoSendStream() override;
118 const webrtc::VideoSendStream::Config& GetConfig() const; 127 const webrtc::VideoSendStream::Config& GetConfig() const;
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 318
310 int num_created_send_streams_; 319 int num_created_send_streams_;
311 int num_created_receive_streams_; 320 int num_created_receive_streams_;
312 321
313 int audio_transport_overhead_; 322 int audio_transport_overhead_;
314 int video_transport_overhead_; 323 int video_transport_overhead_;
315 }; 324 };
316 325
317 } // namespace cricket 326 } // namespace cricket
318 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_ 327 #endif // WEBRTC_MEDIA_ENGINE_FAKEWEBRTCCALL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698