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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 #ifndef TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ | 34 #ifndef TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ |
35 #define TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ | 35 #define TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ |
36 | 36 |
37 #include <string> | 37 #include <string> |
38 #include <vector> | 38 #include <vector> |
39 | 39 |
40 #include "webrtc/base/basictypes.h" | 40 #include "webrtc/base/basictypes.h" |
41 #include "webrtc/base/refcount.h" | 41 #include "webrtc/base/refcount.h" |
42 #include "webrtc/base/scoped_ref_ptr.h" | 42 #include "webrtc/base/scoped_ref_ptr.h" |
43 #include "webrtc/media/base/videosinkinterface.h" | |
44 | 43 |
45 namespace cricket { | 44 namespace cricket { |
46 | 45 |
47 class AudioRenderer; | 46 class AudioRenderer; |
48 class VideoCapturer; | 47 class VideoCapturer; |
49 class VideoRenderer; | 48 class VideoRenderer; |
50 class VideoFrame; | 49 class VideoFrame; |
51 | 50 |
52 } // namespace cricket | 51 } // namespace cricket |
53 | 52 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 virtual TrackState state() const = 0; | 109 virtual TrackState state() const = 0; |
111 virtual bool set_enabled(bool enable) = 0; | 110 virtual bool set_enabled(bool enable) = 0; |
112 // These methods should be called by implementation only. | 111 // These methods should be called by implementation only. |
113 virtual bool set_state(TrackState new_state) = 0; | 112 virtual bool set_state(TrackState new_state) = 0; |
114 | 113 |
115 protected: | 114 protected: |
116 virtual ~MediaStreamTrackInterface() {} | 115 virtual ~MediaStreamTrackInterface() {} |
117 }; | 116 }; |
118 | 117 |
119 // Interface for rendering VideoFrames from a VideoTrack | 118 // Interface for rendering VideoFrames from a VideoTrack |
120 class VideoRendererInterface | 119 class VideoRendererInterface { |
121 : public rtc::VideoSinkInterface<cricket::VideoFrame> { | |
122 public: | 120 public: |
123 // |frame| may have pending rotation. For clients which can't apply rotation, | 121 // |frame| may have pending rotation. For clients which can't apply rotation, |
124 // |frame|->GetCopyWithRotationApplied() will return a frame that has the | 122 // |frame|->GetCopyWithRotationApplied() will return a frame that has the |
125 // rotation applied. | 123 // rotation applied. |
126 virtual void RenderFrame(const cricket::VideoFrame* frame) = 0; | 124 virtual void RenderFrame(const cricket::VideoFrame* frame) = 0; |
127 // Intended to replace RenderFrame. | |
128 void OnFrame(const cricket::VideoFrame& frame) override { | |
129 RenderFrame(&frame); | |
130 } | |
131 | 125 |
132 protected: | 126 protected: |
133 // The destructor is protected to prevent deletion via the interface. | 127 // The destructor is protected to prevent deletion via the interface. |
134 // This is so that we allow reference counted classes, where the destructor | 128 // This is so that we allow reference counted classes, where the destructor |
135 // should never be public, to implement the interface. | 129 // should never be public, to implement the interface. |
136 virtual ~VideoRendererInterface() {} | 130 virtual ~VideoRendererInterface() {} |
137 }; | 131 }; |
138 | 132 |
139 class VideoSourceInterface; | 133 class VideoSourceInterface; |
140 | 134 |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; | 267 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; |
274 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; | 268 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; |
275 | 269 |
276 protected: | 270 protected: |
277 virtual ~MediaStreamInterface() {} | 271 virtual ~MediaStreamInterface() {} |
278 }; | 272 }; |
279 | 273 |
280 } // namespace webrtc | 274 } // namespace webrtc |
281 | 275 |
282 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ | 276 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ |
OLD | NEW |