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

Unified Diff: content/common/gpu/media/jpeg_codec.h

Issue 825863002: WIP: Add hardware jpeg decode on tegra platform Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/common/gpu/media/jpeg_codec.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/media/jpeg_codec.h
diff --git a/content/common/gpu/media/jpeg_codec.h b/content/common/gpu/media/jpeg_codec.h
new file mode 100644
index 0000000000000000000000000000000000000000..b61fc2d886e82ccab90fc73113d7ad1e0d1bdaf8
--- /dev/null
+++ b/content/common/gpu/media/jpeg_codec.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_MEDIA_JPEG_CODEC_H_
+#define CONTENT_COMMON_GPU_MEDIA_JPEG_CODEC_H_
+
+#include <stddef.h>
+#include "base/memory/scoped_ptr.h"
+
+namespace content {
+
+// Interface for encoding/decoding JPEG data. This is a wrapper around libjpeg,
+// which has an inconvenient interface for callers. This is only used for UI
+// elements, WebKit has its own more complicated JPEG decoder which handles,
+// among other things, partially downloaded data.
+class JPEGCodec {
+ public:
+
+ enum Type {
+ kDecoder,
+ kEncoder,
+ kImageProcessor,
+ };
+
+ virtual ~JPEGCodec();
+
+ static scoped_ptr<JPEGCodec> Create(Type type);
+
+ virtual bool Initialize() = 0;
+
+ // Decodes the JPEG data contained in input of length input_size. The
+ // decoded data will be placed in *output with the dimensions in *w and *h
+ // on success (returns true). This data will be written in the'format'
+ // format. On failure, the values of these output variables is undefined.
+ virtual bool Decode(const unsigned char* input, size_t input_size,
+ unsigned char** output, unsigned * w, unsigned * h,
+ unsigned* row_bytes) = 0;
+
+ // Decodes the JPEG data contained in input of length input_size. If
+ // successful, a SkBitmap is created and returned. It is up to the caller
+ // to delete the returned bitmap.
+ //static SkBitmap* Decode(const unsigned char* input, size_t input_size);
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_GPU_MEDIA_JPEG_CODEC_H_
« no previous file with comments | « no previous file | content/common/gpu/media/jpeg_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698