Line data Source code
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 0 : class OggCodecStore
20 : {
21 : public:
22 : OggCodecStore();
23 : void Add(uint32_t serial, OggCodecState* codecState);
24 : bool Contains(uint32_t serial);
25 : OggCodecState* Get(uint32_t serial);
26 : bool IsKnownStream(uint32_t aSerial);
27 :
28 : private:
29 : // Maps Ogg serialnos to OggStreams.
30 : nsClassHashtable<nsUint32HashKey, OggCodecState> mCodecStates;
31 :
32 : // Protects the |mCodecStates| and the |mKnownStreams| members.
33 : Monitor mMonitor;
34 : };
35 :
36 : } // namespace mozilla
37 :
38 : #endif
|