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 #include "base/callback.h" | 5 #include "base/callback.h" |
6 #include "media/capture/capture_export.h" | 6 #include "media/capture/capture_export.h" |
| 7 #include "media/capture/mojo/video_capture_types.mojom.h" |
7 #include "media/capture/video/video_capture_device.h" | 8 #include "media/capture/video/video_capture_device.h" |
| 9 #include "media/capture/video/video_frame_receiver.h" |
8 | 10 |
9 namespace media { | 11 namespace media { |
10 | 12 |
11 class CAPTURE_EXPORT VideoCaptureJpegDecoder { | 13 class CAPTURE_EXPORT VideoCaptureJpegDecoder { |
12 public: | 14 public: |
13 // Enumeration of decoder status. The enumeration is published for clients to | 15 // Enumeration of decoder status. The enumeration is published for clients to |
14 // decide the behavior according to STATUS. | 16 // decide the behavior according to STATUS. |
15 enum STATUS { | 17 enum STATUS { |
16 INIT_PENDING, // Default value while waiting initialization finished. | 18 INIT_PENDING, // Default value while waiting initialization finished. |
17 INIT_PASSED, // Initialization succeed. | 19 INIT_PASSED, // Initialization succeed. |
18 FAILED, // JPEG decode is not supported, initialization failed, or | 20 FAILED, // JPEG decode is not supported, initialization failed, or |
19 // decode error. | 21 // decode error. |
20 }; | 22 }; |
21 | 23 |
22 using DecodeDoneCB = | 24 using DecodeDoneCB = base::Callback<void( |
23 base::Callback<void(media::VideoCaptureDevice::Client::Buffer, | 25 int buffer_id, |
24 scoped_refptr<media::VideoFrame>)>; | 26 int frame_feedback_id, |
| 27 std::unique_ptr<VideoCaptureDevice::Client::Buffer:: |
| 28 ScopedAccessPermission> buffer_read_permission, |
| 29 mojom::VideoFrameInfoPtr frame_info)>; |
25 | 30 |
26 virtual ~VideoCaptureJpegDecoder() {} | 31 virtual ~VideoCaptureJpegDecoder() {} |
27 | 32 |
28 // Creates and intializes decoder asynchronously. | 33 // Creates and intializes decoder asynchronously. |
29 virtual void Initialize() = 0; | 34 virtual void Initialize() = 0; |
30 | 35 |
31 // Returns initialization status. | 36 // Returns initialization status. |
32 virtual STATUS GetStatus() const = 0; | 37 virtual STATUS GetStatus() const = 0; |
33 | 38 |
34 // Decodes a JPEG picture. | 39 // Decodes a JPEG picture. |
35 virtual void DecodeCapturedData( | 40 virtual void DecodeCapturedData( |
36 const uint8_t* data, | 41 const uint8_t* data, |
37 size_t in_buffer_size, | 42 size_t in_buffer_size, |
38 const media::VideoCaptureFormat& frame_format, | 43 const media::VideoCaptureFormat& frame_format, |
39 base::TimeTicks reference_time, | 44 base::TimeTicks reference_time, |
40 base::TimeDelta timestamp, | 45 base::TimeDelta timestamp, |
41 media::VideoCaptureDevice::Client::Buffer out_buffer) = 0; | 46 media::VideoCaptureDevice::Client::Buffer out_buffer) = 0; |
42 }; | 47 }; |
43 | 48 |
44 } // namespace media | 49 } // namespace media |
OLD | NEW |