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

Side by Side Diff: webrtc/api/test/fakeperiodicvideocapturer.h

Issue 1733673002: Removed unused cricket::VideoCapturer methods (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed thread checker for android. SetCaptureFormat is called on the thread where the capturer is cr… 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
« no previous file with comments | « webrtc/api/androidvideocapturer.cc ('k') | webrtc/api/videosource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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
11 // FakePeriodicVideoCapturer implements a fake cricket::VideoCapturer that 11 // FakePeriodicVideoCapturer implements a fake cricket::VideoCapturer that
12 // creates video frames periodically after it has been started. 12 // creates video frames periodically after it has been started.
13 13
14 #ifndef WEBRTC_API_TEST_FAKEPERIODICVIDEOCAPTURER_H_ 14 #ifndef WEBRTC_API_TEST_FAKEPERIODICVIDEOCAPTURER_H_
15 #define WEBRTC_API_TEST_FAKEPERIODICVIDEOCAPTURER_H_ 15 #define WEBRTC_API_TEST_FAKEPERIODICVIDEOCAPTURER_H_
16 16
17 #include "webrtc/base/thread.h" 17 #include "webrtc/base/thread.h"
18 #include "webrtc/media/base/fakevideocapturer.h" 18 #include "webrtc/media/base/fakevideocapturer.h"
19 19
20 namespace webrtc { 20 namespace webrtc {
21 21
22 class FakePeriodicVideoCapturer : public cricket::FakeVideoCapturer { 22 class FakePeriodicVideoCapturer : public cricket::FakeVideoCapturer,
23 public rtc::MessageHandler {
23 public: 24 public:
24 FakePeriodicVideoCapturer() { 25 FakePeriodicVideoCapturer() {
25 std::vector<cricket::VideoFormat> formats; 26 std::vector<cricket::VideoFormat> formats;
26 formats.push_back(cricket::VideoFormat(1280, 720, 27 formats.push_back(cricket::VideoFormat(1280, 720,
27 cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420)); 28 cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
28 formats.push_back(cricket::VideoFormat(640, 480, 29 formats.push_back(cricket::VideoFormat(640, 480,
29 cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420)); 30 cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
30 formats.push_back(cricket::VideoFormat(640, 360, 31 formats.push_back(cricket::VideoFormat(640, 360,
31 cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420)); 32 cricket::VideoFormat::FpsToInterval(30), cricket::FOURCC_I420));
32 formats.push_back(cricket::VideoFormat(320, 240, 33 formats.push_back(cricket::VideoFormat(320, 240,
(...skipping 15 matching lines...) Expand all
48 } 49 }
49 // Inherited from MesageHandler. 50 // Inherited from MesageHandler.
50 virtual void OnMessage(rtc::Message* msg) { 51 virtual void OnMessage(rtc::Message* msg) {
51 if (msg->message_id == MSG_CREATEFRAME) { 52 if (msg->message_id == MSG_CREATEFRAME) {
52 if (IsRunning()) { 53 if (IsRunning()) {
53 CaptureFrame(); 54 CaptureFrame();
54 rtc::Thread::Current()->PostDelayed(static_cast<int>( 55 rtc::Thread::Current()->PostDelayed(static_cast<int>(
55 GetCaptureFormat()->interval / rtc::kNumNanosecsPerMillisec), 56 GetCaptureFormat()->interval / rtc::kNumNanosecsPerMillisec),
56 this, MSG_CREATEFRAME); 57 this, MSG_CREATEFRAME);
57 } 58 }
58 } else {
59 FakeVideoCapturer::OnMessage(msg);
60 } 59 }
61 } 60 }
62 61
63 private: 62 private:
64 enum { 63 enum {
65 // Offset 0xFF to make sure this don't collide with base class messages. 64 // Offset 0xFF to make sure this don't collide with base class messages.
66 MSG_CREATEFRAME = 0xFF 65 MSG_CREATEFRAME = 0xFF
67 }; 66 };
68 }; 67 };
69 68
70 } // namespace webrtc 69 } // namespace webrtc
71 70
72 #endif // WEBRTC_API_TEST_FAKEPERIODICVIDEOCAPTURER_H_ 71 #endif // WEBRTC_API_TEST_FAKEPERIODICVIDEOCAPTURER_H_
OLDNEW
« no previous file with comments | « webrtc/api/androidvideocapturer.cc ('k') | webrtc/api/videosource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698