FFmpeg
2.1.1
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
libavutil
buffer_internal.h
Go to the documentation of this file.
1
/*
2
* This file is part of FFmpeg.
3
*
4
* FFmpeg is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Lesser General Public
6
* License as published by the Free Software Foundation; either
7
* version 2.1 of the License, or (at your option) any later version.
8
*
9
* FFmpeg is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Lesser General Public License for more details.
13
*
14
* You should have received a copy of the GNU Lesser General Public
15
* License along with FFmpeg; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
*/
18
19
#ifndef AVUTIL_BUFFER_INTERNAL_H
20
#define AVUTIL_BUFFER_INTERNAL_H
21
22
#include <stdint.h>
23
24
#include "
buffer.h
"
25
26
/**
27
* The buffer is always treated as read-only.
28
*/
29
#define BUFFER_FLAG_READONLY (1 << 0)
30
/**
31
* The buffer was av_realloc()ed, so it is reallocatable.
32
*/
33
#define BUFFER_FLAG_REALLOCATABLE (1 << 1)
34
35
struct
AVBuffer
{
36
uint8_t
*
data
;
/**< data described by this buffer */
37
int
size
;
/**< size of data in bytes */
38
39
/**
40
* number of existing AVBufferRef instances referring to this buffer
41
*/
42
volatile
int
refcount
;
43
44
/**
45
* a callback for freeing the data
46
*/
47
void
(*
free
)(
void
*
opaque
,
uint8_t
*
data
);
48
49
/**
50
* an opaque pointer, to be used by the freeing callback
51
*/
52
void
*
opaque
;
53
54
/**
55
* A combination of BUFFER_FLAG_*
56
*/
57
int
flags
;
58
};
59
60
typedef
struct
BufferPoolEntry
{
61
uint8_t
*
data
;
62
63
/*
64
* Backups of the original opaque/free of the AVBuffer corresponding to
65
* data. They will be used to free the buffer when the pool is freed.
66
*/
67
void
*
opaque
;
68
void
(*
free
)(
void
*
opaque
,
uint8_t
*
data
);
69
70
AVBufferPool
*
pool
;
71
struct
BufferPoolEntry
*
volatile
next
;
72
}
BufferPoolEntry
;
73
74
struct
AVBufferPool
{
75
BufferPoolEntry
*
volatile
pool
;
76
77
/*
78
* This is used to track when the pool is to be freed.
79
* The pointer to the pool itself held by the caller is considered to
80
* be one reference. Each buffer requested by the caller increases refcount
81
* by one, returning the buffer to the pool decreases it by one.
82
* refcount reaches zero when the buffer has been uninited AND all the
83
* buffers have been released, then it's safe to free the pool and all
84
* the buffers in it.
85
*/
86
volatile
int
refcount
;
87
88
volatile
int
nb_allocated
;
89
90
int
size
;
91
AVBufferRef
* (*alloc)(
int
size
);
92
};
93
94
#endif
/* AVUTIL_BUFFER_INTERNAL_H */
AVBuffer::free
void(* free)(void *opaque, uint8_t *data)
a callback for freeing the data
Definition:
buffer_internal.h:47
BufferPoolEntry::next
struct BufferPoolEntry *volatile next
Definition:
buffer_internal.h:71
BufferPoolEntry::opaque
void * opaque
Definition:
buffer_internal.h:67
AVBufferPool::pool
BufferPoolEntry *volatile pool
Definition:
buffer_internal.h:75
AVBuffer::refcount
volatile int refcount
number of existing AVBufferRef instances referring to this buffer
Definition:
buffer_internal.h:42
AVBuffer::data
uint8_t * data
data described by this buffer
Definition:
buffer_internal.h:36
uint8_t
uint8_t
Definition:
audio_convert.c:194
AVBufferPool
The buffer pool.
Definition:
buffer_internal.h:74
buffer.h
refcounted data buffer API
BufferPoolEntry::free
void(* free)(void *opaque, uint8_t *data)
Definition:
buffer_internal.h:68
AVBuffer::flags
int flags
A combination of BUFFER_FLAG_*.
Definition:
buffer_internal.h:57
void
typedef void(RENAME(mix_any_func_type))
Definition:
rematrix_template.c:47
AVBufferPool::nb_allocated
volatile int nb_allocated
Definition:
buffer_internal.h:88
AVBuffer
A reference counted buffer type.
Definition:
buffer_internal.h:35
AVBufferPool::size
int size
Definition:
buffer_internal.h:90
BufferPoolEntry
Definition:
buffer_internal.h:60
AVBufferPool::refcount
volatile int refcount
Definition:
buffer_internal.h:86
AVBuffer::opaque
void * opaque
an opaque pointer, to be used by the freeing callback
Definition:
buffer_internal.h:52
BufferPoolEntry::data
uint8_t * data
Definition:
buffer_internal.h:61
AVBufferRef
A reference to a data buffer.
Definition:
buffer.h:81
BufferPoolEntry::pool
AVBufferPool * pool
Definition:
buffer_internal.h:70
AVBuffer::size
int size
size of data in bytes
Definition:
buffer_internal.h:37
Generated on Wed Nov 20 2013 08:50:07 for FFmpeg by
1.8.5