Loading...
Searching...
No Matches
fftools_sync_queue.h
Go to the documentation of this file.
/*
* This file is part of FFmpeg.
* Copyright (c) 2023 ARTHENICA LTD
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* This file is the modified version of sync_queue.h file living in ffmpeg source code under the fftools folder. We
* manually update it each time we depend on a new ffmpeg version. Below you can see the list of changes applied
* by us to develop ffmpeg-kit library.
*
* ffmpeg-kit changes by ARTHENICA LTD
*
* 07.2023
* --------------------------------------------------------
* - FFmpeg 6.0 changes migrated
*/
#ifndef FFTOOLS_SYNC_QUEUE_H
#define FFTOOLS_SYNC_QUEUE_H
#include <stdint.h>
#include "libavcodec/packet.h"
#include "libavutil/frame.h"
enum SyncQueueType {
SYNC_QUEUE_PACKETS,
SYNC_QUEUE_FRAMES,
};
typedef union SyncQueueFrame {
AVFrame *f;
AVPacket *p;
} SyncQueueFrame;
#define SQFRAME(frame) ((SyncQueueFrame){ .f = (frame) })
#define SQPKT(pkt) ((SyncQueueFrame){ .p = (pkt) })
typedef struct SyncQueue SyncQueue;
SyncQueue *sq_alloc(enum SyncQueueType type, int64_t buf_size_us);
void sq_free(SyncQueue **sq);
int sq_add_stream(SyncQueue *sq, int limiting);
void sq_set_tb(SyncQueue *sq, unsigned int stream_idx, AVRational tb);
void sq_limit_frames(SyncQueue *sq, unsigned int stream_idx,
uint64_t max_frames);
int sq_send(SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame);
int sq_receive(SyncQueue *sq, int stream_idx, SyncQueueFrame frame);
#endif // FFTOOLS_SYNC_QUEUE_H
sq_alloc
SyncQueue * sq_alloc(enum SyncQueueType type, int64_t buf_size_us)
Definition fftools_sync_queue.c:419
sq_send
int sq_send(SyncQueue *sq, unsigned int stream_idx, SyncQueueFrame frame)
Definition fftools_sync_queue.c:248
sq_free
void sq_free(SyncQueue **sq)
Definition fftools_sync_queue.c:442
sq_set_tb
void sq_set_tb(SyncQueue *sq, unsigned int stream_idx, AVRational tb)
Definition fftools_sync_queue.c:392
SyncQueueType
SyncQueueType
Definition fftools_sync_queue.h:41
SYNC_QUEUE_FRAMES
@ SYNC_QUEUE_FRAMES
Definition fftools_sync_queue.h:43
SYNC_QUEUE_PACKETS
@ SYNC_QUEUE_PACKETS
Definition fftools_sync_queue.h:42
sq_receive
int sq_receive(SyncQueue *sq, int stream_idx, SyncQueueFrame frame)
Definition fftools_sync_queue.c:353
sq_limit_frames
void sq_limit_frames(SyncQueue *sq, unsigned int stream_idx, uint64_t max_frames)
Definition fftools_sync_queue.c:407
sq_add_stream
int sq_add_stream(SyncQueue *sq, int limiting)
Definition fftools_sync_queue.c:365
SyncQueue
Definition fftools_sync_queue.c:59
SyncQueue::type
enum SyncQueueType type
Definition fftools_sync_queue.c:60
SyncQueue::buf_size_us
int64_t buf_size_us
Definition fftools_sync_queue.c:71
SyncQueueFrame
Definition fftools_sync_queue.h:46
SyncQueueFrame::f
AVFrame * f
Definition fftools_sync_queue.h:47
SyncQueueFrame::p
AVPacket * p
Definition fftools_sync_queue.h:48