1 /* 2 * Copyright (C) 2010 David McPaul 3 * 4 * All rights reserved. Distributed under the terms of the MIT License. 5 */ 6 7 #ifndef __BUFFER_MIXER__ 8 #define __BUFFER_MIXER__ 9 10 #include <media/Buffer.h> 11 #include <map> 12 13 class BufferMixer { 14 public: 15 BufferMixer(); 16 ~BufferMixer(); 17 18 bool isBufferAvailable(); 19 BBuffer *GetOutputBuffer(); 20 void AddBuffer(int32 id, BBuffer *buffer, bool isPrimary); 21 void RemoveBuffer(int32 id); 22 void Merge(BBuffer *input, BBuffer *output); 23 24 private: 25 std::map<int32, BBuffer *> groupedBuffers; 26 }; 27 28 #endif //__BUFFER_MIXER__ 29