[go: up one dir, main page]

File: mp4write.h

package info (click to toggle)
faac 1.30-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, bullseye
  • size: 1,212 kB
  • sloc: ansic: 8,932; cpp: 3,184; makefile: 58; sh: 9
file content (91 lines) | stat: -rw-r--r-- 2,400 bytes parent folder | download | duplicates (2)
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
/****************************************************************************
    MP4 output module

    Copyright (C) 2017 Krzysztof Nikiel

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
****************************************************************************/

#include <stdint.h>

enum {TAGMAX = 100};

typedef struct
{
    uint32_t samplerate;
    // total sound samples
    uint32_t samples;
    uint32_t channels;
    // sample depth
    uint32_t bits;
    // buffer config
    uint16_t buffersize;
    struct {
        uint32_t max;
        uint32_t avg;
        int size;
        int samples;
    } bitrate;
    uint32_t framesamples;
    struct
    {
        uint16_t *data;
        uint32_t ents;
        uint32_t bufsize;
    } frame;
    // AudioSpecificConfig data:
    struct
    {
        uint8_t *data;
        unsigned long size;
    } asc;
    uint32_t mdatofs;
    uint32_t mdatsize;

    struct
    {
        // meta fields
        const char *encoder;
        const char *artist;
        const char *composer;
        const char *title;
        const char *album;
        uint8_t compilation;
        uint32_t trackno;
        uint32_t ntracks;
        uint32_t discno;
        uint32_t ndiscs;
        int genre;
        const char *year;
        struct {
            uint8_t *data;
            int size;
        } cover;
        const char *comment;
        struct {
            const char *name;
            const char *data;
        } ext[TAGMAX];
        int extnum;
    } tag;
} mp4config_t;

extern mp4config_t mp4config;

int mp4atom_open(char *name, int over);
int mp4atom_head(void);
int mp4atom_tail(void);
int mp4atom_frame(uint8_t * bitbuf, int bytesWritten, int frame_samples);
int mp4atom_close(void);
int mp4tag_add(const char *name, const char *data);