AVbin  Version 10
Cross-platform audio/video media decoding library with long-term ABI support.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 {
89 } AVbinResult;
90 
94 typedef enum _AVbinStreamType {
99 
103 typedef enum _AVbinSampleFormat {
118 
122 typedef enum _AVbinLogLevel {
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 {
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 {
209 
214 
215  union {
216  struct {
222  uint32_t width;
223 
227  uint32_t height;
228 
235 
241  uint32_t frame_rate_num;
242  uint32_t frame_rate_den;
243  } video;
244 
245  struct {
250 
254  uint32_t sample_rate;
255 
259  uint32_t sample_bits;
260 
267  uint32_t channels;
268  } audio;
269  };
271 
281 typedef struct _AVbinStreamInfo8 {
287 
292 
293  union {
294  struct {
300  uint32_t width;
301 
305  uint32_t height;
306 
313 
319  uint32_t frame_rate_num;
320  uint32_t frame_rate_den;
321  } video;
322 
323  struct {
328 
332  uint32_t sample_rate;
333 
337  uint32_t sample_bits;
338 
345  uint32_t channels;
346  } audio;
347  };
349 
358 typedef struct _AVbinPacket {
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 {
394 
399  int version;
400 
405 
409  char *build_date;
410 
414  char *repo;
415 
419  char *commit;
420 
424  char *backend;
425 
431 
436 
441 } AVbinInfo;
442 
443 
447 typedef struct _AVbinOptions {
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 
496 
497 
507 int32_t avbin_get_ffmpeg_revision() __attribute__((deprecated));
508 
509 
514 
528 int32_t avbin_have_feature(const char *feature);
544 
552 
557 
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 
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);
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