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" | |
43 | 42 |
44 namespace cricket { | 43 namespace cricket { |
45 | 44 |
46 class VideoCapturer; | 45 class VideoCapturer; |
47 class VideoProcessor; | 46 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 AddSink(rtc::VideoSinkInterface<VideoFrame>* sink); | 54 void AddRenderer(VideoRenderer* video_renderer); |
55 void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink); | 55 void RemoveRenderer(VideoRenderer* video_renderer); |
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 |
60 explicit CaptureRenderAdapter(VideoCapturer* video_capturer); | 63 explicit CaptureRenderAdapter(VideoCapturer* video_capturer); |
61 void Init(); | 64 void Init(); |
62 | 65 |
63 // Callback for frames received from the capturer. | 66 // Callback for frames received from the capturer. |
64 void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame); | 67 void OnVideoFrame(VideoCapturer* capturer, const VideoFrame* video_frame); |
65 | 68 |
66 // Just pointers since ownership is not handed over to this class. | 69 VideoRenderers video_renderers_; |
67 std::vector<rtc::VideoSinkInterface<VideoFrame>*> sinks_; | |
68 VideoCapturer* video_capturer_; | 70 VideoCapturer* video_capturer_; |
69 // Critical section synchronizing the capture thread. | 71 // Critical section synchronizing the capture thread. |
70 rtc::CriticalSection capture_crit_; | 72 rtc::CriticalSection capture_crit_; |
71 }; | 73 }; |
72 | 74 |
73 } // namespace cricket | 75 } // namespace cricket |
74 | 76 |
75 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ | 77 #endif // TALK_MEDIA_BASE_CAPTURERENDERADAPTER_H_ |
OLD | NEW |