2023-03-02 09:07:25 +01:00
|
|
|
#ifndef SC_PACKET_SOURCE_H
|
|
|
|
|
#define SC_PACKET_SOURCE_H
|
|
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
2024-12-20 20:58:41 +01:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
|
|
#include "trait/packet_sink.h"
|
2023-03-02 09:07:25 +01:00
|
|
|
|
2026-03-13 08:18:36 +00:00
|
|
|
#define SC_PACKET_SOURCE_MAX_SINKS 3
|
2023-03-02 09:07:25 +01:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Packet source trait
|
|
|
|
|
*
|
|
|
|
|
* Component able to send AVPackets should implement this trait.
|
|
|
|
|
*/
|
|
|
|
|
struct sc_packet_source {
|
|
|
|
|
struct sc_packet_sink *sinks[SC_PACKET_SOURCE_MAX_SINKS];
|
|
|
|
|
unsigned sink_count;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_packet_source_init(struct sc_packet_source *source);
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_packet_source_add_sink(struct sc_packet_source *source,
|
|
|
|
|
struct sc_packet_sink *sink);
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
sc_packet_source_sinks_open(struct sc_packet_source *source,
|
2023-03-10 19:25:45 +01:00
|
|
|
AVCodecContext *ctx);
|
2023-03-02 09:07:25 +01:00
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_packet_source_sinks_close(struct sc_packet_source *source);
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
sc_packet_source_sinks_push(struct sc_packet_source *source,
|
|
|
|
|
const AVPacket *packet);
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
sc_packet_source_sinks_disable(struct sc_packet_source *source);
|
|
|
|
|
|
|
|
|
|
#endif
|