Commit Graph

152 Commits

Author SHA1 Message Date
Martchus f5cb2c5cba Preserve media type of MP4 tracks if media type is unknown 2021-04-09 22:15:44 +02:00
Martchus 0a041f6ad2 Fix warnings 2021-03-20 21:26:25 +01:00
Martchus 65597fd71e Add API to allow aborting overall/expensive parsing functions
* Not really implemented within the various code paths of the parsers at
  this point; this commit mainly adds the API.
* Adjust example in README
2021-02-04 23:21:50 +01:00
Martchus f21ac07da0 Get rid of deprecated fields 2021-02-01 17:11:08 +01:00
Martchus 78439e2e3f Fix returning nullptr where now a std::string_view is required 2021-02-01 17:10:01 +01:00
Martchus 64d98f5530 Use std::string_view where it makes sense 2021-01-30 21:53:06 +01:00
Martchus 49154905b1 Improve code in Mp4Tag::setValues() 2021-01-30 19:22:06 +01:00
Martchus 42eac2074d Return additional values stored within MP4 fields via values() 2021-01-30 19:18:29 +01:00
Martchus 65d52b2d57 Improve customization point for clearing tag field
* Allow customizing clearing only the value
* Use same naming scheme as in other places
* Avoid having to add an empty reset() function in subclasses
2021-01-30 19:10:16 +01:00
Martchus 5b6c65aa27 Improve diag messages when parsing MP4 tag fields 2021-01-30 15:13:42 +01:00
Martchus 8efe6e5a63 Avoid converting MP4 data when text of correct encoding is assigned anyways 2021-01-30 15:00:10 +01:00
Martchus 84183aaf02 Improve handling of MP4 tags
* Preserve multiple data atoms
* Assume JPEG as raw data type when making cover field (instead of UTF-8)
* Split certain functions
* Simplify code
2021-01-30 13:59:48 +01:00
Martchus 761e3ee44b Mark all "final" tag, track and container classes as such 2020-12-18 21:13:52 +01:00
Martchus 6b469f1c26 Add Locale class to deal with differently specified languages/countries
Different media/tag formats specify languages and countries
differently. This change introduces a Locale class to keep track
of the format being used. So far there are no automatic conversions
implemented so it is entirely up to the user to pass valid values using
a format which matches the one required by the media/tag format.

This change also adds support for Matroska's IETF elements so at least the
raw value can be read, written and is preserved.
2020-12-16 17:48:08 +01:00
Martchus 4cc2dbd9e6 Use flags instead of tons of boolean fields in AbstractTrack 2020-12-16 17:48:08 +01:00
Martchus 5f39e377dc Use std::size_t consistently 2020-11-25 17:54:30 +01:00
Martchus 16f4d2165c Do not incorrectly abbreviate MPEG-4 ASP as H.263
Unlike MPEG-4 AVC and H.264, MPEG-4 ASP and H.263 are not identical.
2020-10-01 19:09:01 +02:00
Martchus d26e594777 Deprecate 'Year' in favor of 'RecordDate' and 'ReleaseDate', fix handling in ID3v2
1. Convert TYER and related fields of old ID3v2 versions to the new TDRC
  field and only expose that via the generic accessors.
2. When writing an old ID3v2 tag, convert TDRC back to the old fields.
3. One can still manually unset the via 1. auto-populated TDRC to disable 2.
   and write the old fields directly. So the automatic handling does not
   reduce the flexibility of the library.
4. Deprecate 'Year'; it is replaced by the already existing 'RecordDate'
   which is now supposed to be used everywhere where 'Year' was used before
5. Introduce 'ReleaseDate' to support this field which is supported in
   ID3v2.4.0 and Matroska via the generic accessors.
6. Use ISO format when converting tag values of the type DateTime to/from
   string. This is closer to what's used in ID3v2 tags internally. (The
   library still allows the old format as fallback when parsing for
   compatibility.)
2020-04-24 23:15:13 +02:00
Martchus 0e66b34d48 Add human readable representation of certain IDs as comments 2020-04-22 22:08:02 +02:00
Martchus 248a6555f3 Add links to upstream documentation of field IDs for the different formats 2020-04-22 18:43:41 +02:00
Martchus b2c02e9acc Fix childs -> children 2019-12-30 22:54:11 +01:00
Martchus 49798ae3a8 Improve wording in Mp4Container 2019-12-15 19:44:44 +01:00
Martchus 7043c3d2a9 Don't suppress IO errors when writing files
* Close or flush streams explicitely so writing is not
  deferred
    * to catch errors in the right place
    * to avoid suppressing errors completely when writing
      would be deferred to the destructor invocation
* Improve comments
2019-12-15 19:43:16 +01:00
Martchus a59a01cfe9 Prevent warning when adding album artist to MP4
Prevents "making MP4 tag field aART: It was not possible to
find an appropriate raw data type id. UTF-8 will be assumed."
2019-10-09 18:03:34 +02:00
Martchus 9299c58c22 Detect VP9 in MP4 2019-09-25 22:05:25 +02:00
Martchus eb9ab514eb Detect Opus and FLAC in MP4 2019-09-25 21:52:44 +02:00
Martchus 48ee8023b2 Remove useless remarks 2019-06-16 18:04:31 +02:00
Martchus c9e1dde70b Adapt to changes in c++utilities 2019-06-12 20:40:45 +02:00
Martchus 5ad00a083c Adapt to changes in c++utilities 2019-06-10 23:11:39 +02:00
Martchus 69c72909e8 Fix some Doxygen warnings 2019-06-01 15:07:48 +02:00
Martchus c17db5f2f6 Apply cmake-format and clang-format 2019-05-04 21:03:09 +02:00
Martchus 3288d49d62 Support 'file://' URLs also when saving 2019-05-04 16:04:37 +02:00
Martchus 7efa7a0d5a Adapt to c++utilities v5 2019-05-04 16:04:21 +02:00
Martchus f687618002 Reduce compiler warnings in Mp4Track code 2019-04-21 18:18:56 +02:00
Martchus bfb460d4fd Preserve empty/zero language in MP4 tracks 2019-04-21 18:15:53 +02:00
Martchus 66895e8e2c Distinguish text and "meta" tracks in MP4 2019-04-19 21:59:46 +02:00
Martchus 48166bde9e Prevent updating tkhd atom to version 1 for compatibility 2019-04-19 21:59:42 +02:00
Martchus 8588edaa2e Write preferably version 0 of mdhd atom for compatibility 2019-04-18 17:56:03 +02:00
Martchus 27d7a182d9 Preserve all child elements within trak element 2019-04-17 17:52:04 +02:00
Martchus ccffe4f1e3 Show children of tref atom 2019-04-16 21:50:00 +02:00
Martchus c09f93c441 Preserve order of atoms within moov tree
Maybe it helps with https://github.com/Martchus/tageditor/issues/45
2019-04-16 21:49:16 +02:00
Martchus da15530f53 Remove obsolete code 2019-04-16 21:49:16 +02:00
Martchus f494420da7 Show children of gmhd atom 2019-04-15 18:21:42 +02:00
Martchus 2d306b1a5f Preserve all children of minf atom
See https://github.com/Martchus/tageditor/issues/45
2019-04-15 18:21:33 +02:00
Martchus d812e0d3ae Detect VobSub within MP4 2019-03-10 16:40:51 +01:00
Martchus 6afcd0f8d3 Support album artist and fix/improve grouping 2019-01-01 23:47:18 +01:00
Martchus 0024d5e115 Make message about parsing AV1 config not supported an info
rather than a critical error
2018-11-08 14:31:35 +01:00
Martchus 60f1288e42 Fix some warnings 2018-08-23 23:20:29 +02:00
Martchus 3332314eb6 Prepare logging errors when parsing AVC config 2018-08-23 23:20:17 +02:00
Martchus 534cb2a6f7 Prepare parsing AV1 config 2018-08-23 23:18:57 +02:00