Give a name to decoder instances

This will be useful in logs.

PR #3757 <https://github.com/Genymobile/scrcpy/pull/3757>
This commit is contained in:
Romain Vimont
2023-02-24 21:22:35 +01:00
parent 1daf8e8611
commit d4407f1289
3 changed files with 12 additions and 6 deletions

View File

@@ -14,6 +14,8 @@
struct sc_decoder {
struct sc_packet_sink packet_sink; // packet sink trait
const char *name; // must be statically allocated (e.g. a string literal)
struct sc_frame_sink *sinks[SC_DECODER_MAX_SINKS];
unsigned sink_count;
@@ -21,8 +23,9 @@ struct sc_decoder {
AVFrame *frame;
};
// The name must be statically allocated (e.g. a string literal)
void
sc_decoder_init(struct sc_decoder *decoder);
sc_decoder_init(struct sc_decoder *decoder, const char *name);
void
sc_decoder_add_sink(struct sc_decoder *decoder, struct sc_frame_sink *sink);