OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SERVICES_VIDEO_CAPTURE_MOJO_SHARED_MEMORY_BUFFER_TRACKER_H_ | 5 #ifndef SERVICES_VIDEO_CAPTURE_MOJO_SHARED_MEMORY_BUFFER_TRACKER_H_ |
6 #define SERVICES_VIDEO_CAPTURE_MOJO_SHARED_MEMORY_BUFFER_TRACKER_H_ | 6 #define SERVICES_VIDEO_CAPTURE_MOJO_SHARED_MEMORY_BUFFER_TRACKER_H_ |
7 | 7 |
8 #include "media/capture/video/video_capture_buffer_tracker.h" | 8 #include "media/capture/video/video_capture_buffer_tracker.h" |
9 #include "media/mojo/common/mojo_shared_buffer_video_frame.h" | 9 #include "media/mojo/common/mojo_shared_buffer_video_frame.h" |
10 | 10 |
11 namespace video_capture { | 11 namespace video_capture { |
12 | 12 |
13 // Tracker specifics for MojoSharedMemory. | 13 // Tracker specifics for MojoSharedMemory. |
14 class MojoSharedMemoryBufferTracker final | 14 class MojoSharedMemoryBufferTracker final |
15 : public media::VideoCaptureBufferTracker { | 15 : public media::VideoCaptureBufferTracker { |
16 public: | 16 public: |
17 MojoSharedMemoryBufferTracker(); | 17 MojoSharedMemoryBufferTracker(); |
18 ~MojoSharedMemoryBufferTracker() override; | 18 ~MojoSharedMemoryBufferTracker() override; |
19 | 19 |
20 // Implementation of media::VideoCaptureBufferTracker | 20 // Implementation of media::VideoCaptureBufferTracker |
21 bool Init(const gfx::Size& dimensions, | 21 bool Init(const gfx::Size& dimensions, |
22 media::VideoPixelFormat format, | 22 media::VideoPixelFormat format, |
23 media::VideoPixelStorage storage_type, | 23 media::VideoPixelStorage storage_type, |
24 base::Lock* lock) override; | 24 base::Lock* lock) override; |
25 std::unique_ptr<media::VideoCaptureBufferHandle> GetBufferHandle() override; | 25 std::unique_ptr<media::VideoCaptureBufferHandle> GetBufferHandle() override; |
26 bool ShareToProcess(base::ProcessHandle process_handle, | 26 mojo::ScopedSharedBufferHandle GetHandleForTransit() override; |
27 base::SharedMemoryHandle* new_handle) override; | |
28 | 27 |
29 private: | 28 private: |
30 friend class MojoSharedMemoryBufferHandle; | 29 friend class MojoSharedMemoryBufferHandle; |
31 | 30 |
32 scoped_refptr<media::MojoSharedBufferVideoFrame> frame_; | 31 scoped_refptr<media::MojoSharedBufferVideoFrame> frame_; |
33 size_t mapped_size_; | 32 size_t mapped_size_; |
34 }; | 33 }; |
35 | 34 |
36 } // namespace video_capture | 35 } // namespace video_capture |
37 | 36 |
38 #endif // SERVICES_VIDEO_CAPTURE_MOJO_SHARED_MEMORY_BUFFER_TRACKER_H_ | 37 #endif // SERVICES_VIDEO_CAPTURE_MOJO_SHARED_MEMORY_BUFFER_TRACKER_H_ |
OLD | NEW |