55806e7d31
This flag forced the decoder to wait for the previous frame to be
consumed by the display.
It was initially implemented as a compilation flag for testing, not
intended to be exposed at runtime. But to remove ifdefs and to allow
users to test this flag easily, it had finally been exposed by commit
ebccb9f6cc
.
In practice, it turned out to be useless: it had no practical impact,
and it did not solve or mitigate any performance issues causing frame
skipping.
But that added some complexity to the codebase: it required an
additional condition variable, and made video buffer calls possibly
blocking, which in turn required code to interrupt it on exit.
To prepare support for multiple sinks plugged to the decoder (display
and v4l2 for example), the blocking call used for pacing the decoder
output becomes unacceptable, so just remove this useless "feature".
37 lines
757 B
C
37 lines
757 B
C
#ifndef STREAM_H
|
|
#define STREAM_H
|
|
|
|
#include "common.h"
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <libavformat/avformat.h>
|
|
#include <SDL2/SDL_atomic.h>
|
|
|
|
#include "util/net.h"
|
|
#include "util/thread.h"
|
|
|
|
struct stream {
|
|
socket_t socket;
|
|
sc_thread thread;
|
|
struct decoder *decoder;
|
|
struct recorder *recorder;
|
|
AVCodecContext *codec_ctx;
|
|
AVCodecParserContext *parser;
|
|
// successive packets may need to be concatenated, until a non-config
|
|
// packet is available
|
|
bool has_pending;
|
|
AVPacket pending;
|
|
};
|
|
|
|
void
|
|
stream_init(struct stream *stream, socket_t socket,
|
|
struct decoder *decoder, struct recorder *recorder);
|
|
|
|
bool
|
|
stream_start(struct stream *stream);
|
|
|
|
void
|
|
stream_join(struct stream *stream);
|
|
|
|
#endif
|