OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_ | 5 #ifndef CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_ |
6 #define CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_ | 6 #define CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/time/time.h" | 12 #include "base/time/time.h" |
12 | 13 |
13 namespace picasa { | 14 namespace picasa { |
14 | 15 |
15 // PMP file format. | 16 // PMP file format. |
16 // Info derived from: http://sbktech.blogspot.com/2011/12/picasa-pmp-format.html | 17 // Info derived from: http://sbktech.blogspot.com/2011/12/picasa-pmp-format.html |
17 | 18 |
18 const char kPmpExtension[] = "pmp"; | 19 const char kPmpExtension[] = "pmp"; |
19 | 20 |
20 const base::Time::Exploded kPmpVariantTimeEpoch = { | 21 const base::Time::Exploded kPmpVariantTimeEpoch = { |
21 1899, 12, 7, 30, // Dec 30, 1899 (Saturday) | 22 1899, 12, 7, 30, // Dec 30, 1899 (Saturday) |
22 0, 0, 0, 0 // 00:00:00.000 | 23 0, 0, 0, 0 // 00:00:00.000 |
23 }; | 24 }; |
24 | 25 |
25 const int64 kPmpHeaderSize = 20; | 26 const int64_t kPmpHeaderSize = 20; |
26 | 27 |
27 const int kPmpMagic1Offset = 0; | 28 const int kPmpMagic1Offset = 0; |
28 const int kPmpMagic2Offset = 6; | 29 const int kPmpMagic2Offset = 6; |
29 const int kPmpMagic3Offset = 8; | 30 const int kPmpMagic3Offset = 8; |
30 const int kPmpMagic4Offset = 14; | 31 const int kPmpMagic4Offset = 14; |
31 | 32 |
32 const uint32 kPmpMagic1 = 0x3fcccccd; | 33 const uint32_t kPmpMagic1 = 0x3fcccccd; |
33 const uint16 kPmpMagic2 = 0x1332; | 34 const uint16_t kPmpMagic2 = 0x1332; |
34 const uint32 kPmpMagic3 = 0x00000002; | 35 const uint32_t kPmpMagic3 = 0x00000002; |
35 const uint16 kPmpMagic4 = 0x1332; | 36 const uint16_t kPmpMagic4 = 0x1332; |
36 | 37 |
37 const int kPmpFieldType1Offset = 4; | 38 const int kPmpFieldType1Offset = 4; |
38 const int kPmpFieldType2Offset = 12; | 39 const int kPmpFieldType2Offset = 12; |
39 const int kPmpRowCountOffset = 16; | 40 const int kPmpRowCountOffset = 16; |
40 | 41 |
41 enum PmpFieldType { | 42 enum PmpFieldType { |
42 PMP_TYPE_STRING = 0x00, | 43 PMP_TYPE_STRING = 0x00, |
43 PMP_TYPE_UINT32 = 0x01, | 44 PMP_TYPE_UINT32 = 0x01, |
44 PMP_TYPE_DOUBLE64 = 0x02, | 45 PMP_TYPE_DOUBLE64 = 0x02, |
45 PMP_TYPE_UINT8 = 0x03, | 46 PMP_TYPE_UINT8 = 0x03, |
46 PMP_TYPE_UINT64 = 0x04, | 47 PMP_TYPE_UINT64 = 0x04, |
47 PMP_TYPE_INVALID = 0xff | 48 PMP_TYPE_INVALID = 0xff |
48 }; | 49 }; |
49 | 50 |
50 } // namespace picasa | 51 } // namespace picasa |
51 | 52 |
52 #endif // CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_ | 53 #endif // CHROME_COMMON_MEDIA_GALLERIES_PMP_CONSTANTS_H_ |
OLD | NEW |