aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-10 10:33:43 +0200
committerMax Kellermann <max@duempel.org>2014-07-10 10:33:43 +0200
commitb1233925928b86a4ff1acb0028f3c8d3b1b2e5e1 (patch)
tree95fd14ee7168126927d5a6d4e6f758edbb58be93
parentccbb5c3e01682ccdd44a34b66a2eb213b2a1d661 (diff)
downloadmpd-b1233925928b86a4ff1acb0028f3c8d3b1b2e5e1.tar.gz
mpd-b1233925928b86a4ff1acb0028f3c8d3b1b2e5e1.tar.xz
mpd-b1233925928b86a4ff1acb0028f3c8d3b1b2e5e1.zip
input/async: more API documentation
-rw-r--r--src/input/AsyncInputStream.hxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/input/AsyncInputStream.hxx b/src/input/AsyncInputStream.hxx
index c2055c17d..6e0031a0a 100644
--- a/src/input/AsyncInputStream.hxx
+++ b/src/input/AsyncInputStream.hxx
@@ -78,14 +78,25 @@ public:
size_t Read(void *ptr, size_t read_size, Error &error) final;
protected:
+ /**
+ * Pass an tag from the I/O thread to the client thread.
+ */
void SetTag(Tag *_tag);
void Pause();
+ /**
+ * Declare that the underlying stream was closed. We will
+ * continue feeding Read() calls from the buffer until it runs
+ * empty.
+ */
void SetClosed() {
open = false;
}
+ /**
+ * Pass an error from the I/O thread to the client thread.
+ */
void PostponeError(Error &&error);
bool IsBufferEmpty() const {
@@ -96,13 +107,24 @@ protected:
return buffer.IsFull();
}
+ /**
+ * Determine how many bytes can be added to the buffer.
+ */
gcc_pure
size_t GetBufferSpace() const {
return buffer.GetSpace();
}
+ /**
+ * Append data to the buffer. The size must fit into the
+ * buffer; see GetBufferSpace().
+ */
void AppendToBuffer(const void *data, size_t append_size);
+ /**
+ * Implement code here that will resume the stream after it
+ * has been paused due to full input buffer.
+ */
virtual void DoResume() = 0;
/**
@@ -116,6 +138,10 @@ protected:
return seek_state == SeekState::PENDING;
}
+ /**
+ * Call this after seeking has finished. It will notify the
+ * client thread.
+ */
void SeekDone();
private: