| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_VIDEO_CAPTURE_SCREEN_SHARED_DESKTOP_FRAME_H_ | |
| 6 #define MEDIA_VIDEO_CAPTURE_SCREEN_SHARED_DESKTOP_FRAME_H_ | |
| 7 | |
| 8 #include "base/memory/ref_counted.h" | |
| 9 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | |
| 10 | |
| 11 namespace media { | |
| 12 | |
| 13 // SharedDesktopFrame is a DesktopFrame that may have multiple instances all | |
| 14 // sharing the same buffer. | |
| 15 class SharedDesktopFrame : public webrtc::DesktopFrame { | |
| 16 public: | |
| 17 virtual ~SharedDesktopFrame(); | |
| 18 | |
| 19 static SharedDesktopFrame* Wrap(webrtc::DesktopFrame* desktop_frame); | |
| 20 | |
| 21 // Returns the underlying instance of DesktopFrame. | |
| 22 webrtc::DesktopFrame* GetUnderlyingFrame(); | |
| 23 | |
| 24 // Creates a clone of this object. | |
| 25 SharedDesktopFrame* Share(); | |
| 26 | |
| 27 // Checks if the frame is currently shared. If it returns false it's | |
| 28 // guaranteed that there are no clones of the object. | |
| 29 bool IsShared(); | |
| 30 | |
| 31 private: | |
| 32 class Core; | |
| 33 | |
| 34 SharedDesktopFrame(scoped_refptr<Core> core); | |
| 35 | |
| 36 scoped_refptr<Core> core_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(SharedDesktopFrame); | |
| 39 }; | |
| 40 | |
| 41 } // namespace media | |
| 42 | |
| 43 #endif // MEDIA_VIDEO_CAPTURE_SCREEN_SHARED_DESKTOP_FRAME_H_ | |
| OLD | NEW |