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

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: 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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&)> 58 base::TimeTicks)>
59 DecodeDoneCB; 59 DecodeDoneCB;
60 60
61 // |decode_done_cb| is called on the IO thread when decode succeed. This can 61 // |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 62 // be on any thread. |decode_done_cb| is never called after
63 // VideoCaptureGpuJpegDecoder is destroyed. 63 // VideoCaptureGpuJpegDecoder is destroyed.
64 explicit VideoCaptureGpuJpegDecoder(const DecodeDoneCB& decode_done_cb); 64 explicit VideoCaptureGpuJpegDecoder(const DecodeDoneCB& decode_done_cb);
65 ~VideoCaptureGpuJpegDecoder() override; 65 ~VideoCaptureGpuJpegDecoder() override;
66 66
67 // Creates and intializes decoder asynchronously. 67 // Creates and intializes decoder asynchronously.
68 void Initialize(); 68 void Initialize();
69 69
70 // Returns initialization status. 70 // Returns initialization status.
71 STATUS GetStatus() const; 71 STATUS GetStatus() const;
72 72
73 // Decodes a JPEG picture. 73 // Decodes a JPEG picture.
74 void DecodeCapturedData( 74 void DecodeCapturedData(
75 const uint8_t* data, 75 const uint8_t* data,
76 size_t in_buffer_size, 76 size_t in_buffer_size,
77 const media::VideoCaptureFormat& frame_format, 77 const media::VideoCaptureFormat& frame_format,
78 const base::TimeTicks& timestamp, 78 base::TimeTicks reference_time,
79 base::TimeDelta timestamp,
79 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> out_buffer); 80 std::unique_ptr<media::VideoCaptureDevice::Client::Buffer> out_buffer);
80 81
81 // JpegDecodeAccelerator::Client implementation. 82 // JpegDecodeAccelerator::Client implementation.
82 // These will be called on IO thread. 83 // These will be called on IO thread.
83 void VideoFrameReady(int32_t buffer_id) override; 84 void VideoFrameReady(int32_t buffer_id) override;
84 void NotifyError(int32_t buffer_id, 85 void NotifyError(int32_t buffer_id,
85 media::JpegDecodeAccelerator::Error error) override; 86 media::JpegDecodeAccelerator::Error error) override;
86 87
87 private: 88 private:
88 // Initialization helper, to establish GPU channel. 89 // 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_; 129 std::unique_ptr<base::SharedMemory> in_shared_memory_;
129 130
130 STATUS decoder_status_; 131 STATUS decoder_status_;
131 132
132 DISALLOW_COPY_AND_ASSIGN(VideoCaptureGpuJpegDecoder); 133 DISALLOW_COPY_AND_ASSIGN(VideoCaptureGpuJpegDecoder);
133 }; 134 };
134 135
135 } // namespace content 136 } // namespace content
136 137
137 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_ 138 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_VIDEO_CAPTURE_GPU_JPEG_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698