wavelength 1.0.0
Loading...
Searching...
No Matches
streambuffer.h
Go to the documentation of this file.
1#pragma once
2
4
7 int mValue;
8 int mPadding[15];
9};
10
17class StreamBuffer : public RingBuffer {
18public:
20 static constexpr unsigned int kSize = 0xf000;
21
29 explicit StreamBuffer(unsigned int size);
30
37 ~StreamBuffer() override;
38
48 static int SendStatus(int value, void *address);
49
57 void SetStatusAddress(void *address);
58
68 void Write(const void *data, unsigned int size, bool endOfStream) override;
69
76 void Notify() override;
77
78private:
79 int mReserved; // +0x24, cleared by the constructor and never read.
80 void *mStatusAddress;
81 bool mNotifyPending;
82};
RingBuffer(unsigned int size)
Allocate and clear a buffer of size bytes, rounded down to whole words, with both pointers at its sta...
~StreamBuffer() override
Free the buffer.
static int SendStatus(int value, void *address)
Write a word to EE memory over SIF DMA.
void Notify() override
Send the free space to the EE when a notification is scheduled and the space is positive.
StreamBuffer(unsigned int size)
Allocate the buffer.
static constexpr unsigned int kSize
Buffer size in bytes.
Definition streambuffer.h:20
void SetStatusAddress(void *address)
Record the EE address that receives the free space, and write 1 there.
void Write(const void *data, unsigned int size, bool endOfStream) override
Append bytes and schedule a notification.
The packet StreamBuffer::SendStatus() sends.
Definition streambuffer.h:6
int mPadding[15]
Definition streambuffer.h:8
int mValue
Definition streambuffer.h:7