FFmpeg  4.3
framepool.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * Copyright (c) 2015 Matthieu Bouron <matthieu.bouron stupeflix.com>
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * 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 FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVFILTER_FRAMEPOOL_H
22 #define AVFILTER_FRAMEPOOL_H
23 
24 #include "libavutil/buffer.h"
25 #include "libavutil/frame.h"
26 
27 /**
28  * Frame pool. This structure is opaque and not meant to be accessed
29  * directly. It is allocated with ff_frame_pool_init() and freed with
30  * ff_frame_pool_uninit().
31  */
32 typedef struct FFFramePool FFFramePool;
33 
34 /**
35  * Allocate and initialize a video frame pool.
36  *
37  * @param alloc a function that will be used to allocate new frame buffers when
38  * the pool is empty. May be NULL, then the default allocator will be used
39  * (av_buffer_alloc()).
40  * @param width width of each frame in this pool
41  * @param height height of each frame in this pool
42  * @param format format of each frame in this pool
43  * @param align buffers alignement of each frame in this pool
44  * @return newly created video frame pool on success, NULL on error.
45  */
47  int width,
48  int height,
49  enum AVPixelFormat format,
50  int align);
51 
52 /**
53  * Allocate and initialize an audio frame pool.
54  *
55  * @param alloc a function that will be used to allocate new frame buffers when
56  * the pool is empty. May be NULL, then the default allocator will be used
57  * (av_buffer_alloc()).
58  * @param channels channels of each frame in this pool
59  * @param nb_samples number of samples of each frame in this pool
60  * @param format format of each frame in this pool
61  * @param align buffers alignement of each frame in this pool
62  * @return newly created audio frame pool on success, NULL on error.
63  */
65  int channels,
66  int samples,
68  int align);
69 
70 /**
71  * Deallocate the frame pool. It is safe to call this function while
72  * some of the allocated frame are still in use.
73  *
74  * @param pool pointer to the frame pool to be freed. It will be set to NULL.
75  */
77 
78 /**
79  * Get the video frame pool configuration.
80  *
81  * @param width width of each frame in this pool
82  * @param height height of each frame in this pool
83  * @param format format of each frame in this pool
84  * @param align buffers alignement of each frame in this pool
85  * @return 0 on success, a negative AVERROR otherwise.
86  */
88  int *width,
89  int *height,
90  enum AVPixelFormat *format,
91  int *align);
92 
93 /**
94  * Get the audio frame pool configuration.
95  *
96  * @param channels channels of each frame in this pool
97  * @param nb_samples number of samples of each frame in this pool
98  * @param format format of each frame in this pool
99  * @param align buffers alignement of each frame in this pool
100  * @return 0 on success, a negative AVERROR otherwise.
101  */
103  int *channels,
104  int *nb_samples,
105  enum AVSampleFormat *format,
106  int *align);
107 
108 
109 /**
110  * Allocate a new AVFrame, reussing old buffers from the pool when available.
111  * This function may be called simultaneously from multiple threads.
112  *
113  * @return a new AVFrame on success, NULL on error.
114  */
116 
117 
118 #endif /* AVFILTER_FRAMEPOOL_H */
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:300
FFFramePool::nb_samples
int nb_samples
Definition: framepool.c:41
samples
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new samples
Definition: fate.txt:139
FFFramePool
Frame pool.
Definition: framepool.c:30
ff_frame_pool_video_init
FFFramePool * ff_frame_pool_video_init(AVBufferRef *(*alloc)(int size), int width, int height, enum AVPixelFormat format, int align)
Allocate and initialize a video frame pool.
Definition: framepool.c:51
width
#define width
format
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate. The lists are not just lists
channels
channels
Definition: aptx.h:33
ff_frame_pool_get
AVFrame * ff_frame_pool_get(FFFramePool *pool)
Allocate a new AVFrame, reussing old buffers from the pool when available.
Definition: framepool.c:195
size
int size
Definition: twinvq_data.h:11134
frame.h
buffer.h
height
#define height
ff_frame_pool_get_audio_config
int ff_frame_pool_get_audio_config(FFFramePool *pool, int *channels, int *nb_samples, enum AVSampleFormat *format, int *align)
Get the audio frame pool configuration.
Definition: framepool.c:176
ff_frame_pool_get_video_config
int ff_frame_pool_get_video_config(FFFramePool *pool, int *width, int *height, enum AVPixelFormat *format, int *align)
Get the video frame pool configuration.
Definition: framepool.c:157
AVSampleFormat
AVSampleFormat
Audio sample formats.
Definition: samplefmt.h:58
FFFramePool::align
int align
Definition: framepool.c:45
AVBufferRef
A reference to a data buffer.
Definition: buffer.h:81
ff_frame_pool_uninit
void ff_frame_pool_uninit(FFFramePool **pool)
Deallocate the frame pool.
Definition: framepool.c:284
ff_frame_pool_audio_init
FFFramePool * ff_frame_pool_audio_init(AVBufferRef *(*alloc)(int size), int channels, int samples, enum AVSampleFormat format, int align)
Allocate and initialize an audio frame pool.
Definition: framepool.c:119