| OLD | NEW |
| 1 // Copyright 2012 Google Inc. All Rights Reserved. | 1 // Copyright 2012 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
| 4 // that can be found in the COPYING file in the root of the source | 4 // that can be found in the COPYING file in the root of the source |
| 5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
| 8 // ----------------------------------------------------------------------------- | 8 // ----------------------------------------------------------------------------- |
| 9 // | 9 // |
| 10 // WebP container demux. | 10 // WebP container demux. |
| 11 // | 11 // |
| 12 | 12 |
| 13 #ifdef HAVE_CONFIG_H | 13 #ifdef HAVE_CONFIG_H |
| 14 #include "../webp/config.h" | 14 #include "../webp/config.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 #include <assert.h> | 17 #include <assert.h> |
| 18 #include <stdlib.h> | 18 #include <stdlib.h> |
| 19 #include <string.h> | 19 #include <string.h> |
| 20 | 20 |
| 21 #include "../utils/utils.h" | 21 #include "../utils/utils.h" |
| 22 #include "../webp/decode.h" // WebPGetFeatures | 22 #include "../webp/decode.h" // WebPGetFeatures |
| 23 #include "../webp/demux.h" | 23 #include "../webp/demux.h" |
| 24 #include "../webp/format_constants.h" | 24 #include "../webp/format_constants.h" |
| 25 | 25 |
| 26 #define DMUX_MAJ_VERSION 0 | 26 #define DMUX_MAJ_VERSION 0 |
| 27 #define DMUX_MIN_VERSION 2 | 27 #define DMUX_MIN_VERSION 2 |
| 28 #define DMUX_REV_VERSION 1 | 28 #define DMUX_REV_VERSION 2 |
| 29 | 29 |
| 30 typedef struct { | 30 typedef struct { |
| 31 size_t start_; // start location of the data | 31 size_t start_; // start location of the data |
| 32 size_t end_; // end location | 32 size_t end_; // end location |
| 33 size_t riff_end_; // riff chunk end location, can be > end_. | 33 size_t riff_end_; // riff chunk end location, can be > end_. |
| 34 size_t buf_size_; // size of the buffer | 34 size_t buf_size_; // size of the buffer |
| 35 const uint8_t* buf_; | 35 const uint8_t* buf_; |
| 36 } MemBuffer; | 36 } MemBuffer; |
| 37 | 37 |
| 38 typedef struct { | 38 typedef struct { |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 (const char*)iter->chunk.bytes - CHUNK_HEADER_SIZE; | 993 (const char*)iter->chunk.bytes - CHUNK_HEADER_SIZE; |
| 994 return SetChunk(fourcc, iter->chunk_num - 1, iter); | 994 return SetChunk(fourcc, iter->chunk_num - 1, iter); |
| 995 } | 995 } |
| 996 return 0; | 996 return 0; |
| 997 } | 997 } |
| 998 | 998 |
| 999 void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter) { | 999 void WebPDemuxReleaseChunkIterator(WebPChunkIterator* iter) { |
| 1000 (void)iter; | 1000 (void)iter; |
| 1001 } | 1001 } |
| 1002 | 1002 |
| OLD | NEW |