AVbin
Version 10
Cross-platform audio/video media decoding library with long-term ABI support.
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
include
avbin.h
Go to the documentation of this file.
1
/* avbin.h
2
* Copyright 2012 AVbin Team
3
*
4
* This file is part of AVbin.
5
*
6
* AVbin is free software; you can redistribute it and/or modify it
7
* under the terms of the GNU Lesser General Public License as
8
* published by the Free Software Foundation; either version 3 of
9
* the License, or (at your option) any later version.
10
*
11
* AVbin is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this program. If not, see
18
* <http://www.gnu.org/licenses/>.
19
*/
20
74
#ifdef __cplusplus
75
extern
"C"
{
76
#endif
77
78
#ifndef AVBIN_H
79
#define AVBIN_H
80
81
#include <stdint.h>
82
86
typedef
enum
_AVbinResult
{
87
AVBIN_RESULT_ERROR
= -1,
88
AVBIN_RESULT_OK
= 0
89
}
AVbinResult
;
90
94
typedef
enum
_AVbinStreamType
{
95
AVBIN_STREAM_TYPE_UNKNOWN
= 0,
96
AVBIN_STREAM_TYPE_VIDEO
= 1,
97
AVBIN_STREAM_TYPE_AUDIO
= 2
98
}
AVbinStreamType
;
99
103
typedef
enum
_AVbinSampleFormat
{
105
AVBIN_SAMPLE_FORMAT_U8
= 0,
107
AVBIN_SAMPLE_FORMAT_S16
= 1,
112
AVBIN_SAMPLE_FORMAT_S24
= 2,
114
AVBIN_SAMPLE_FORMAT_S32
= 3,
116
AVBIN_SAMPLE_FORMAT_FLOAT
= 4
117
}
AVbinSampleFormat
;
118
122
typedef
enum
_AVbinLogLevel
{
123
AVBIN_LOG_QUIET
= -8,
124
AVBIN_LOG_PANIC
= 0,
125
AVBIN_LOG_FATAL
= 8,
126
AVBIN_LOG_ERROR
= 16,
127
AVBIN_LOG_WARNING
= 24,
128
AVBIN_LOG_INFO
= 32,
129
AVBIN_LOG_VERBOSE
= 40,
130
AVBIN_LOG_DEBUG
= 48
131
}
AVbinLogLevel
;
132
136
typedef
struct
_AVbinFile
AVbinFile
;
137
141
typedef
struct
_AVbinStream
AVbinStream
;
142
146
typedef
int64_t
AVbinTimestamp
;
147
151
typedef
struct
_AVbinFileInfo
{
156
size_t
structure_size
;
157
161
int32_t
n_streams
;
162
166
AVbinTimestamp
start_time
;
167
171
AVbinTimestamp
duration
;
172
183
char
title
[512];
184
char
author
[512];
185
char
copyright
[512];
186
char
comment
[512];
187
char
album
[512];
188
int32_t
year
;
189
int32_t
track
;
190
char
genre
[32];
192
}
AVbinFileInfo
;
193
203
typedef
struct
_AVbinStreamInfo
{
208
size_t
structure_size
;
209
213
AVbinStreamType
type
;
214
215
union
{
216
struct
{
222
uint32_t
width
;
223
227
uint32_t
height
;
228
233
uint32_t
sample_aspect_num
;
234
uint32_t
sample_aspect_den
;
235
241
uint32_t
frame_rate_num
;
242
uint32_t
frame_rate_den
;
243
}
video
;
244
245
struct
{
249
AVbinSampleFormat
sample_format
;
250
254
uint32_t
sample_rate
;
255
259
uint32_t
sample_bits
;
260
267
uint32_t
channels
;
268
}
audio
;
269
};
270
}
AVbinStreamInfo
;
271
281
typedef
struct
_AVbinStreamInfo8
{
286
size_t
structure_size
;
287
291
AVbinStreamType
type
;
292
293
union
{
294
struct
{
300
uint32_t
width
;
301
305
uint32_t
height
;
306
311
uint32_t
sample_aspect_num
;
312
uint32_t
sample_aspect_den
;
313
319
uint32_t
frame_rate_num
;
320
uint32_t
frame_rate_den
;
321
}
video
;
322
323
struct
{
327
AVbinSampleFormat
sample_format
;
328
332
uint32_t
sample_rate
;
333
337
uint32_t
sample_bits
;
338
345
uint32_t
channels
;
346
}
audio
;
347
};
348
}
AVbinStreamInfo8
;
349
358
typedef
struct
_AVbinPacket
{
363
size_t
structure_size
;
364
369
AVbinTimestamp
timestamp
;
370
374
uint32_t
stream_index
;
375
376
uint8_t *
data
;
377
size_t
size
;
378
}
AVbinPacket
;
379
380
384
typedef
struct
_AVbinInfo
{
393
size_t
structure_size
;
394
399
int
version
;
400
404
char
*
version_string
;
405
409
char
*
build_date
;
410
414
char
*
repo
;
415
419
char
*
commit
;
420
424
char
*
backend
;
425
430
char
*
backend_version_string
;
431
435
char
*
backend_repo
;
436
440
char
*
backend_commit
;
441
}
AVbinInfo
;
442
443
447
typedef
struct
_AVbinOptions
{
452
size_t
structure_size
;
453
460
int32_t
thread_count
;
461
}
AVbinOptions
;
462
463
472
typedef
void (*
AVbinLogCallback
)(
const
char
*module,
473
AVbinLogLevel
level,
474
const
char
*message);
475
487
int32_t
avbin_get_version
();
488
489
495
AVbinInfo
*
avbin_get_info
();
496
497
507
int32_t
avbin_get_ffmpeg_revision
() __attribute__((deprecated));
508
509
513
size_t
avbin_get_audio_buffer_size
();
514
528
int32_t
avbin_have_feature
(const
char
*feature);
543
AVbinResult
avbin_init
();
544
551
AVbinResult
avbin_init_options
(
AVbinOptions
* options);
552
556
AVbinResult
avbin_set_log_level
(
AVbinLogLevel
level);
557
562
AVbinResult
avbin_set_log_callback
(
AVbinLogCallback
callback);
575
AVbinFile
*
avbin_open_filename
(const
char
*filename);
576
AVbinFile
*
avbin_open_filename_with_format
(const
char
*filename,
char
* format);
577
581
void
avbin_close_file
(
AVbinFile
*file);
582
590
AVbinResult
avbin_seek_file
(
AVbinFile
*file, AVbinTimestamp timestamp);
591
599
AVbinResult
avbin_file_info
(
AVbinFile
*file,
600
AVbinFileInfo
*info);
620
AVbinResult
avbin_stream_info
(
AVbinFile
*file, int32_t stream_index,
621
AVbinStreamInfo
*info);
622
630
AVbinStream
*
avbin_open_stream
(
AVbinFile
*file, int32_t stream_index);
631
635
void
avbin_close_stream
(
AVbinStream
*stream);
655
AVbinResult
avbin_read
(
AVbinFile
*file,
AVbinPacket
*packet);
656
675
int32_t
avbin_decode_audio
(
AVbinStream
*stream,
676
uint8_t *data_in,
size_t
size_in,
677
uint8_t *data_out,
int
*size_out);
678
695
int32_t
avbin_decode_video
(
AVbinStream
*stream,
696
uint8_t *data_in,
size_t
size_in,
697
uint8_t *data_out);
698
701
#endif
702
703
#ifdef __cplusplus
704
}
705
#endif
Generated on Thu Aug 23 2012 10:01:25 for AVbin by
1.8.2