mirror of
https://github.com/livepeer/lpms
synced 2026-04-23 00:07:25 +08:00
c74c5c69a3
Output side counterpart to the StreamBuffer. It is not exactly the same solution, because input and output characteristics are quite different (for one, on the input side stream is just a series of bytes, whereas on the output side we are able to tell packets apart, assign timestamps, packet types, etc). There is simple Golang code for writing the data into the files, so that some tests will pass with this code. Note that the big problem with the queue output is that some muxers (for example mp4) need to be able to seek() in output, and we don't allow that.
21 lines
627 B
C
21 lines
627 B
C
#ifndef _LPMS_ENCODER_H_
|
|
#define _LPMS_ENCODER_H_
|
|
|
|
#include "decoder.h"
|
|
#include "transcoder.h"
|
|
#include "filter.h"
|
|
#include "output_queue.h"
|
|
|
|
enum FreeOutputPolicy {
|
|
FORCE_CLOSE_HW_ENCODER,
|
|
PRESERVE_HW_ENCODER
|
|
};
|
|
|
|
int open_output(struct output_ctx *octx, struct input_ctx *ictx, OutputQueue *queue);
|
|
void free_output(struct output_ctx *octx, enum FreeOutputPolicy);
|
|
int process_out(struct input_ctx *ictx, struct output_ctx *octx, AVCodecContext *encoder, AVStream *ost,
|
|
struct filter_ctx *filter, AVFrame *inf);
|
|
int mux(AVPacket *pkt, AVRational tb, struct output_ctx *octx, AVStream *ost);
|
|
|
|
#endif // _LPMS_ENCODER_H_
|