Privatize recorder threading

The fact that the recorder uses a separate thread is an internal detail,
so the functions _start(), _stop() and _join() should not be exposed.

Instead, start the thread on _open() and _stop()+_join() on close().

This paves the way to expose the recorder as a packet sink trait.
This commit is contained in:
Romain Vimont
2021-04-11 15:01:05 +02:00
parent a974483c15
commit fe8de893ca
3 changed files with 15 additions and 45 deletions

View File

@@ -28,7 +28,7 @@ struct recorder {
sc_thread thread;
sc_mutex mutex;
sc_cond queue_cond;
bool stopped; // set on recorder_stop() by the stream reader
bool stopped; // set on recorder_close()
bool failed; // set on packet write failure
struct recorder_queue queue;
@@ -52,15 +52,6 @@ recorder_open(struct recorder *recorder, const AVCodec *input_codec);
void
recorder_close(struct recorder *recorder);
bool
recorder_start(struct recorder *recorder);
void
recorder_stop(struct recorder *recorder);
void
recorder_join(struct recorder *recorder);
bool
recorder_push(struct recorder *recorder, const AVPacket *packet);