... | ... |
@@ -24,7 +24,7 @@ |
24 | 24 |
#include "libavutil/avassert.h" |
25 | 25 |
#include "avfilter.h" |
26 | 26 |
#include "bufferqueue.h" |
27 |
-#include "framesync.h" |
|
27 |
+#include "framesync2.h" |
|
28 | 28 |
#include "internal.h" |
29 | 29 |
|
30 | 30 |
#define OFFSET(member) offsetof(FFFrameSync, member) |
... | ... |
@@ -49,7 +49,7 @@ enum { |
49 | 49 |
STATE_EOF, |
50 | 50 |
}; |
51 | 51 |
|
52 |
-int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in) |
|
52 |
+int ff_framesync2_init(FFFrameSync *fs, void *parent, unsigned nb_in) |
|
53 | 53 |
{ |
54 | 54 |
fs->class = &framesync_class; |
55 | 55 |
fs->parent = parent; |
... | ... |
@@ -77,7 +77,7 @@ static void framesync_sync_level_update(FFFrameSync *fs) |
77 | 77 |
fs->eof = 1; |
78 | 78 |
} |
79 | 79 |
|
80 |
-int ff_framesync_configure(FFFrameSync *fs) |
|
80 |
+int ff_framesync2_configure(FFFrameSync *fs) |
|
81 | 81 |
{ |
82 | 82 |
unsigned i; |
83 | 83 |
int64_t gcd, lcm; |
... | ... |
@@ -202,7 +202,7 @@ static void framesync_inject_frame(FFFrameSync *fs, unsigned in, AVFrame *frame) |
202 | 202 |
fs->in[in].have_next = 1; |
203 | 203 |
} |
204 | 204 |
|
205 |
-int ff_framesync_add_frame(FFFrameSync *fs, unsigned in, AVFrame *frame) |
|
205 |
+int ff_framesync2_add_frame(FFFrameSync *fs, unsigned in, AVFrame *frame) |
|
206 | 206 |
{ |
207 | 207 |
av_assert1(in < fs->nb_in); |
208 | 208 |
if (!fs->in[in].have_next) |
... | ... |
@@ -212,7 +212,7 @@ int ff_framesync_add_frame(FFFrameSync *fs, unsigned in, AVFrame *frame) |
212 | 212 |
return 0; |
213 | 213 |
} |
214 | 214 |
|
215 |
-void ff_framesync_next(FFFrameSync *fs) |
|
215 |
+void ff_framesync2_next(FFFrameSync *fs) |
|
216 | 216 |
{ |
217 | 217 |
unsigned i; |
218 | 218 |
|
... | ... |
@@ -224,13 +224,13 @@ void ff_framesync_next(FFFrameSync *fs) |
224 | 224 |
framesync_advance(fs); |
225 | 225 |
} |
226 | 226 |
|
227 |
-void ff_framesync_drop(FFFrameSync *fs) |
|
227 |
+void ff_framesync2_drop(FFFrameSync *fs) |
|
228 | 228 |
{ |
229 | 229 |
fs->frame_ready = 0; |
230 | 230 |
} |
231 | 231 |
|
232 |
-int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, |
|
233 |
- unsigned get) |
|
232 |
+int ff_framesync2_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, |
|
233 |
+ unsigned get) |
|
234 | 234 |
{ |
235 | 235 |
AVFrame *frame; |
236 | 236 |
unsigned need_copy = 0, i; |
... | ... |
@@ -266,7 +266,7 @@ int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, |
266 | 266 |
return 0; |
267 | 267 |
} |
268 | 268 |
|
269 |
-void ff_framesync_uninit(FFFrameSync *fs) |
|
269 |
+void ff_framesync2_uninit(FFFrameSync *fs) |
|
270 | 270 |
{ |
271 | 271 |
unsigned i; |
272 | 272 |
|
... | ... |
@@ -279,18 +279,18 @@ void ff_framesync_uninit(FFFrameSync *fs) |
279 | 279 |
av_freep(&fs->in); |
280 | 280 |
} |
281 | 281 |
|
282 |
-int ff_framesync_process_frame(FFFrameSync *fs, unsigned all) |
|
282 |
+int ff_framesync2_process_frame(FFFrameSync *fs, unsigned all) |
|
283 | 283 |
{ |
284 | 284 |
int ret, count = 0; |
285 | 285 |
|
286 | 286 |
av_assert0(fs->on_event); |
287 | 287 |
while (1) { |
288 |
- ff_framesync_next(fs); |
|
288 |
+ ff_framesync2_next(fs); |
|
289 | 289 |
if (fs->eof || !fs->frame_ready) |
290 | 290 |
break; |
291 | 291 |
if ((ret = fs->on_event(fs)) < 0) |
292 | 292 |
return ret; |
293 |
- ff_framesync_drop(fs); |
|
293 |
+ ff_framesync2_drop(fs); |
|
294 | 294 |
count++; |
295 | 295 |
if (!all) |
296 | 296 |
break; |
... | ... |
@@ -300,26 +300,26 @@ int ff_framesync_process_frame(FFFrameSync *fs, unsigned all) |
300 | 300 |
return count; |
301 | 301 |
} |
302 | 302 |
|
303 |
-int ff_framesync_filter_frame(FFFrameSync *fs, AVFilterLink *inlink, |
|
304 |
- AVFrame *in) |
|
303 |
+int ff_framesync2_filter_frame(FFFrameSync *fs, AVFilterLink *inlink, |
|
304 |
+ AVFrame *in) |
|
305 | 305 |
{ |
306 | 306 |
int ret; |
307 | 307 |
|
308 |
- if ((ret = ff_framesync_process_frame(fs, 1)) < 0) |
|
308 |
+ if ((ret = ff_framesync2_process_frame(fs, 1)) < 0) |
|
309 | 309 |
return ret; |
310 |
- if ((ret = ff_framesync_add_frame(fs, FF_INLINK_IDX(inlink), in)) < 0) |
|
310 |
+ if ((ret = ff_framesync2_add_frame(fs, FF_INLINK_IDX(inlink), in)) < 0) |
|
311 | 311 |
return ret; |
312 |
- if ((ret = ff_framesync_process_frame(fs, 0)) < 0) |
|
312 |
+ if ((ret = ff_framesync2_process_frame(fs, 0)) < 0) |
|
313 | 313 |
return ret; |
314 | 314 |
return 0; |
315 | 315 |
} |
316 | 316 |
|
317 |
-int ff_framesync_request_frame(FFFrameSync *fs, AVFilterLink *outlink) |
|
317 |
+int ff_framesync2_request_frame(FFFrameSync *fs, AVFilterLink *outlink) |
|
318 | 318 |
{ |
319 | 319 |
AVFilterContext *ctx = outlink->src; |
320 | 320 |
int input, ret, i; |
321 | 321 |
|
322 |
- if ((ret = ff_framesync_process_frame(fs, 0)) < 0) |
|
322 |
+ if ((ret = ff_framesync2_process_frame(fs, 0)) < 0) |
|
323 | 323 |
return ret; |
324 | 324 |
if (ret > 0) |
325 | 325 |
return 0; |
... | ... |
@@ -333,9 +333,9 @@ int ff_framesync_request_frame(FFFrameSync *fs, AVFilterLink *outlink) |
333 | 333 |
input = i; |
334 | 334 |
ret = ff_request_frame(ctx->inputs[input]); |
335 | 335 |
if (ret == AVERROR_EOF) { |
336 |
- if ((ret = ff_framesync_add_frame(fs, input, NULL)) < 0) |
|
336 |
+ if ((ret = ff_framesync2_add_frame(fs, input, NULL)) < 0) |
|
337 | 337 |
return ret; |
338 |
- if ((ret = ff_framesync_process_frame(fs, 0)) < 0) |
|
338 |
+ if ((ret = ff_framesync2_process_frame(fs, 0)) < 0) |
|
339 | 339 |
return ret; |
340 | 340 |
ret = 0; |
341 | 341 |
} |
... | ... |
@@ -44,13 +44,13 @@ |
44 | 44 |
* The basic working of this API is the following: |
45 | 45 |
* |
46 | 46 |
* - When a frame is available on any input, add it using |
47 |
- * ff_framesync_add_frame(). |
|
47 |
+ * ff_framesync2_add_frame(). |
|
48 | 48 |
* |
49 | 49 |
* - When a frame event is ready to be processed (i.e. after adding a frame |
50 | 50 |
* or when requested on input): |
51 |
- * - call ff_framesync_next(); |
|
51 |
+ * - call ff_framesync2_next(); |
|
52 | 52 |
* - if fs->frame_ready is true, process the frames; |
53 |
- * - call ff_framesync_drop(). |
|
53 |
+ * - call ff_framesync2_drop(). |
|
54 | 54 |
*/ |
55 | 55 |
|
56 | 56 |
/** |
... | ... |
@@ -217,7 +217,7 @@ typedef struct FFFrameSync { |
217 | 217 |
* @param nb_in number of inputs |
218 | 218 |
* @return >= 0 for success or a negative error code |
219 | 219 |
*/ |
220 |
-int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in); |
|
220 |
+int ff_framesync2_init(FFFrameSync *fs, void *parent, unsigned nb_in); |
|
221 | 221 |
|
222 | 222 |
/** |
223 | 223 |
* Configure a frame sync structure. |
... | ... |
@@ -226,12 +226,12 @@ int ff_framesync_init(FFFrameSync *fs, void *parent, unsigned nb_in); |
226 | 226 |
* |
227 | 227 |
* @return >= 0 for success or a negative error code |
228 | 228 |
*/ |
229 |
-int ff_framesync_configure(FFFrameSync *fs); |
|
229 |
+int ff_framesync2_configure(FFFrameSync *fs); |
|
230 | 230 |
|
231 | 231 |
/** |
232 | 232 |
* Free all memory currently allocated. |
233 | 233 |
*/ |
234 |
-void ff_framesync_uninit(FFFrameSync *fs); |
|
234 |
+void ff_framesync2_uninit(FFFrameSync *fs); |
|
235 | 235 |
|
236 | 236 |
/** |
237 | 237 |
* Add a frame to an input |
... | ... |
@@ -242,19 +242,19 @@ void ff_framesync_uninit(FFFrameSync *fs); |
242 | 242 |
* @param in index of the input |
243 | 243 |
* @param frame input frame, or NULL for EOF |
244 | 244 |
*/ |
245 |
-int ff_framesync_add_frame(FFFrameSync *fs, unsigned in, AVFrame *frame); |
|
245 |
+int ff_framesync2_add_frame(FFFrameSync *fs, unsigned in, AVFrame *frame); |
|
246 | 246 |
|
247 | 247 |
/** |
248 | 248 |
* Prepare the next frame event. |
249 | 249 |
* |
250 | 250 |
* The status of the operation can be found in fs->frame_ready and fs->eof. |
251 | 251 |
*/ |
252 |
-void ff_framesync_next(FFFrameSync *fs); |
|
252 |
+void ff_framesync2_next(FFFrameSync *fs); |
|
253 | 253 |
|
254 | 254 |
/** |
255 | 255 |
* Drop the current frame event. |
256 | 256 |
*/ |
257 |
-void ff_framesync_drop(FFFrameSync *fs); |
|
257 |
+void ff_framesync2_drop(FFFrameSync *fs); |
|
258 | 258 |
|
259 | 259 |
/** |
260 | 260 |
* Get the current frame in an input. |
... | ... |
@@ -266,15 +266,15 @@ void ff_framesync_drop(FFFrameSync *fs); |
266 | 266 |
* the returned frame; the current frame will either be |
267 | 267 |
* duplicated or removed from the framesync structure |
268 | 268 |
*/ |
269 |
-int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, |
|
270 |
- unsigned get); |
|
269 |
+int ff_framesync2_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, |
|
270 |
+ unsigned get); |
|
271 | 271 |
|
272 | 272 |
/** |
273 | 273 |
* Process one or several frame using the on_event callback. |
274 | 274 |
* |
275 | 275 |
* @return number of frames processed or negative error code |
276 | 276 |
*/ |
277 |
-int ff_framesync_process_frame(FFFrameSync *fs, unsigned all); |
|
277 |
+int ff_framesync2_process_frame(FFFrameSync *fs, unsigned all); |
|
278 | 278 |
|
279 | 279 |
|
280 | 280 |
/** |
... | ... |
@@ -283,8 +283,8 @@ int ff_framesync_process_frame(FFFrameSync *fs, unsigned all); |
283 | 283 |
* This function can be the complete implementation of all filter_frame |
284 | 284 |
* methods of a filter using framesync. |
285 | 285 |
*/ |
286 |
-int ff_framesync_filter_frame(FFFrameSync *fs, AVFilterLink *inlink, |
|
287 |
- AVFrame *in); |
|
286 |
+int ff_framesync2_filter_frame(FFFrameSync *fs, AVFilterLink *inlink, |
|
287 |
+ AVFrame *in); |
|
288 | 288 |
|
289 | 289 |
/** |
290 | 290 |
* Request a frame on the filter output. |
... | ... |
@@ -292,6 +292,6 @@ int ff_framesync_filter_frame(FFFrameSync *fs, AVFilterLink *inlink, |
292 | 292 |
* This function can be the complete implementation of all filter_frame |
293 | 293 |
* methods of a filter using framesync if it has only one output. |
294 | 294 |
*/ |
295 |
-int ff_framesync_request_frame(FFFrameSync *fs, AVFilterLink *outlink); |
|
295 |
+int ff_framesync2_request_frame(FFFrameSync *fs, AVFilterLink *outlink); |
|
296 | 296 |
|
297 | 297 |
#endif /* AVFILTER_FRAMESYNC2_H */ |