| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * JPEG Multi-Picture Format common definitions | ||
| 3 | * | ||
| 4 | * This file is part of FFmpeg. | ||
| 5 | * | ||
| 6 | * FFmpeg is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU Lesser General Public | ||
| 8 | * License as published by the Free Software Foundation; either | ||
| 9 | * version 2.1 of the License, or (at your option) any later version. | ||
| 10 | * | ||
| 11 | * FFmpeg is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | * Lesser General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU Lesser General Public | ||
| 17 | * License along with FFmpeg; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | /** | ||
| 22 | * @file | ||
| 23 | * Shared definitions for JPEG Multi-Picture Format (CIPA DC-007). | ||
| 24 | */ | ||
| 25 | |||
| 26 | #ifndef AVFORMAT_JPEGMPF_H | ||
| 27 | #define AVFORMAT_JPEGMPF_H | ||
| 28 | |||
| 29 | /* Individual Image Attribute bits, from CIPA DC-007 Figure 8 */ | ||
| 30 | enum MPFAttribute { | ||
| 31 | MPF_DEPENDENT_PARENT = 0x80000000, | ||
| 32 | MPF_DEPENDENT_CHILD = 0x40000000, | ||
| 33 | MPF_REPRESENTATIVE = 0x20000000, | ||
| 34 | MPF_ATTR_FORMAT_MASK = 0x07000000, | ||
| 35 | MPF_ATTR_TYPE_MASK = 0x00FFFFFF, | ||
| 36 | MPF_FORMAT_JPEG = 0x00000000, | ||
| 37 | }; | ||
| 38 | |||
| 39 | /* MP Type Codes, from CIPA DC-007 Table 4 */ | ||
| 40 | enum MPFType { | ||
| 41 | MPF_TYPE_UNDEFINED = 0x000000, | ||
| 42 | MPF_TYPE_LARGE_THUMBNAIL = 0x010000, /* + class (1-5) */ | ||
| 43 | MPF_TYPE_MULTI_FRAME = 0x020000, /* + panorama / disparity / multi-angle */ | ||
| 44 | MPF_TYPE_PRIMARY = 0x030000, /* Baseline MP Primary Image */ | ||
| 45 | MPF_TYPE_ORIGINAL = 0x040000, /* Original preservation image */ | ||
| 46 | MPF_TYPE_GAIN_MAP = 0x050000, | ||
| 47 | |||
| 48 | MPF_TYPE_INFO_MASK = 0xFF0000, /* see CIPA DC-007 Figure 9 */ | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* Returns whether images of this type only exist as dependent images */ | ||
| 52 | 2 | static inline int mpf_type_is_child(enum MPFType type) | |
| 53 | { | ||
| 54 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
|
2 | switch (type & MPF_TYPE_INFO_MASK) { |
| 55 | ✗ | case MPF_TYPE_LARGE_THUMBNAIL: | |
| 56 | case MPF_TYPE_ORIGINAL: | ||
| 57 | case MPF_TYPE_GAIN_MAP: | ||
| 58 | ✗ | return 1; | |
| 59 | 2 | default: | |
| 60 | 2 | return 0; | |
| 61 | } | ||
| 62 | } | ||
| 63 | |||
| 64 | /* MP Index IFD tags, from CIPA DC-007 Table 3 */ | ||
| 65 | enum MPFTag { | ||
| 66 | MPF_TAG_MPFVersion = 0xB000, | ||
| 67 | MPF_TAG_NumberOfImages = 0xB001, | ||
| 68 | MPF_TAG_MPEntry = 0xB002, | ||
| 69 | }; | ||
| 70 | |||
| 71 | /* APP2 extension segments */ | ||
| 72 | typedef enum MPFExt { | ||
| 73 | MPF_EXT_XMP, /* GContainer directory, First Individual Image only */ | ||
| 74 | MPF_EXT_INDEX, /* MP Index IFD, First Individual Image only */ | ||
| 75 | MPF_EXT_ISO21496, /* ISO 21496-1 version fields (in the base image) */ | ||
| 76 | MPF_EXT_NB, | ||
| 77 | } MPFExt; | ||
| 78 | |||
| 79 | /* Namespace URIs of the GContainer XMP extension */ | ||
| 80 | #define XMP_CONTAINER_NS "http://ns.google.com/photos/1.0/container/" | ||
| 81 | #define XMP_ITEM_NS "http://ns.google.com/photos/1.0/container/item/" | ||
| 82 | |||
| 83 | #endif /* AVFORMAT_JPEGMPF_H */ | ||
| 84 |