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 21 matching lines...) Expand all Loading... |
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. | |
61 typedef std::vector<VideoRenderer*> VideoRenderers; | |
62 | |
63 explicit CaptureRenderAdapter(VideoCapturer* video_capturer); | 60 explicit CaptureRenderAdapter(VideoCapturer* video_capturer); |
64 void Init(); | 61 void Init(); |
65 | 62 |
66 // Callback for frames received from the capturer. | 63 // Callback for frames received from the capturer. |
67 void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame); | 64 void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame); |
68 | 65 |
69 VideoRenderers video_renderers_; | 66 // Just pointers since ownership is not handed over to this class. |
| 67 std::vector<rtc::VideoSinkInterface<VideoFrame>*> sinks_; |
70 VideoCapturer* video_capturer_; | 68 VideoCapturer* video_capturer_; |
71 // Critical section synchronizing the capture thread. | 69 // Critical section synchronizing the capture thread. |
72 rtc::CriticalSection capture_crit_; | 70 rtc::CriticalSection capture_crit_; |
73 }; | 71 }; |
74 | 72 |
75 } // namespace cricket | 73 } // namespace cricket |
76 | 74 |
77 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ | 75 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ |
OLD | NEW |