FFmpegKit Linux API 6.0
Loading...
Searching...
No Matches
fftools_sync_queue.h
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 * Copyright (c) 2023 ARTHENICA LTD
4 *
5 * FFmpeg is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * FFmpeg is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with FFmpeg; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20/*
21 * This file is the modified version of sync_queue.h file living in ffmpeg source code under the fftools folder. We
22 * manually update it each time we depend on a new ffmpeg version. Below you can see the list of changes applied
23 * by us to develop ffmpeg-kit library.
24 *
25 * ffmpeg-kit changes by ARTHENICA LTD
26 *
27 * 07.2023
28 * --------------------------------------------------------
29 * - FFmpeg 6.0 changes migrated
30 */
31
32#ifndef FFTOOLS_SYNC_QUEUE_H
33#define FFTOOLS_SYNC_QUEUE_H
34
35#include <stdint.h>
36
37#include "libavcodec/packet.h"
38
39#include "libavutil/frame.h"
40
44};
45
46typedef union SyncQueueFrame {
47 AVFrame *f;
48 AVPacket *p;
50
51#define SQFRAME(frame) ((SyncQueueFrame){ .f = (frame) })
52#define SQPKT(pkt) ((SyncQueueFrame){ .p = (pkt) })
53
54typedef struct SyncQueue SyncQueue;
55
62void sq_free(SyncQueue **sq);
63
73int sq_add_stream(SyncQueue *sq, int limiting);
74
79void sq_set_tb(SyncQueue *sq, unsigned int stream_idx, AVRational tb);
80
85void sq_limit_frames(SyncQueue *sq, unsigned int stream_idx,
86 uint64_t max_frames);
87
102int sq_send(SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame);
103
120int sq_receive(SyncQueue *sq, int stream_idx, SyncQueueFrame frame);
121
122#endif // FFTOOLS_SYNC_QUEUE_H
SyncQueue * sq_alloc(enum SyncQueueType type, int64_t buf_size_us)
int sq_send(SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame)
void sq_free(SyncQueue **sq)
void sq_set_tb(SyncQueue *sq, unsigned int stream_idx, AVRational tb)
SyncQueueType
@ SYNC_QUEUE_FRAMES
@ SYNC_QUEUE_PACKETS
int sq_receive(SyncQueue *sq, int stream_idx, SyncQueueFrame frame)
void sq_limit_frames(SyncQueue *sq, unsigned int stream_idx, uint64_t max_frames)
int sq_add_stream(SyncQueue *sq, int limiting)
enum SyncQueueType type
int64_t buf_size_us