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

Side by Side Diff: media/capture/video/video_capture_device_client.h

Issue 2490153003: [Mojo Video Capture] Replace const scoped_refptr<T>& with scoped_refptr<T> and use std::move (Closed)
Patch Set: fix bots Created 4 years, 1 month 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ 5 #ifndef MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_
6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ 6 #define MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 27 matching lines...) Expand all
38 // It has an internal ref counted TextureWrapHelper class used to wrap incoming 38 // It has an internal ref counted TextureWrapHelper class used to wrap incoming
39 // GpuMemoryBuffers into Texture backed VideoFrames. This class creates and 39 // GpuMemoryBuffers into Texture backed VideoFrames. This class creates and
40 // manages the necessary entities to interact with the GPU process, notably an 40 // manages the necessary entities to interact with the GPU process, notably an
41 // offscreen Context to avoid janking the UI thread. 41 // offscreen Context to avoid janking the UI thread.
42 class CAPTURE_EXPORT VideoCaptureDeviceClient 42 class CAPTURE_EXPORT VideoCaptureDeviceClient
43 : public media::VideoCaptureDevice::Client, 43 : public media::VideoCaptureDevice::Client,
44 public base::SupportsWeakPtr<VideoCaptureDeviceClient> { 44 public base::SupportsWeakPtr<VideoCaptureDeviceClient> {
45 public: 45 public:
46 VideoCaptureDeviceClient( 46 VideoCaptureDeviceClient(
47 std::unique_ptr<VideoFrameReceiver> receiver, 47 std::unique_ptr<VideoFrameReceiver> receiver,
48 const scoped_refptr<VideoCaptureBufferPool>& buffer_pool, 48 scoped_refptr<VideoCaptureBufferPool> buffer_pool,
49 const VideoCaptureJpegDecoderFactoryCB& jpeg_decoder_factory); 49 const VideoCaptureJpegDecoderFactoryCB& jpeg_decoder_factory);
50 ~VideoCaptureDeviceClient() override; 50 ~VideoCaptureDeviceClient() override;
51 51
52 // VideoCaptureDevice::Client implementation. 52 // VideoCaptureDevice::Client implementation.
53 void OnIncomingCapturedData(const uint8_t* data, 53 void OnIncomingCapturedData(const uint8_t* data,
54 int length, 54 int length,
55 const media::VideoCaptureFormat& frame_format, 55 const media::VideoCaptureFormat& frame_format,
56 int rotation, 56 int rotation,
57 base::TimeTicks reference_time, 57 base::TimeTicks reference_time,
58 base::TimeDelta timestamp) override; 58 base::TimeDelta timestamp) override;
59 std::unique_ptr<Buffer> ReserveOutputBuffer( 59 std::unique_ptr<Buffer> ReserveOutputBuffer(
60 const gfx::Size& dimensions, 60 const gfx::Size& dimensions,
61 media::VideoPixelFormat format, 61 media::VideoPixelFormat format,
62 media::VideoPixelStorage storage) override; 62 media::VideoPixelStorage storage) override;
63 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, 63 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
64 const media::VideoCaptureFormat& frame_format, 64 const media::VideoCaptureFormat& frame_format,
65 base::TimeTicks reference_time, 65 base::TimeTicks reference_time,
66 base::TimeDelta timestamp) override; 66 base::TimeDelta timestamp) override;
67 void OnIncomingCapturedVideoFrame( 67 void OnIncomingCapturedVideoFrame(
68 std::unique_ptr<Buffer> buffer, 68 std::unique_ptr<Buffer> buffer,
69 const scoped_refptr<media::VideoFrame>& frame) override; 69 scoped_refptr<media::VideoFrame> frame) override;
70 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( 70 std::unique_ptr<Buffer> ResurrectLastOutputBuffer(
71 const gfx::Size& dimensions, 71 const gfx::Size& dimensions,
72 media::VideoPixelFormat format, 72 media::VideoPixelFormat format,
73 media::VideoPixelStorage storage) override; 73 media::VideoPixelStorage storage) override;
74 void OnError(const tracked_objects::Location& from_here, 74 void OnError(const tracked_objects::Location& from_here,
75 const std::string& reason) override; 75 const std::string& reason) override;
76 void OnLog(const std::string& message) override; 76 void OnLog(const std::string& message) override;
77 double GetBufferPoolUtilization() const override; 77 double GetBufferPoolUtilization() const override;
78 78
79 private: 79 private:
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 #endif // DCHECK_IS_ON() 122 #endif // DCHECK_IS_ON()
123 123
124 media::VideoPixelFormat last_captured_pixel_format_; 124 media::VideoPixelFormat last_captured_pixel_format_;
125 125
126 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient); 126 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceClient);
127 }; 127 };
128 128
129 } // namespace media 129 } // namespace media
130 130
131 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_ 131 #endif // MEDIA_CAPTURE_VIDEO_VIDEO_CAPTURE_DEVICE_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698