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

Side by Side Diff: media/gpu/fake_jpeg_decode_accelerator.h

Issue 2735083002: [Mojo Video Capture] Add test coverage for accelerated jpeg decoding (Closed)
Patch Set: Remove example code that accidentally slipped in with Patch Set 4 Created 3 years, 9 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
(Empty)
1 // Copyright 2017 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 #ifndef MEDIA_GPU_FAKE_JPEG_DECODE_ACCELERATOR_H_
6 #define MEDIA_GPU_FAKE_JPEG_DECODE_ACCELERATOR_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11
12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h"
14 #include "media/base/bitstream_buffer.h"
15 #include "media/gpu/media_gpu_export.h"
16 #include "media/video/jpeg_decode_accelerator.h"
17
18 namespace base {
19 class SingleThreadTaskRunner;
20 }
21
22 namespace media {
23
24 // Uses software-based decoding. The purpose of this class is to enable testing
25 // of communication to the JpegDecodeAccelerator without requiring an actual
26 // hardware decoder.
27 class MEDIA_GPU_EXPORT FakeJpegDecodeAccelerator
28 : public JpegDecodeAccelerator {
29 public:
30 FakeJpegDecodeAccelerator(
31 const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
32 ~FakeJpegDecodeAccelerator() override;
33
34 // JpegDecodeAccelerator implementation.
35 bool Initialize(JpegDecodeAccelerator::Client* client) override;
36 void Decode(const BitstreamBuffer& bitstream_buffer,
37 const scoped_refptr<VideoFrame>& video_frame) override;
38 bool IsSupported() override;
39
40 private:
41 void NotifyError(int32_t bitstream_buffer_id, Error error);
42 void NotifyErrorOnClientThread(int32_t bitstream_buffer_id, Error error);
43 void OnDecodeDoneOnClientThread(int32_t input_buffer_id);
44
45 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
emircan 2017/03/09 23:44:25 Is this supposed to be GPU main thread task runner
chfremer 2017/03/10 18:30:49 Done.
46 const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
47 Client* client_ = nullptr;
48
49 base::WeakPtrFactory<FakeJpegDecodeAccelerator> weak_factory_;
50
51 DISALLOW_COPY_AND_ASSIGN(FakeJpegDecodeAccelerator);
52 };
53
54 } // namespace media
55
56 #endif // MEDIA_GPU_FAKE_JPEG_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698