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 tw=80 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 :
7 : #ifndef nsMediaSniffer_h
8 : #define nsMediaSniffer_h
9 :
10 : #include "nsIModule.h"
11 : #include "nsIFactory.h"
12 :
13 : #include "nsIComponentManager.h"
14 : #include "nsIComponentRegistrar.h"
15 : #include "nsIContentSniffer.h"
16 : #include "mozilla/Attributes.h"
17 :
18 : // ed905ba3-c656-480e-934e-6bc35bd36aff
19 : #define NS_MEDIA_SNIFFER_CID \
20 : {0x3fdd6c28, 0x5b87, 0x4e3e, \
21 : {0x8b, 0x57, 0x8e, 0x83, 0xc2, 0x3c, 0x1a, 0x6d}}
22 :
23 : #define NS_MEDIA_SNIFFER_CONTRACTID "@mozilla.org/media/sniffer;1"
24 :
25 : #define PATTERN_ENTRY(mask, pattern, contentType) \
26 : {(const uint8_t*)mask, (const uint8_t*)pattern, sizeof(mask) - 1, contentType}
27 :
28 : struct nsMediaSnifferEntry {
29 : const uint8_t* mMask;
30 : const uint8_t* mPattern;
31 : const uint32_t mLength;
32 : const char* mContentType;
33 : };
34 :
35 1 : class nsMediaSniffer final : public nsIContentSniffer
36 : {
37 : public:
38 : NS_DECL_ISUPPORTS
39 : NS_DECL_NSICONTENTSNIFFER
40 :
41 : private:
42 0 : ~nsMediaSniffer() {}
43 :
44 : static nsMediaSnifferEntry sSnifferEntries[];
45 : };
46 :
47 : #endif
|