OLD | NEW |
---|---|
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 20 matching lines...) Expand all Loading... | |
31 // CaptureRenderAdapter is Thread-unsafe. This means that none of its APIs may | 31 // CaptureRenderAdapter is Thread-unsafe. This means that none of its APIs may |
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" | |
42 #include "webrtc/media/base/videosinkinterface.h" | 41 #include "webrtc/media/base/videosinkinterface.h" |
43 | 42 |
44 namespace cricket { | 43 namespace cricket { |
45 | 44 |
46 class VideoCapturer; | 45 class VideoCapturer; |
47 class VideoProcessor; | 46 class VideoProcessor; |
48 | 47 |
49 class CaptureRenderAdapter : public sigslot::has_slots<> { | 48 class CaptureRenderAdapter : public rtc::VideoSinkInterface<VideoFrame> { |
nisse-webrtc
2016/02/03 09:16:34
After these changes, it looks like this class is
pthatcher1
2016/02/03 15:38:35
I'd like it if we can just remove this class altog
perkj_webrtc
2016/02/08 14:32:00
I think this can be removed later yes. But since t
| |
50 public: | 49 public: |
51 static CaptureRenderAdapter* Create(VideoCapturer* video_capturer); | 50 static CaptureRenderAdapter* Create(VideoCapturer* video_capturer); |
52 ~CaptureRenderAdapter(); | 51 ~CaptureRenderAdapter(); |
53 | 52 |
54 void AddSink(rtc::VideoSinkInterface<VideoFrame>* sink); | 53 void AddSink(rtc::VideoSinkInterface<VideoFrame>* sink); |
55 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink); | 54 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink); |
56 | 55 |
57 VideoCapturer* video_capturer() { return video_capturer_; } | 56 VideoCapturer* video_capturer() { return video_capturer_; } |
57 | |
58 private: | 58 private: |
59 | |
60 explicit CaptureRenderAdapter(VideoCapturer* video_capturer); | 59 explicit CaptureRenderAdapter(VideoCapturer* video_capturer); |
61 void Init(); | 60 void Init(); |
62 | 61 |
63 // Callback for frames received from the capturer. | 62 // Callback for frames received from the capturer. |
64 void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame); | 63 void OnFrame(const VideoFrame& frame) override; |
65 | 64 |
66 // Just pointers since ownership is not handed over to this class. | 65 // Just pointers since ownership is not handed over to this class. |
67 std::vector<rtc::VideoSinkInterface<VideoFrame>*> sinks_; | 66 std::vector<rtc::VideoSinkInterface<VideoFrame>*> sinks_; |
68 VideoCapturer* video_capturer_; | 67 VideoCapturer* video_capturer_; |
69 // Critical section synchronizing the capture thread. | 68 // Critical section synchronizing the capture thread. |
70 rtc::CriticalSection capture_crit_; | 69 rtc::CriticalSection capture_crit_; |
71 }; | 70 }; |
72 | 71 |
73 } // namespace cricket | 72 } // namespace cricket |
74 | 73 |
75 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ | 74 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ |
OLD | NEW |