Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: components/video_capture/mojo_video_frame.h

Issue 1637793004: [WIP] Mojo Video Capture thingy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: heave!! Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 COMPONENTS_VIDEO_CAPTURE_MOJO_VIDEO_FRAME_H_
6 #define COMPONENTS_VIDEO_CAPTURE_MOJO_VIDEO_FRAME_H_
7
8 #include "base/memory/ref_counted.h"
9 #include "base/time/time.h"
10 #include "media/base/video_frame.h"
11 #include "media/base/video_types.h"
12 #include "mojo/public/cpp/system/buffer.h"
13
14 namespace gfx {
15 class Size;
16 }
17
18 namespace video_capture {
19
20 // A derived class of media::VideoFrame holding a mojo::SharedBuffer which is
21 // mapped on constructor and remains so for the lifetime of the MojoVideoFrame.
22 // The underlying VideoFrame uses this SharedBuffer as storage. MojoVideoFrames
23 // frames are ref-counted, always I420, and coded_size() == natural_size() ==
24 // visible_rect().
25 class MojoVideoFrame : public media::VideoFrame {
26 public:
27 static scoped_refptr<MojoVideoFrame> CreateMojoVideoFrame(
28 const gfx::Size& dimensions,
29 base::TimeDelta timestamp);
30
31 explicit MojoVideoFrame(const gfx::Size& dimensions,
32 base::TimeDelta timestamp);
33
34 mojo::SharedBufferHandle handle() { return shared_buffer_.handle.get(); }
35 size_t mapped_size() const { return shared_buffer_size_; }
36
37 private:
38 ~MojoVideoFrame() override;
39
40 const size_t shared_buffer_size_;
41 const mojo::SharedBuffer shared_buffer_;
42 };
43
44 } // namespace video_capture
45
46 #endif // COMPONENTS_VIDEO_CAPTURE_MOJO_VIDEO_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698