FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
chromaprint.c File Reference
#include "avformat.h"
#include "mux.h"
#include "libavutil/opt.h"
#include "libavutil/thread.h"
#include <chromaprint.h>

Go to the source code of this file.

Data Structures

struct  ChromaprintMuxContext
 

Macros

#define CPR_VERSION_INT
 
#define OFFSET(x)   offsetof(ChromaprintMuxContext, x)
 
#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM
 

Enumerations

enum  FingerprintFormat { FINGERPRINT_RAW, FINGERPRINT_COMPRESSED, FINGERPRINT_BASE64 }
 

Functions

static void deinit (AVFormatContext *s)
 
static av_cold int init (AVFormatContext *s)
 
static int write_packet (AVFormatContext *s, AVPacket *pkt)
 
static int write_trailer (AVFormatContext *s)
 

Variables

static AVMutex chromaprint_mutex = AV_MUTEX_INITIALIZER
 
static const AVOption options []
 
static const AVClass chromaprint_class
 
const FFOutputFormat ff_chromaprint_muxer
 

Macro Definition Documentation

◆ CPR_VERSION_INT

#define CPR_VERSION_INT
Value:
AV_VERSION_INT(CHROMAPRINT_VERSION_MAJOR, \
CHROMAPRINT_VERSION_MINOR, \
CHROMAPRINT_VERSION_PATCH)

Definition at line 28 of file chromaprint.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(ChromaprintMuxContext, x)

Definition at line 158 of file chromaprint.c.

◆ FLAGS

#define FLAGS   AV_OPT_FLAG_ENCODING_PARAM

Definition at line 159 of file chromaprint.c.

Enumeration Type Documentation

◆ FingerprintFormat

Enumerator
FINGERPRINT_RAW 
FINGERPRINT_COMPRESSED 
FINGERPRINT_BASE64 

Definition at line 34 of file chromaprint.c.

Function Documentation

◆ deinit()

static void deinit ( AVFormatContext s)
static

Definition at line 52 of file chromaprint.c.

◆ init()

static av_cold int init ( AVFormatContext s)
static

Definition at line 63 of file chromaprint.c.

◆ write_packet()

static int write_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 110 of file chromaprint.c.

◆ write_trailer()

static int write_trailer ( AVFormatContext s)
static

Definition at line 116 of file chromaprint.c.

Variable Documentation

◆ chromaprint_mutex

AVMutex chromaprint_mutex = AV_MUTEX_INITIALIZER
static

Definition at line 32 of file chromaprint.c.

Referenced by deinit(), and init().

◆ options

const AVOption options[]
static
Initial value:
= {
{ "silence_threshold", "threshold for detecting silence", OFFSET(silence_threshold), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 32767, FLAGS },
{ "algorithm", "version of the fingerprint algorithm", OFFSET(algorithm), AV_OPT_TYPE_INT, { .i64 = CHROMAPRINT_ALGORITHM_DEFAULT }, CHROMAPRINT_ALGORITHM_TEST1, INT_MAX, FLAGS },
{ "fp_format", "fingerprint format to write", OFFSET(fp_format), AV_OPT_TYPE_INT, { .i64 = FINGERPRINT_BASE64 }, FINGERPRINT_RAW, FINGERPRINT_BASE64, FLAGS, .unit = "fp_format" },
{ "raw", "binary raw fingerprint", 0, AV_OPT_TYPE_CONST, {.i64 = FINGERPRINT_RAW }, INT_MIN, INT_MAX, FLAGS, .unit = "fp_format"},
{ "compressed", "binary compressed fingerprint", 0, AV_OPT_TYPE_CONST, {.i64 = FINGERPRINT_COMPRESSED }, INT_MIN, INT_MAX, FLAGS, .unit = "fp_format"},
{ "base64", "Base64 compressed fingerprint", 0, AV_OPT_TYPE_CONST, {.i64 = FINGERPRINT_BASE64 }, INT_MIN, INT_MAX, FLAGS, .unit = "fp_format"},
{ NULL },
}

Definition at line 160 of file chromaprint.c.

◆ chromaprint_class

const AVClass chromaprint_class
static
Initial value:
= {
.class_name = "chromaprint muxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 170 of file chromaprint.c.

◆ ff_chromaprint_muxer

const FFOutputFormat ff_chromaprint_muxer
Initial value:
= {
.p.name = "chromaprint",
.p.long_name = NULL_IF_CONFIG_SMALL("Chromaprint"),
.priv_data_size = sizeof(ChromaprintMuxContext),
.p.video_codec = AV_CODEC_ID_NONE,
.p.subtitle_codec = AV_CODEC_ID_NONE,
.flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
.init = init,
.write_packet = write_packet,
.write_trailer = write_trailer,
.deinit = deinit,
.p.flags = AVFMT_NOTIMESTAMPS,
.p.priv_class = &chromaprint_class,
}

Definition at line 177 of file chromaprint.c.

AV_CODEC_ID_PCM_S16LE
@ AV_CODEC_ID_PCM_S16LE
Definition: codec_id.h:334
AVFMT_NOTIMESTAMPS
#define AVFMT_NOTIMESTAMPS
Format does not need / have any timestamps.
Definition: avformat.h:479
init
static av_cold int init(AVFormatContext *s)
Definition: chromaprint.c:63
deinit
static void deinit(AVFormatContext *s)
Definition: chromaprint.c:52
FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS
If this flag is set, then the only permitted audio/video/subtitle codec ids are AVOutputFormat....
Definition: mux.h:59
AV_CODEC_ID_PCM_S16BE
@ AV_CODEC_ID_PCM_S16BE
Definition: codec_id.h:335
options
static const AVOption options[]
Definition: chromaprint.c:160
write_trailer
static int write_trailer(AVFormatContext *s)
Definition: chromaprint.c:116
AV_NE
#define AV_NE(be, le)
Definition: macros.h:33
AV_VERSION_INT
#define AV_VERSION_INT(a, b, c)
Definition: version.h:56
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
FLAGS
#define FLAGS
Definition: chromaprint.c:159
FINGERPRINT_BASE64
@ FINGERPRINT_BASE64
Definition: chromaprint.c:37
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
FINGERPRINT_RAW
@ FINGERPRINT_RAW
Definition: chromaprint.c:35
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
chromaprint_class
static const AVClass chromaprint_class
Definition: chromaprint.c:170
FF_OFMT_FLAG_MAX_ONE_OF_EACH
#define FF_OFMT_FLAG_MAX_ONE_OF_EACH
If this flag is set, it indicates that for each codec type whose corresponding default codec (i....
Definition: mux.h:50
write_packet
static int write_packet(AVFormatContext *s, AVPacket *pkt)
Definition: chromaprint.c:110
OFFSET
#define OFFSET(x)
Definition: chromaprint.c:158
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
FINGERPRINT_COMPRESSED
@ FINGERPRINT_COMPRESSED
Definition: chromaprint.c:36
ChromaprintMuxContext
Definition: chromaprint.c:40
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299