| 1 |
/* |
| 2 |
* HEIF codec. |
| 3 |
* Copyright (c) 2025 Dirk Farin <[email protected]> |
| 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 SAI_DATAFILE_H |
| 22 |
#define SAI_DATAFILE_H |
| 23 |
#include <string> |
| 24 |
#include <vector> |
| 25 |
|
| 26 |
#include "libheif/heif_tai_timestamps.h" |
| 27 |
|
| 28 |
// Helper class for heif-enc to read a SAI data file and provide the data for the track's SAI items. |
| 29 |
struct SAI_datafile |
| 30 |
{ |
| 31 |
~SAI_datafile(); |
| 32 |
|
| 33 |
void load_sai_data_from_file(const char* sai_file); |
| 34 |
|
| 35 |
heif_tai_clock_info* tai_clock_info = nullptr; |
| 36 |
|
| 37 |
std::vector<heif_tai_timestamp_packet*> tai_timestamps; |
| 38 |
std::vector<std::string> gimi_content_ids; |
| 39 |
|
| 40 |
std::vector<std::string> active_sais; |
| 41 |
|
| 42 |
private: |
| 43 |
void handleHeaderEntry(const std::string& code, |
| 44 |
const std::vector<std::string>& values); |
| 45 |
|
| 46 |
void handleMainEntry(const std::vector<std::string>& values, int line, int main_item_line); |
| 47 |
|
| 48 |
bool isSeparatorLine(const std::string& line); |
| 49 |
|
| 50 |
std::vector<std::string> splitCSV(const std::string& line); |
| 51 |
}; |
| 52 |
|
| 53 |
|
| 54 |
#endif //SAI_DATAFILE_H |