| OLD | NEW |
| (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 MEDIA_MOJO_SERVICES_MOJO_VIDEO_FRAME_H_ |
| 6 #define MEDIA_MOJO_SERVICES_MOJO_VIDEO_FRAME_H_ |
| 7 |
| 8 #include <stddef.h> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "media/base/media_export.h" |
| 12 #include "media/base/video_frame.h" |
| 13 #include "mojo/public/cpp/system/buffer.h" |
| 14 |
| 15 namespace media { |
| 16 |
| 17 class MEDIA_EXPORT MojoVideoFrame : public VideoFrame { |
| 18 public: |
| 19 static scoped_refptr<VideoFrame> Create(VideoPixelFormat format, |
| 20 const gfx::Size& coded_size, |
| 21 const gfx::Rect& visible_rect, |
| 22 const gfx::Size& natural_size, |
| 23 int32_t y_stride, |
| 24 int32_t u_stride, |
| 25 int32_t v_stride, |
| 26 mojo::ScopedSharedBufferHandle handle, |
| 27 size_t data_size, |
| 28 size_t y_offset, |
| 29 size_t u_offset, |
| 30 size_t v_offset, |
| 31 base::TimeDelta timestamp); |
| 32 |
| 33 // Returns the mojo shared memory handle, if present. This object continues |
| 34 // to own the handle. |
| 35 mojo::SharedBufferHandle mojo_shared_memory_handle() const; |
| 36 |
| 37 // Returns the size of the shared memory. |
| 38 size_t mojo_shared_memory_size() const; |
| 39 |
| 40 // Returns the offsets relative to the start of |mojo_shared_memory_handle| |
| 41 // for the |plane| specified. |
| 42 size_t plane_offset(size_t plane) const; |
| 43 |
| 44 private: |
| 45 MojoVideoFrame(VideoPixelFormat format, |
| 46 StorageType storage_type, |
| 47 const gfx::Size& coded_size, |
| 48 const gfx::Rect& visible_rect, |
| 49 const gfx::Size& natural_size, |
| 50 base::TimeDelta timestamp); |
| 51 ~MojoVideoFrame() override; |
| 52 |
| 53 // SharedBufferHandle attached to the video_frame. |
| 54 mojo::ScopedSharedBufferHandle mojo_shared_memory_handle_; |
| 55 size_t mojo_shared_memory_size_; |
| 56 size_t offsets_[kMaxPlanes]; |
| 57 |
| 58 DISALLOW_IMPLICIT_CONSTRUCTORS(MojoVideoFrame); |
| 59 }; |
| 60 |
| 61 } // namespace media |
| 62 |
| 63 #endif // MEDIA_MOJO_SERVICES_MOJO_VIDEO_FRAME_H_ |
| OLD | NEW |