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

Side by Side Diff: talk/media/base/videoengine_unittest.h

Issue 1655793003: Make cricket::VideoCapturer implement VideoSourceInterface (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed Android Created 4 years, 10 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 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // possible to test that the media processors are indeed being called when 96 // possible to test that the media processors are indeed being called when
97 // registered. 97 // registered.
98 template<class T> 98 template<class T>
99 class VideoEngineOverride : public T { 99 class VideoEngineOverride : public T {
100 public: 100 public:
101 VideoEngineOverride() : T() { 101 VideoEngineOverride() : T() {
102 } 102 }
103 virtual ~VideoEngineOverride() { 103 virtual ~VideoEngineOverride() {
104 } 104 }
105 bool is_camera_on() const { return T::GetVideoCapturer()->IsRunning(); } 105 bool is_camera_on() const { return T::GetVideoCapturer()->IsRunning(); }
106 void set_has_senders(bool has_senders) {
107 cricket::VideoCapturer* video_capturer = T::GetVideoCapturer();
108 if (has_senders) {
109 video_capturer->SignalVideoFrame.connect(this,
110 &VideoEngineOverride<T>::OnLocalFrame);
111 } else {
112 video_capturer->SignalVideoFrame.disconnect(this);
113 }
114 }
115 void OnLocalFrame(cricket::VideoCapturer*,
116 const cricket::VideoFrame*) {
117 }
118 void OnLocalFrameFormat(cricket::VideoCapturer*,
119 const cricket::VideoFormat*) {
120 }
121 106
122 void TriggerMediaFrame(uint32_t ssrc, 107 void TriggerMediaFrame(uint32_t ssrc,
123 cricket::VideoFrame* frame, 108 cricket::VideoFrame* frame,
124 bool* drop_frame) { 109 bool* drop_frame) {
125 T::SignalMediaFrame(ssrc, frame, drop_frame); 110 T::SignalMediaFrame(ssrc, frame, drop_frame);
126 } 111 }
127 }; 112 };
128 113
129 template<class E, class C> 114 template<class E, class C>
130 class VideoMediaChannelTest : public testing::Test, 115 class VideoMediaChannelTest : public testing::Test,
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 rtc::scoped_ptr<C> channel_; 1306 rtc::scoped_ptr<C> channel_;
1322 cricket::FakeNetworkInterface network_interface_; 1307 cricket::FakeNetworkInterface network_interface_;
1323 cricket::FakeVideoRenderer renderer_; 1308 cricket::FakeVideoRenderer renderer_;
1324 cricket::VideoMediaChannel::Error media_error_; 1309 cricket::VideoMediaChannel::Error media_error_;
1325 1310
1326 // Used by test cases where 2 streams are run on the same channel. 1311 // Used by test cases where 2 streams are run on the same channel.
1327 cricket::FakeVideoRenderer renderer2_; 1312 cricket::FakeVideoRenderer renderer2_;
1328 }; 1313 };
1329 1314
1330 #endif // TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT 1315 #endif // TALK_MEDIA_BASE_VIDEOENGINE_UNITTEST_H_ NOLINT
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698