Chromium Code Reviews| 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 underlying instance of DesktopFrame. | |
|
alexeypa (please no reviews)
2013/05/13 17:02:00
nit: Returns the underlying instance...
Sergey Ulanov
2013/05/13 21:16:52
Done.
| |
| 22 webrtc::DesktopFrame* GetUnderlyingFrame(); | |
| 23 | |
| 24 // Creates a clone of this object. | |
| 25 SharedDesktopFrame* Share(); | |
|
alexeypa (please no reviews)
2013/05/13 17:02:00
nit: Share() -> Clone()?
Sergey Ulanov
2013/05/13 21:16:52
I think it's better to call it Share() because the
| |
| 26 | |
| 27 // Checks if the frame is currently shared or not. If it returns true it's | |
| 28 // guaranteed that there are no clones of the object. | |
| 29 bool IsNotShared(); | |
|
alexeypa (please no reviews)
2013/05/13 17:02:00
nit: IsShared() is shorter and can always be negat
Sergey Ulanov
2013/05/13 21:16:52
Done.
| |
| 30 | |
| 31 private: | |
| 32 class Core; | |
| 33 | |
| 34 SharedDesktopFrame(scoped_refptr<Core> core); | |
| 35 | |
| 36 scoped_refptr<Core> core_; | |
|
alexeypa (please no reviews)
2013/05/13 17:02:00
nit: You don't really need a full blown Core class
Sergey Ulanov
2013/05/13 21:16:52
I'm not sure how that would work - scoped_ptr<> do
alexeypa (please no reviews)
2013/05/13 22:37:37
Yes, you are right. That totally wouldn't work. :(
| |
| 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 |