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

Side by Side Diff: content/common/gpu/media/vaapi_jpeg_decoder.h

Issue 825843002: Add JPEG decoder for VAAPI JPEG decode acceleration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mjpeg-vaapi-jpeg-parser
Patch Set: rebase+revise due to parser cl Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved.
wuchengli 2015/01/12 09:08:52 2015 :)
kcwu 2015/01/16 15:12:55 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 //
5 // This file contains an implementation of a class that provides JPEG decode
wuchengli 2015/01/12 09:08:52 This should be removed or merged with VaapiJpegDec
kcwu 2015/01/16 15:12:55 Done This is modified from vaapi_h264_decoder.h ;)
6 // support for use with VAAPI hardware video decode acceleration on Intel
7 // systems.
8
9 #ifndef CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_
10 #define CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_
11
12 #include <vector>
13
14 #include "base/callback_forward.h"
15 #include "base/memory/linked_ptr.h"
Owen Lin 2015/01/13 06:17:58 not used ?
kcwu 2015/01/16 15:12:55 Done.
16 #include "base/memory/ref_counted.h"
Owen Lin 2015/01/13 06:17:58 not used?
kcwu 2015/01/16 15:12:55 Done.
17 #include "base/memory/scoped_ptr.h"
18 #include "content/common/gpu/media/vaapi_wrapper.h"
19 #include "media/base/limits.h"
wuchengli 2015/01/12 09:08:52 Move to .cc?
kcwu 2015/01/16 15:12:54 Done.
20 #include "media/filters/jpeg_parser.h"
wuchengli 2015/01/12 09:08:52 move to .cc? Please check every #include here.
kcwu 2015/01/16 15:12:55 Done.
21
22 namespace content {
23
24 // TODO(kcwu) comment
wuchengli 2015/01/12 09:08:52 Remove TODO and add the documentation.
kcwu 2015/01/16 15:12:55 Done.
25 // An JPEG decoder that utilizes VA-API. Provides features not supported by
26 // the VA-API userspace library (libva), like stream parsing.
27 //
28 // Provides functionality to allow plugging VAAPI HW acceleration into the
29 // JDA framework.
30 //
31 // Clients of this class are expected to pass H264 Annex-B byte stream and
wuchengli 2015/01/12 09:08:52 update the comments
kcwu 2015/01/16 15:12:55 Done.
32 // will receive decoded surfaces via client-provided |OutputPicCB|.
33 //
34 // This class must be created, called and destroyed on a single thread, and
35 // does nothing internally on any other thread.
36 class CONTENT_EXPORT VaapiJpegDecoder {
37 public:
38 enum DecodeStatus {
39 SUCCESS = 0,
40 PARSE_ERROR,
41 VAAPI_ERROR,
wuchengli 2015/01/12 09:08:52 Document these errors.
kcwu 2015/01/16 15:12:54 Done.
42 };
43
44 // Callback to report errors for UMA purposes, not used to return errors
45 // to clients.
46 typedef base::Callback<void(DecodeStatus error)> ReportErrorToUmaCB;
wuchengli 2015/01/12 09:08:52 Remove all UMA code because this needs the corresp
kcwu 2015/01/16 15:12:55 Done.
47
48 // |vaapi_wrapper| should be initialized.
49 // |output_pic_cb| notifies the client a surface is to be displayed.
wuchengli 2015/01/12 09:08:52 remove
kcwu 2015/01/16 15:12:54 Done.
50 // |report_error_to_uma_cb| called on errors for UMA purposes, not used
51 // to report errors to clients.
52 VaapiJpegDecoder(VaapiWrapper* vaapi_wrapper,
53 const ReportErrorToUmaCB& report_error_to_uma_cb);
54
55 ~VaapiJpegDecoder();
56
57 DecodeStatus Decode(const uint8* buffer,
wuchengli 2015/01/12 09:08:52 Add documentation for this and DecodeDone.
kcwu 2015/01/16 15:12:55 Done.
58 size_t buffer_size,
59 gfx::Size* output_size,
60 VASurfaceID* surface);
61
62 void DecodeDone();
63
64 private:
65 // Unused VA surface, ready to be reused.
66 scoped_refptr<VASurface> available_va_surface_;
Owen Lin 2015/01/13 06:17:58 Not used?
kcwu 2015/01/16 15:12:55 Done.
67
68 VaapiWrapper* vaapi_wrapper_;
69
70 // Called to report decoding error to UMA, not used to indicate errors
71 // to clients.
72 ReportErrorToUmaCB report_error_to_uma_cb_;
73
74 DISALLOW_COPY_AND_ASSIGN(VaapiJpegDecoder);
75 };
76
77 } // namespace content
78
79 #endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_JPEG_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698