OggCodecStore.h (1103B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim:set ts=2 sw=2 sts=2 et cindent: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #if !defined(OggCodecStore_h_) 7 # define OggCodecStore_h_ 8 9 # include <ogg/ogg.h> 10 11 # include "OggCodecState.h" 12 # include "VideoUtils.h" 13 # include "mozilla/Monitor.h" 14 15 namespace mozilla { 16 17 // Thread safe container to store the codec information and the serial for each 18 // streams. 19 class OggCodecStore { 20 public: 21 OggCodecStore(); 22 OggCodecState* Add(uint32_t serial, UniquePtr<OggCodecState> codecState); 23 bool Contains(uint32_t serial); 24 OggCodecState* Get(uint32_t serial); 25 bool IsKnownStream(uint32_t aSerial); 26 27 private: 28 // Maps Ogg serialnos to OggStreams. 29 nsClassHashtable<nsUint32HashKey, OggCodecState> mCodecStates; 30 31 // Protects the |mCodecStates| and the |mKnownStreams| members. 32 Monitor mMonitor MOZ_UNANNOTATED; 33 }; 34 35 } // namespace mozilla 36 37 #endif