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

Side by Side Diff: content/browser/renderer_host/media/video_capture_gpu_jpeg_decoder.h

Issue 2045813003: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 years, 6 months 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 CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // decide the behavior according to STATUS. 47 // decide the behavior according to STATUS.
48 enum STATUS { 48 enum STATUS {
49 INIT_PENDING, // Default value while waiting initialization finished. 49 INIT_PENDING, // Default value while waiting initialization finished.
50 INIT_PASSED, // Initialization succeed. 50 INIT_PASSED, // Initialization succeed.
51 FAILED, // JPEG decode is not supported, initialization failed, or 51 FAILED, // JPEG decode is not supported, initialization failed, or
52 // decode error. 52 // decode error.
53 }; 53 };
54 54
55 typedef base::Callback<void( 55 typedef base::Callback<void(
56 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer>, 56 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer>,
57 const scoped_refptr<media::VideoFrame>&, 57 const scoped_refptr<media::VideoFrame>&)>
58 const base::TimeTicks&)>
59 DecodeDoneCB; 58 DecodeDoneCB;
60 59
61 // |decode_done_cb| is called on the IO thread when decode succeed. This can 60 // |decode_done_cb| is called on the IO thread when decode succeed. This can
62 // be on any thread. |decode_done_cb| is never called after 61 // be on any thread. |decode_done_cb| is never called after
63 // VideoCaptureGpuJpegDecoder is destroyed. 62 // VideoCaptureGpuJpegDecoder is destroyed.
64 explicit VideoCaptureGpuJpegDecoder(const DecodeDoneCB& decode_done_cb); 63 explicit VideoCaptureGpuJpegDecoder(const DecodeDoneCB& decode_done_cb);
65 ~VideoCaptureGpuJpegDecoder() override; 64 ~VideoCaptureGpuJpegDecoder() override;
66 65
67 // Creates and intializes decoder asynchronously. 66 // Creates and intializes decoder asynchronously.
68 void Initialize(); 67 void Initialize();
69 68
70 // Returns initialization status. 69 // Returns initialization status.
71 STATUS GetStatus() const; 70 STATUS GetStatus() const;
72 71
73 // Decodes a JPEG picture. 72 // Decodes a JPEG picture.
74 void DecodeCapturedData( 73 void DecodeCapturedData(
75 const uint8_t* data, 74 const uint8_t* data,
76 size_t in_buffer_size, 75 size_t in_buffer_size,
77 const media::VideoCaptureFormat& frame_format, 76 const media::VideoCaptureFormat& frame_format,
78 const base::TimeTicks& timestamp, 77 base::TimeTicks reference_time,
78 base::TimeDelta timestamp,
79 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> out_buffer); 79 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> out_buffer);
80 80
81 // JpegDecodeAccelerator::Client implementation. 81 // JpegDecodeAccelerator::Client implementation.
82 // These will be called on IO thread. 82 // These will be called on IO thread.
83 void VideoFrameReady(int32_t buffer_id) override; 83 void VideoFrameReady(int32_t buffer_id) override;
84 void NotifyError(int32_t buffer_id, 84 void NotifyError(int32_t buffer_id,
85 media::JpegDecodeAccelerator::Error error) override; 85 media::JpegDecodeAccelerator::Error error) override;
86 86
87 private: 87 private:
88 // Initialization helper, to establish GPU channel. 88 // Initialization helper, to establish GPU channel.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 std::unique_ptr<base::SharedMemory> in_shared_memory_; 128 std::unique_ptr<base::SharedMemory> in_shared_memory_;
129 129
130 STATUS decoder_status_; 130 STATUS decoder_status_;
131 131
132 DISALLOW_COPY_AND_ASSIGN(VideoCaptureGpuJpegDecoder); 132 DISALLOW_COPY_AND_ASSIGN(VideoCaptureGpuJpegDecoder);
133 }; 133 };
134 134
135 } // namespace content 135 } // namespace content
136 136
137 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_ 137 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698