Olaf
Overly Lightweight Acoustic Fingerprinting
Loading...
Searching...
No Matches
olaf_fp_db_writer_cache.h
Go to the documentation of this file.
1// Olaf: Overly Lightweight Acoustic Fingerprinting
2// Copyright (C) 2019-2025 Joren Six
3
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU Affero General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU Affero General Public License for more details.
13
14// You should have received a copy of the GNU Affero General Public License
15// along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17
24
25#ifndef OLAF_FP_DB_WRITER_CACHE_H
26#define OLAF_FP_DB_WRITER_CACHE_H
27 #include <stdint.h>
28 #include <stdlib.h>
29 #include <string.h>
30
31 #include "olaf_db.h"
32 #include "olaf_config.h"
33
35 #define MAX_LINE_LEN 2048
37 #define MAX_TOKEN_LEN 512
39 #define FP_ARRAY_SIZE 10000
40
50
61
67 void olaf_fp_db_writer_cache_store( Olaf_FP_DB_Writer_Cache * olaf_fp_db_writer_cache);
68
76 void olaf_fp_db_writer_cache_set_audio_file_info(Olaf_FP_DB_Writer_Cache *olaf_fp_db_writer_cache, const char *audio_file_path, uint64_t audio_file_identifier);
77
83 void olaf_fp_db_writer_cache_destroy(Olaf_FP_DB_Writer_Cache * olaf_fp_db_writer_cache);
84
85#endif //OLAF_FP_DB_WRITER_H
86
87
Olaf configuration pramameters.
Olaf fingerprint database.
void olaf_fp_db_writer_cache_store(Olaf_FP_DB_Writer_Cache *olaf_fp_db_writer_cache)
Read the csv file and store the fingerpints within the file. Or an error if the CSV is malformed.
Definition olaf_fp_db_writer_cache.c:133
void olaf_fp_db_writer_cache_set_audio_file_info(Olaf_FP_DB_Writer_Cache *olaf_fp_db_writer_cache, const char *audio_file_path, uint64_t audio_file_identifier)
Set the audio file path and identifier for the cache writer.
Definition olaf_fp_db_writer_cache.c:46
void olaf_fp_db_writer_cache_destroy(Olaf_FP_DB_Writer_Cache *olaf_fp_db_writer_cache)
Free resources and close the CSV file.
Definition olaf_fp_db_writer_cache.c:151
Olaf_FP_DB_Writer_Cache * olaf_fp_db_writer_cache_new(Olaf_DB *db, Olaf_Config *config, const char *csv_filename)
Initializes a new cache db writer.
Definition olaf_fp_db_writer_cache.c:116
Configuration parameters defining the behaviour of Olaf.
Definition olaf_config.h:51
A struct with state information on the data store.
Definition olaf_db.c:27
An opaque struct with state information related to the cache writer.
Definition olaf_fp_db_writer_cache.c:26
Olaf_Config * config
Definition olaf_fp_db_writer_cache.c:28
const char * csv_filename
Definition olaf_fp_db_writer_cache.c:30
Olaf_DB * db
Definition olaf_fp_db_writer_cache.c:27
uint64_t audio_file_identifier
Definition olaf_fp_db_writer_cache.c:39