| 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_
|
|
|