ReorderQueue.h (821B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 // Queue for ordering decoded video frames by presentation time. 6 // Decoders often return frames out of order, which we need to 7 // buffer so we can forward them in correct presentation order. 8 9 #ifndef mozilla_ReorderQueue_h 10 #define mozilla_ReorderQueue_h 11 12 #include <MediaData.h> 13 #include <nsTPriorityQueue.h> 14 15 namespace mozilla { 16 17 struct ReorderQueueComparator { 18 bool LessThan(MediaData* const& a, MediaData* const& b) const { 19 return a->mTime < b->mTime; 20 } 21 }; 22 23 typedef nsTPriorityQueue<RefPtr<MediaData>, ReorderQueueComparator> 24 ReorderQueue; 25 26 } // namespace mozilla 27 28 #endif // mozilla_ReorderQueue_h