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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // well as pending rotation. If it can't apply the frame rotation by itself, | 120 // well as pending rotation. If it can't apply the frame rotation by itself, |
121 // it should call |frame|.GetCopyWithRotationApplied() to get a frame that has | 121 // it should call |frame|.GetCopyWithRotationApplied() to get a frame that has |
122 // the rotation applied. | 122 // the rotation applied. |
123 virtual void SetSize(int width, int height) {} | 123 virtual void SetSize(int width, int height) {} |
124 | 124 |
125 // |frame| may have pending rotation. For clients which can't apply rotation, | 125 // |frame| may have pending rotation. For clients which can't apply rotation, |
126 // |frame|->GetCopyWithRotationApplied() will return a frame that has the | 126 // |frame|->GetCopyWithRotationApplied() will return a frame that has the |
127 // rotation applied. | 127 // rotation applied. |
128 virtual void RenderFrame(const cricket::VideoFrame* frame) = 0; | 128 virtual void RenderFrame(const cricket::VideoFrame* frame) = 0; |
129 | 129 |
130 // TODO(guoweis): Remove this function. This is added as a temporary solution | |
131 // until chrome renderers can apply rotation. | |
132 // Whether the VideoRenderer has the ability to rotate the frame before being | |
133 // displayed. The rotation of a frame is carried by | |
134 // VideoFrame.GetVideoRotation() and is the clockwise angle the frames must be | |
135 // rotated in order to display the frames correctly. If returning false, the | |
136 // frame's rotation must be applied before being delivered by RenderFrame. | |
137 virtual bool CanApplyRotation() { return false; } | |
138 | |
139 protected: | 130 protected: |
140 // The destructor is protected to prevent deletion via the interface. | 131 // The destructor is protected to prevent deletion via the interface. |
141 // This is so that we allow reference counted classes, where the destructor | 132 // This is so that we allow reference counted classes, where the destructor |
142 // should never be public, to implement the interface. | 133 // should never be public, to implement the interface. |
143 virtual ~VideoRendererInterface() {} | 134 virtual ~VideoRendererInterface() {} |
144 }; | 135 }; |
145 | 136 |
146 class VideoSourceInterface; | 137 class VideoSourceInterface; |
147 | 138 |
148 class VideoTrackInterface : public MediaStreamTrackInterface { | 139 class VideoTrackInterface : public MediaStreamTrackInterface { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; | 264 virtual bool RemoveTrack(AudioTrackInterface* track) = 0; |
274 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; | 265 virtual bool RemoveTrack(VideoTrackInterface* track) = 0; |
275 | 266 |
276 protected: | 267 protected: |
277 virtual ~MediaStreamInterface() {} | 268 virtual ~MediaStreamInterface() {} |
278 }; | 269 }; |
279 | 270 |
280 } // namespace webrtc | 271 } // namespace webrtc |
281 | 272 |
282 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ | 273 #endif // TALK_APP_WEBRTC_MEDIASTREAMINTERFACE_H_ |
OLD | NEW |