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