Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 3 | pmbaty | 1 | /* bufferlist.h */ |
| 2 | |||
| 3 | /* A class for buffering the I/O and allow multiple streams to read the data |
||
| 4 | asynchronously */ |
||
| 5 | |||
| 6 | #ifndef _MPEGLIST_H_ |
||
| 7 | #define _MPEGLIST_H_ |
||
| 8 | |||
| 9 | #include "SDL.h" |
||
| 10 | |||
| 11 | class MPEGlist { |
||
| 12 | public: |
||
| 13 | MPEGlist(); |
||
| 14 | ~MPEGlist(); |
||
| 15 | |||
| 16 | /* Get to the next free buffer or allocate a new one if none is free */ |
||
| 17 | MPEGlist * Alloc(Uint32 Buffer_Size); |
||
| 18 | |||
| 19 | /* Lock current buffer */ |
||
| 20 | void Lock(); |
||
| 21 | |||
| 22 | /* Unlock current buffer */ |
||
| 23 | void Unlock(); |
||
| 24 | |||
| 25 | /* Get the buffer */ |
||
| 26 | inline void * Buffer() { return(data); }; |
||
| 27 | |||
| 28 | inline Uint32 Size() { return(size); }; |
||
| 29 | |||
| 30 | inline MPEGlist * Next() { return(next); }; |
||
| 31 | |||
| 32 | inline MPEGlist * Prev() { return(prev); }; |
||
| 33 | |||
| 34 | inline Uint32 IsLocked() { return(lock); }; |
||
| 35 | |||
| 36 | double TimeStamp; |
||
| 37 | |||
| 38 | private: |
||
| 39 | class MPEGlist * next; |
||
| 40 | class MPEGlist * prev; |
||
| 41 | Uint32 lock; |
||
| 42 | Uint8 * data; |
||
| 43 | Uint32 size; |
||
| 44 | }; |
||
| 45 | #endif |