-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathogmmerge.h
More file actions
113 lines (95 loc) · 3.26 KB
/
ogmmerge.h
File metadata and controls
113 lines (95 loc) · 3.26 KB
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
/*
ogmmerge -- utility for splicing together ogg bitstreams
from component media subtypes
ogmmerge.h
general class and type definitions
Written by Moritz Bunkus <moritz@bunkus.org>
Based on Xiph.org's 'oggmerge' found in their CVS repository
See http://www.xiph.org
Distributed under the GPL
see the file COPYING for details
or visit http://www.gnu.org/copyleft/gpl.html
*/
#ifndef __ogmmerge_H__
#define __ogmmerge_H__
#include <stdio.h>
#include <ogg/ogg.h>
#include <vorbis/codec.h>
#include "common.h"
#include "ogmstreams.h"
#define DISPLAYPRIORITY_HIGH 10
#define DISPLAYPRIORITY_MEDIUM 5
#define DISPLAYPRIORITY_LOW 1
typedef struct {
int displacement;
double linear;
} audio_sync_t;
typedef struct {
double start;
double end;
} range_t;
typedef double stamp_t;
#define MAX_TIMESTAMP ((double)3.40282347e+38F)
typedef struct {
ogg_page *og;
stamp_t timestamp;
int header_page;
int index_serial;
} ogmmerge_page_t;
typedef class generic_reader_c {
protected:
vorbis_comment *chapter_info;
public:
generic_reader_c();
virtual ~generic_reader_c();
virtual int read() = 0;
virtual int serial_in_use(int serial) = 0;
virtual ogmmerge_page_t *get_page() = 0;
virtual ogmmerge_page_t *get_header_page(int header_type =
PACKET_TYPE_HEADER) = 0;
virtual void reset() = 0;
virtual int display_priority() = 0;
virtual void display_progress() = 0;
virtual void set_chapter_info(vorbis_comment *info);
} generic_reader_c;
typedef class generic_packetizer_c {
protected:
int serialno;
vorbis_comment *comments;
public:
generic_packetizer_c();
virtual ~generic_packetizer_c() {};
virtual int page_available() = 0;
virtual ogmmerge_page_t *get_page() = 0;
virtual ogmmerge_page_t *get_header_page(int header_type =
PACKET_TYPE_HEADER) = 0;
virtual stamp_t make_timestamp(ogg_int64_t granulepos) = 0;
virtual int serial_in_use(int serial);
virtual int flush_pages(int header_page = 0) = 0;
virtual int queue_pages(int header_page = 0) = 0;
virtual stamp_t get_smallest_timestamp() = 0;
virtual void produce_eos_packet() = 0;
virtual void produce_header_packets() = 0;
virtual void reset() = 0;
virtual void set_comments(vorbis_comment *ncomments);
} generic_packetizer_c;
class error_c {
private:
char *error;
public:
error_c(char *nerror) { error = nerror; };
char *get_error() { return error; };
};
#ifndef OGMSPLIT
extern int force_flushing;
extern int omit_empty_packets;
extern int old_headers;
extern float video_fps; // needed for MicroDVD fps-to-time conversion
int create_unique_serial();
extern void add_index(int serial);
#endif
int chapter_information_probe(FILE *file, off_t size);
vorbis_comment *chapter_information_read(char *name);
vorbis_comment *chapter_information_adjust(vorbis_comment *vc, double start,
double end);
#endif /* __ogmmerge_H__ */