This file is indexed.

/usr/include/groove/encoder.h is in libgroove-dev 4.3.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/*
 * Copyright (c) 2013 Andrew Kelley
 *
 * This file is part of libgroove, which is MIT licensed.
 * See http://opensource.org/licenses/MIT
 */

#ifndef GROOVE_ENCODER_H_INCLUDED
#define GROOVE_ENCODER_H_INCLUDED

#include "groove.h"

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

/* attach a GrooveEncoder to a playlist to keep a buffer of encoded audio full.
 * for example you could use it to implement an http audio stream
 */

struct GrooveEncoder {
    /* The desired audio format to encode.
     * groove_encoder_create defaults these to 44100 Hz,
     * signed 16-bit int, stereo.
     * These are preferences; if a setting cannot be used, a substitute will be
     * used instead. actual_audio_format is set to the actual values.
     */
    struct GrooveAudioFormat target_audio_format;

    /* Select encoding quality by choosing a target bit rate in bits per
     * second. Note that typically you see this expressed in "kbps", such
     * as 320kbps or 128kbps. Surprisingly, in this circumstance 1 kbps is
     * 1000 bps, *not* 1024 bps as you would expect.
     * groove_encoder_create defaults this to 256000
     */
    int bit_rate;

    /* optional - choose a short name for the format
     * to help libgroove guess which format to use
     * use `avconv -formats` to get a list of possibilities
     */
    const char *format_short_name;
    /* optional - choose a short name for the codec
     * to help libgroove guess which codec to use
     * use `avconv -codecs` to get a list of possibilities
     */
    const char *codec_short_name;
    /* optional - provide an example filename
     * to help libgroove guess which format/codec to use
     */
    const char *filename;
    /* optional - provide a mime type string
     * to help libgroove guess which format/codec to use
     */
    const char *mime_type;

    /* how big the sink buffer should be, in sample frames.
     * groove_encoder_create defaults this to 8192
     */
    int sink_buffer_size;

    /* how big the encoded audio buffer should be, in bytes
     * groove_encoder_create defaults this to 16384
     */
    int encoded_buffer_size;

    /* This volume adjustment to make to this player.
     * It is recommended that you leave this at 1.0 and instead adjust the
     * gain of the underlying playlist.
     * If you want to change this value after you have already attached the
     * sink to the playlist, you must use groove_encoder_set_gain.
     * float format. Defaults to 1.0
     */
    double gain;

    /* read-only. set when attached and cleared when detached */
    struct GroovePlaylist *playlist;

    /* read-only. set to the actual format you get when you attach to a
     * playlist. ideally will be the same as target_audio_format but might
     * not be.
     */
    struct GrooveAudioFormat actual_audio_format;
};

struct GrooveEncoder *groove_encoder_create(void);
/* detach before destroying */
void groove_encoder_destroy(struct GrooveEncoder *encoder);

/* once you attach, you must detach before destroying the playlist
 * at playlist begin, format headers are generated. when end of playlist is
 * reached, format trailers are generated.
 */
int groove_encoder_attach(struct GrooveEncoder *encoder,
        struct GroovePlaylist *playlist);
int groove_encoder_detach(struct GrooveEncoder *encoder);

/* returns < 0 on error, GROOVE_BUFFER_NO on aborted (block=1) or no buffer
 * ready (block=0), GROOVE_BUFFER_YES on buffer returned, and GROOVE_BUFFER_END
 * on end of playlist.
 * buffer is always set to either a valid GrooveBuffer or NULL.
 */
int groove_encoder_buffer_get(struct GrooveEncoder *encoder,
        struct GrooveBuffer **buffer, int block);

/* returns < 0 on error, 0 on no buffer ready, 1 on buffer ready
 * if block is 1, block until buffer is ready
 */
int groove_encoder_buffer_peek(struct GrooveEncoder *encoder, int block);

/* see docs for groove_file_metadata_get */
struct GrooveTag *groove_encoder_metadata_get(struct GrooveEncoder *encoder,
        const char *key, const struct GrooveTag *prev, int flags);

/* see docs for groove_file_metadata_set */
int groove_encoder_metadata_set(struct GrooveEncoder *encoder, const char *key,
        const char *value, int flags);

/* get the position of the encode head
 * both the current playlist item and the position in seconds in the playlist
 * item are given. item will be set to NULL if the playlist is empty
 * you may pass NULL for item or seconds
 */
void groove_encoder_position(struct GrooveEncoder *encoder,
        struct GroovePlaylistItem **item, double *seconds);

/* See the gain property of GrooveSink. It is recommended that you leave this
 * at 1.0 and instead adjust the gain of the playlist.
 * returns 0 on success, < 0 on error
 */
int groove_encoder_set_gain(struct GrooveEncoder *encoder, double gain);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* GROOVE_ENCODER_H_INCLUDED */