FFmpeg
1.2.4
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
debian
tmp
usr
include
libavfilter
avfilter.h
Go to the documentation of this file.
1
/*
2
* filter layer
3
* Copyright (c) 2007 Bobby Bingham
4
*
5
* This file is part of FFmpeg.
6
*
7
* FFmpeg is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
11
*
12
* FFmpeg is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with FFmpeg; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
*/
21
22
#ifndef AVFILTER_AVFILTER_H
23
#define AVFILTER_AVFILTER_H
24
36
#include <stddef.h>
37
38
#include "libavutil/avutil.h"
39
#include "libavutil/dict.h"
40
#include "libavutil/log.h"
41
#include "libavutil/samplefmt.h"
42
#include "libavutil/pixfmt.h"
43
#include "libavutil/rational.h"
44
45
#include "libavfilter/version.h"
46
50
unsigned
avfilter_version
(
void
);
51
55
const
char
*
avfilter_configuration
(
void
);
56
60
const
char
*
avfilter_license
(
void
);
61
65
const
AVClass
*
avfilter_get_class
(
void
);
66
67
typedef
struct
AVFilterContext
AVFilterContext
;
68
typedef
struct
AVFilterLink
AVFilterLink
;
69
typedef
struct
AVFilterPad
AVFilterPad
;
70
typedef
struct
AVFilterFormats
AVFilterFormats
;
71
77
typedef
struct
AVFilterBuffer
{
78
uint8_t
*
data
[8];
79
94
uint8_t
**
extended_data
;
95
int
linesize
[8];
96
98
void
*
priv
;
105
void
(*
free
)(
struct
AVFilterBuffer
*buf);
106
107
int
format
;
108
int
w
,
h
;
109
unsigned
refcount
;
110
}
AVFilterBuffer
;
111
112
#define AV_PERM_READ 0x01
113
#define AV_PERM_WRITE 0x02
114
#define AV_PERM_PRESERVE 0x04
115
#define AV_PERM_REUSE 0x08
116
#define AV_PERM_REUSE2 0x10
117
#define AV_PERM_NEG_LINESIZES 0x20
118
#define AV_PERM_ALIGN 0x40
119
120
#define AVFILTER_ALIGN 16 //not part of ABI
121
127
typedef
struct
AVFilterBufferRefAudioProps
{
128
uint64_t
channel_layout
;
129
int
nb_samples
;
130
int
sample_rate
;
131
int
channels
;
132
}
AVFilterBufferRefAudioProps
;
133
139
typedef
struct
AVFilterBufferRefVideoProps
{
140
int
w
;
141
int
h
;
142
AVRational
sample_aspect_ratio
;
143
int
interlaced
;
144
int
top_field_first
;
145
enum
AVPictureType
pict_type
;
146
int
key_frame
;
147
int
qp_table_linesize
;
148
int
qp_table_size
;
149
int8_t *
qp_table
;
150
}
AVFilterBufferRefVideoProps
;
151
160
typedef
struct
AVFilterBufferRef
{
161
AVFilterBuffer
*
buf
;
162
uint8_t
*
data
[8];
163
177
uint8_t
**
extended_data
;
178
int
linesize
[8];
179
180
AVFilterBufferRefVideoProps
*
video
;
181
AVFilterBufferRefAudioProps
*
audio
;
182
188
int64_t
pts
;
189
int64_t
pos
;
190
191
int
format
;
192
193
int
perms
;
194
195
enum
AVMediaType
type
;
196
197
AVDictionary
*
metadata
;
198
}
AVFilterBufferRef
;
199
203
void
avfilter_copy_buffer_ref_props
(
AVFilterBufferRef
*
dst
,
AVFilterBufferRef
*src);
204
214
AVFilterBufferRef
*
avfilter_ref_buffer
(
AVFilterBufferRef
*ref,
int
pmask);
215
225
void
avfilter_unref_buffer
(
AVFilterBufferRef
*ref);
226
234
void
avfilter_unref_bufferp
(
AVFilterBufferRef
**ref);
235
239
int
avfilter_ref_get_channels
(
AVFilterBufferRef
*ref);
240
241
#if FF_API_AVFILTERPAD_PUBLIC
242
252
struct
AVFilterPad
{
258
const
char
*
name
;
259
263
enum
AVMediaType
type
;
264
276
int
min_perms
;
277
290
int
rej_perms
;
291
295
int (*start_frame)(
AVFilterLink
*link,
AVFilterBufferRef
*picref);
296
303
AVFilterBufferRef
*(*get_video_buffer)(
AVFilterLink
*link,
int
perms,
int
w,
int
h);
304
311
AVFilterBufferRef
*(*get_audio_buffer)(
AVFilterLink
*link,
int
perms,
312
int
nb_samples
);
313
317
int (*end_frame)(
AVFilterLink
*link);
318
322
int (*
draw_slice
)(
AVFilterLink
*link,
int
y
,
int
height
,
int
slice_dir);
323
334
int (*
filter_frame
)(
AVFilterLink
*link,
AVFilterBufferRef
*
frame
);
335
345
int (*
poll_frame
)(
AVFilterLink
*link);
346
356
int (*
request_frame
)(
AVFilterLink
*link);
357
375
int (*
config_props
)(
AVFilterLink
*link);
376
383
int
needs_fifo
;
384
};
385
#endif
386
396
const
char
*
avfilter_pad_get_name
(
AVFilterPad
*pads,
int
pad_idx);
397
407
enum
AVMediaType
avfilter_pad_get_type
(
AVFilterPad
*pads,
int
pad_idx);
408
413
typedef
struct
AVFilter
{
414
const
char
*
name
;
415
420
const
char
*
description
;
421
422
const
AVFilterPad
*
inputs
;
423
const
AVFilterPad
*
outputs
;
424
425
/*****************************************************************
426
* All fields below this line are not part of the public API. They
427
* may not be used outside of libavfilter and can be changed and
428
* removed at will.
429
* New public fields should be added right above.
430
*****************************************************************
431
*/
432
437
int (*
init
)(
AVFilterContext
*ctx,
const
char
*args);
438
444
void
(*
uninit
)(
AVFilterContext
*ctx);
445
454
int (*
query_formats
)(
AVFilterContext
*);
455
456
int
priv_size
;
457
470
int (*
process_command
)(
AVFilterContext
*,
const
char
*cmd,
const
char
*
arg
,
char
*res,
int
res_len,
int
flags
);
471
477
int (*
init_opaque
)(
AVFilterContext
*ctx,
const
char
*args,
void
*opaque);
478
479
const
AVClass
*
priv_class
;
480
}
AVFilter
;
481
483
struct
AVFilterContext
{
484
const
AVClass
*
av_class
;
485
486
AVFilter
*
filter
;
487
488
char
*
name
;
489
490
AVFilterPad
*
input_pads
;
491
AVFilterLink
**
inputs
;
492
#if FF_API_FOO_COUNT
493
unsigned
input_count;
494
#endif
495
unsigned
nb_inputs
;
496
497
AVFilterPad
*
output_pads
;
498
AVFilterLink
**
outputs
;
499
#if FF_API_FOO_COUNT
500
unsigned
output_count;
501
#endif
502
unsigned
nb_outputs
;
503
504
void
*
priv
;
505
506
struct
AVFilterCommand
*
command_queue
;
507
};
508
516
struct
AVFilterLink
{
517
AVFilterContext
*
src
;
518
AVFilterPad
*
srcpad
;
519
520
AVFilterContext
*
dst
;
521
AVFilterPad
*
dstpad
;
522
523
enum
AVMediaType
type
;
524
525
/* These parameters apply only to video */
526
int
w
;
527
int
h
;
528
AVRational
sample_aspect_ratio
;
529
/* These parameters apply only to audio */
530
uint64_t
channel_layout
;
531
int
sample_rate
;
532
533
int
format
;
534
542
AVRational
time_base
;
543
544
/*****************************************************************
545
* All fields below this line are not part of the public API. They
546
* may not be used outside of libavfilter and can be changed and
547
* removed at will.
548
* New public fields should be added right above.
549
*****************************************************************
550
*/
558
AVFilterFormats
*
in_formats
;
559
AVFilterFormats
*
out_formats
;
560
565
AVFilterFormats
*
in_samplerates
;
566
AVFilterFormats
*
out_samplerates
;
567
struct
AVFilterChannelLayouts
*
in_channel_layouts
;
568
struct
AVFilterChannelLayouts
*
out_channel_layouts
;
569
577
int
request_samples
;
578
580
enum
{
581
AVLINK_UNINIT
= 0,
582
AVLINK_STARTINIT
,
583
AVLINK_INIT
584
}
init_state
;
585
586
struct
AVFilterPool
*
pool
;
587
591
struct
AVFilterGraph
*
graph
;
592
597
int64_t
current_pts
;
598
602
int
age_index
;
603
614
AVRational
frame_rate
;
615
619
AVFilterBufferRef
*
partial_buf
;
620
625
int
partial_buf_size
;
626
634
int
min_samples
;
635
640
int
max_samples
;
641
649
AVFilterBufferRef
*
cur_buf_copy
;
650
661
int
closed
;
662
666
int
channels
;
667
};
668
678
int
avfilter_link
(
AVFilterContext
*src,
unsigned
srcpad,
679
AVFilterContext
*
dst
,
unsigned
dstpad);
680
684
void
avfilter_link_free
(
AVFilterLink
**link);
685
689
int
avfilter_link_get_channels
(
AVFilterLink
*link);
690
694
void
avfilter_link_set_closed
(
AVFilterLink
*link,
int
closed);
695
702
int
avfilter_config_links
(
AVFilterContext
*
filter
);
703
715
AVFilterBufferRef
*
716
avfilter_get_video_buffer_ref_from_arrays
(
uint8_t
*
const
data
[4],
const
int
linesize[4],
int
perms,
717
int
w,
int
h,
enum
AVPixelFormat
format);
718
733
AVFilterBufferRef
*
avfilter_get_audio_buffer_ref_from_arrays
(
uint8_t
**
data
,
734
int
linesize,
735
int
perms,
736
int
nb_samples
,
737
enum
AVSampleFormat
sample_fmt,
738
uint64_t channel_layout);
752
AVFilterBufferRef
*
avfilter_get_audio_buffer_ref_from_arrays_channels
(
uint8_t
**
data
,
753
int
linesize,
754
int
perms,
755
int
nb_samples
,
756
enum
AVSampleFormat
sample_fmt,
757
int
channels,
758
uint64_t channel_layout);
759
760
761
762
#define AVFILTER_CMD_FLAG_ONE 1
763
#define AVFILTER_CMD_FLAG_FAST 2
764
765
769
int
avfilter_process_command
(
AVFilterContext
*
filter
,
const
char
*cmd,
const
char
*
arg
,
char
*res,
int
res_len,
int
flags
);
770
772
void
avfilter_register_all
(
void
);
773
775
void
avfilter_uninit
(
void
);
776
787
int
avfilter_register
(
AVFilter
*
filter
);
788
796
AVFilter
*
avfilter_get_by_name
(
const
char
*
name
);
797
804
AVFilter
**
av_filter_next
(
AVFilter
**
filter
);
805
815
int
avfilter_open
(
AVFilterContext
**filter_ctx,
AVFilter
*
filter
,
const
char
*inst_name);
816
827
int
avfilter_init_filter
(
AVFilterContext
*
filter
,
const
char
*args,
void
*opaque);
828
834
void
avfilter_free
(
AVFilterContext
*
filter
);
835
845
int
avfilter_insert_filter
(
AVFilterLink
*link,
AVFilterContext
*
filt
,
846
unsigned
filt_srcpad_idx,
unsigned
filt_dstpad_idx);
847
852
#endif
/* AVFILTER_AVFILTER_H */
Generated on Fri Nov 29 2013 19:14:52 for FFmpeg by
1.8.1.2