-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdlb_flexr.h
140 lines (109 loc) · 5.58 KB
/
dlb_flexr.h
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
139
140
#ifndef DLB_FLEXR_H_
#define DLB_FLEXR_H_
#include <stddef.h>
#include <stdint.h>
#include "dlb_buffer.h"
#define DLB_FLEXR_STREAM_HANDLE_INVALID (0)
typedef struct dlb_flexr_s dlb_flexr;
typedef uint32_t dlb_flexr_stream_handle;
/* These are the supported input channel configurations */
typedef enum dlb_flexr_input_format_e {
DLB_FLEXR_INPUT_FORMAT_1_0 = 0,
DLB_FLEXR_INPUT_FORMAT_2_0,
DLB_FLEXR_INPUT_FORMAT_5_1,
DLB_FLEXR_INPUT_FORMAT_7_1,
DLB_FLEXR_INPUT_FORMAT_5_1_2,
DLB_FLEXR_INPUT_FORMAT_5_1_4,
DLB_FLEXR_INPUT_FORMAT_7_1_4,
DLB_FLEXR_INPUT_FORMAT_OBJECT,
} dlb_flexr_input_format;
typedef enum dlb_flexr_interp_mode_e {
DLB_FLEXR_INTERP_OFFLINE = 0,
DLB_FLEXR_INTERP_RUNTIME,
} dlb_flexr_interp_mode;
typedef struct dlb_flexr_init_info_s
{
int rate;
int active_channels_enable;
uint64_t active_channels_mask;
const uint8_t *serialized_config;
size_t serialized_config_size;
} dlb_flexr_init_info;
typedef struct dlb_flexr_stream_info_s
{
dlb_flexr_input_format format;
dlb_flexr_interp_mode interp;
/* upmix stream internally to create a more immersive experience, it is only
* considered for following input formats:
* - DLB_FLEXR_INPUT_FORMAT_2_0
* - DLB_FLEXR_INPUT_FORMAT_5_1
* - DLB_FLEXR_INPUT_FORMAT_7_1
* ignored otherwise
*/
int upmix_enable;
/* indicates that crossfading of stream render configs is enabled */
int crossfade_enable;
/* the maximum number of samples that need to be buffered internally between
* calls of generate_output */
int max_input_blk_samples ;
/* the maximum stream render config rendering table xyz resolutions that will
* be supported by this stream */
int max_num_x;
int max_num_y;
int max_num_z;
/* the maximum number of stream render config rendering table levels that
* will be supported by this stream */
int max_num_ldr_levels;
const uint8_t *serialized_config;
size_t serialized_config_size;
} dlb_flexr_stream_info;
typedef struct dlb_flexr_object_metadata_s
{
unsigned offset;
unsigned char *payload;
size_t payload_size;
} dlb_flexr_object_metadata;
dlb_flexr * dlb_flexr_new (const dlb_flexr_init_info *info);
void dlb_flexr_free (dlb_flexr *self);
dlb_flexr_stream_handle dlb_flexr_add_stream (dlb_flexr *self,
const dlb_flexr_stream_info *info);
void dlb_flexr_rm_stream (dlb_flexr *self,
dlb_flexr_stream_handle stream);
int dlb_flexr_push_stream (dlb_flexr *self,
dlb_flexr_stream_handle stream,
dlb_flexr_object_metadata *md,
dlb_buffer *inbuf,
int samples);
int dlb_flexr_generate_output (dlb_flexr *self,
dlb_buffer *outbuf,
int *samples);
void dlb_flexr_reset (dlb_flexr *self);
void dlb_flexr_set_external_user_gain (dlb_flexr *self,
float gain);
void dlb_flexr_set_external_user_gain_by_step
(dlb_flexr *self,
int step);
int dlb_flexr_query_num_outputs (const dlb_flexr *self);
int dlb_flexr_query_latency (const dlb_flexr *self);
int dlb_flexr_query_outblk_samples (const dlb_flexr *self);
int dlb_flexr_query_ext_gain_steps (const dlb_flexr *self);
int dlb_flexr_query_pushed_samples (const dlb_flexr *self,
dlb_flexr_stream_handle stream);
int dlb_flexr_finished (const dlb_flexr *self,
dlb_flexr_stream_handle stream);
void dlb_flexr_set_render_config (dlb_flexr *self,
dlb_flexr_stream_handle stream,
const uint8_t *serialized_config,
size_t serialized_config_size,
dlb_flexr_interp_mode interp,
int xfade_blocks);
void dlb_flexr_stream_info_init (dlb_flexr_stream_info *info,
const uint8_t *serialized_config,
size_t serialized_config_size);
void dlb_flexr_set_internal_user_gain (dlb_flexr *self,
dlb_flexr_stream_handle stream,
float gain);
void dlb_flexr_set_content_norm_gain (dlb_flexr *self,
dlb_flexr_stream_handle stream,
float gain);
#endif // DLB_FLEXR_H_