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

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

Issue 1594973006: New rtc::VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Use rtc::VideoSinkInterface on the call chain VideoSource --> CaptureRenderAdapter Created 4 years, 11 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 2012 Google Inc. 3 * Copyright 2012 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 21 matching lines...) Expand all
32 // be called concurrently. 32 // be called concurrently.
33 33
34 #ifndef TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ 34 #ifndef TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_
35 #define TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ 35 #define TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_
36 36
37 #include <vector> 37 #include <vector>
38 38
39 #include "talk/media/base/videocapturer.h" 39 #include "talk/media/base/videocapturer.h"
40 #include "webrtc/base/criticalsection.h" 40 #include "webrtc/base/criticalsection.h"
41 #include "webrtc/base/sigslot.h" 41 #include "webrtc/base/sigslot.h"
42 #include "webrtc/media/base/videosinkinterface.h"
42 43
43 namespace cricket { 44 namespace cricket {
44 45
45 class VideoCapturer; 46 class VideoCapturer;
46 class VideoProcessor; 47 class VideoProcessor;
47 class VideoRenderer;
48 48
49 class CaptureRenderAdapter : public sigslot::has_slots<> { 49 class CaptureRenderAdapter : public sigslot::has_slots<> {
50 public: 50 public:
51 static CaptureRenderAdapter* Create(VideoCapturer* video_capturer); 51 static CaptureRenderAdapter* Create(VideoCapturer* video_capturer);
52 ~CaptureRenderAdapter(); 52 ~CaptureRenderAdapter();
53 53
54 void AddRenderer(VideoRenderer* video_renderer); 54 void AddSink(rtc::VideoSinkInterface<VideoFrame>* sink);
55 void RemoveRenderer(VideoRenderer* video_renderer); 55 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink);
56 56
57 VideoCapturer* video_capturer() { return video_capturer_; } 57 VideoCapturer* video_capturer() { return video_capturer_; }
58 private: 58 private:
59 59
60 // Just pointers since ownership is not handed over to this class. 60 // Just pointers since ownership is not handed over to this class.
61 typedef std::vector<VideoRenderer*> VideoRenderers; 61 typedef std::vector<rtc::VideoSinkInterface<VideoFrame>*> VideoSinks;
pthatcher1 2016/01/27 01:11:03 Can you just remove this typedef? It looks like i
nisse-webrtc 2016/01/27 09:08:51 Done.
62 62
63 explicit CaptureRenderAdapter(VideoCapturer* video_capturer); 63 explicit CaptureRenderAdapter(VideoCapturer* video_capturer);
64 void Init(); 64 void Init();
65 65
66 // Callback for frames received from the capturer. 66 // Callback for frames received from the capturer.
67 void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame); 67 void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame);
68 68
69 VideoRenderers video_renderers_; 69 VideoSinks sinks_;
70 VideoCapturer* video_capturer_; 70 VideoCapturer* video_capturer_;
71 // Critical section synchronizing the capture thread. 71 // Critical section synchronizing the capture thread.
72 mutable rtc::CriticalSection capture_crit_; 72 mutable rtc::CriticalSection capture_crit_;
73 }; 73 };
74 74
75 } // namespace cricket 75 } // namespace cricket
76 76
77 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ 77 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698