| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
| 10 #include "chromecast/media/cma/ipc/media_memory_chunk.h" | 10 #include "chromecast/media/cma/ipc/media_memory_chunk.h" |
| 11 #include "chromecast/media/cma/ipc/media_message.h" | 11 #include "chromecast/media/cma/ipc/media_message.h" |
| 12 #include "chromecast/media/cma/ipc/media_message_fifo.h" | 12 #include "chromecast/media/cma/ipc/media_message_fifo.h" |
| 13 #include "chromecast/media/cma/ipc/media_message_type.h" | 13 #include "chromecast/media/cma/ipc/media_message_type.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 15 |
| 16 namespace chromecast { | 16 namespace chromecast { |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 class FifoMemoryChunk : public MediaMemoryChunk { | 21 class FifoMemoryChunk : public MediaMemoryChunk { |
| 22 public: | 22 public: |
| 23 FifoMemoryChunk(void* mem, size_t size) | 23 FifoMemoryChunk(void* mem, size_t size) |
| 24 : mem_(mem), size_(size) {} | 24 : mem_(mem), size_(size) {} |
| 25 virtual ~FifoMemoryChunk() {} | 25 virtual ~FifoMemoryChunk() {} |
| 26 | 26 |
| 27 virtual void* data() const OVERRIDE { return mem_; } | 27 virtual void* data() const override { return mem_; } |
| 28 virtual size_t size() const OVERRIDE { return size_; } | 28 virtual size_t size() const override { return size_; } |
| 29 virtual bool valid() const OVERRIDE { return true; } | 29 virtual bool valid() const override { return true; } |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 void* mem_; | 32 void* mem_; |
| 33 size_t size_; | 33 size_t size_; |
| 34 | 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(FifoMemoryChunk); | 35 DISALLOW_COPY_AND_ASSIGN(FifoMemoryChunk); |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 void MsgProducer(scoped_ptr<MediaMessageFifo> fifo, | 38 void MsgProducer(scoped_ptr<MediaMessageFifo> fifo, |
| 39 int msg_count, | 39 int msg_count, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 producer_event_done.Wait(); | 186 producer_event_done.Wait(); |
| 187 consumer_event_done.Wait(); | 187 consumer_event_done.Wait(); |
| 188 | 188 |
| 189 producer_thread.reset(); | 189 producer_thread.reset(); |
| 190 consumer_thread.reset(); | 190 consumer_thread.reset(); |
| 191 } | 191 } |
| 192 | 192 |
| 193 } // namespace media | 193 } // namespace media |
| 194 } // namespace chromecast | 194 } // namespace chromecast |
| 195 | 195 |
| OLD | NEW |