Coverage Report

Created: 2025-06-16 07:00

/src/libheif/libheif/sequences/track_metadata.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * HEIF image base codec.
3
 * Copyright (c) 2025 Dirk Farin <dirk.farin@gmail.com>
4
 *
5
 * This file is part of libheif.
6
 *
7
 * libheif is free software: you can redistribute it and/or modify
8
 * it under the terms of the GNU Lesser General Public License as
9
 * published by the Free Software Foundation, either version 3 of
10
 * the License, or (at your option) any later version.
11
 *
12
 * libheif is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU Lesser General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU Lesser General Public License
18
 * along with libheif.  If not, see <http://www.gnu.org/licenses/>.
19
 */
20
21
#ifndef LIBHEIF_TRACK_METADATA_H
22
#define LIBHEIF_TRACK_METADATA_H
23
24
#include "track.h"
25
#include <string>
26
#include <memory>
27
#include <vector>
28
29
30
class Track_Metadata : public Track {
31
public:
32
  //Track(HeifContext* ctx);
33
34
  Track_Metadata(HeifContext* ctx, uint32_t track_id, std::string uri, heif_track_info* info);
35
36
  Track_Metadata(HeifContext* ctx, const std::shared_ptr<Box_trak>&); // when reading the file
37
38
0
  ~Track_Metadata() override = default;
39
40
  struct Metadata {
41
0
    ~Metadata() { heif_tai_timestamp_packet_release(timestamp); }
42
43
    std::vector<uint8_t> raw_metadata;
44
    uint32_t duration = 0;
45
46
    const heif_tai_timestamp_packet* timestamp = nullptr;
47
    std::string gimi_contentID;
48
  };
49
50
  Result<std::shared_ptr<const Metadata>> read_next_metadata_sample();
51
52
  Error write_raw_metadata(const Metadata&);
53
54
private:
55
  std::string m_uri;
56
};
57
58
#endif //LIBHEIF_TRACK_METADATA_H