aboutsummaryrefslogtreecommitdiffstats
path: root/core/metadata.cpp
AgeCommit message (Collapse)Author
2018-10-21Add 'location_t' data structureGravatar Linus Torvalds
Instead of having people treat latitude and longitude as separate things, just add a 'location_t' data structure that contains both. Almost all cases want to always act on them together. This is really just prep-work for adding a few more locations that we track: I want to add a entry/exit location to each dive (independent of the dive site) because of how the Garmin Descent gives us the information (and hopefully, some day, other dive computers too). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-09-25Metadata: rudimentary support for XMP metadataa in MP4-based videosGravatar Berthold Stoeger
XMP is a media-metadata standard based on XML which may be used across a variety of media formats. Some video-processing software writes XMP data without updating the native metadata fields. Therefore, we should aim at reading XMP metadata and give priority of XMP data over native fields. Pros: - Support for *all* common media formats. Cons: - XML (complex, verbose, chaotic). - Does not even come close to fulfilling its promise of being well defined (see below). Implement a simple XMP-parser using libxml2. Connect the XMP-parser to the existing Quicktime/MP4 parser. First problem encountered: According to the spec, XMP data supposed to be put in the 'XMP_' atom. But for example exiftools instead writes an 'uuid' atom with a special 16-byte uid. Implement both, more options will probably follow. Second problem: two versions of recording the creation date were found 1) The content of a <exif:DateTimeOriginal> tag. 2) The xmp::CreateDate attribute of a <rdf:Description> tag. Here too, more versions are expected to surface and will have to be supported in due course (with an obvious priority problem). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-01Cleanup: remove silly " != 0" expressionGravatar Berthold Stoeger
In metadata.cpp, replace a silly "if (!memcmp(...) != 0)" by the intended "if (!memcmp(...))" Obviously, both have the same effect. Fixes a warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-14Metadata: Parse ASFs (=WMVs)Gravatar Berthold Stoeger
The simplest video-formats to parse so far. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-14Metadata: Parse AVIsGravatar Berthold Stoeger
Whereas extraction of the dive-duration is trivial, AVIs don't seem to have a standardized way of saving the creation time. This commit implements support for two versions randomly found on the internet. Additional version will follow if need arises. AVI seems not to be a particular popular format for either vacation or professional videographers. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-14Metadata: extract duration fom QuickTime/MP4-style containersGravatar Berthold Stoeger
We want the duration of videos for two reasons: - To display the duration of the video in the profile plot. - To be able to determine which dive a video is closer to if the start is not during a dive. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-04-01Dive pictures: extract timestamp from MP4 and related formatsGravatar Berthold Stoeger
Parse MP4s and related video files and extract the creation timestamp from the "mdhd" (media header) atom. Introduce helper function templates to extract arbitrary-length unsigned integers in big-endian format from file or memory. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-04-01Dive pictures: use get_metadata() in dive_create_picture()Gravatar Berthold Stoeger
Thus, metadata has to be only read once and the picture_load_exif_data() function can be removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-04-01Dive pictures: Move metadata functions into own translation unitGravatar Berthold Stoeger
Move all metadata function into new core/metadata.cpp file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>