Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:set ts=2 sw=2 sts=2 tw=80 et cindent: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef nsMediaSniffer_h |
michael@0 | 8 | #define nsMediaSniffer_h |
michael@0 | 9 | |
michael@0 | 10 | #include "nsIModule.h" |
michael@0 | 11 | #include "nsIFactory.h" |
michael@0 | 12 | |
michael@0 | 13 | #include "nsIComponentManager.h" |
michael@0 | 14 | #include "nsIComponentRegistrar.h" |
michael@0 | 15 | #include "nsIContentSniffer.h" |
michael@0 | 16 | #include "mozilla/Attributes.h" |
michael@0 | 17 | |
michael@0 | 18 | // ed905ba3-c656-480e-934e-6bc35bd36aff |
michael@0 | 19 | #define NS_MEDIA_SNIFFER_CID \ |
michael@0 | 20 | {0x3fdd6c28, 0x5b87, 0x4e3e, \ |
michael@0 | 21 | {0x8b, 0x57, 0x8e, 0x83, 0xc2, 0x3c, 0x1a, 0x6d}} |
michael@0 | 22 | |
michael@0 | 23 | #define NS_MEDIA_SNIFFER_CONTRACTID "@mozilla.org/media/sniffer;1" |
michael@0 | 24 | |
michael@0 | 25 | class nsMediaSniffer MOZ_FINAL : public nsIContentSniffer |
michael@0 | 26 | { |
michael@0 | 27 | public: |
michael@0 | 28 | NS_DECL_ISUPPORTS |
michael@0 | 29 | NS_DECL_NSICONTENTSNIFFER |
michael@0 | 30 | protected: |
michael@0 | 31 | ~nsMediaSniffer() {} |
michael@0 | 32 | |
michael@0 | 33 | #define PATTERN_ENTRY(mask, pattern, contentType) \ |
michael@0 | 34 | {(const uint8_t*)mask, (const uint8_t*)pattern, sizeof(mask) - 1, contentType} |
michael@0 | 35 | |
michael@0 | 36 | struct nsMediaSnifferEntry { |
michael@0 | 37 | const uint8_t* mMask; |
michael@0 | 38 | const uint8_t* mPattern; |
michael@0 | 39 | const uint32_t mLength; |
michael@0 | 40 | const char* mContentType; |
michael@0 | 41 | }; |
michael@0 | 42 | |
michael@0 | 43 | static nsMediaSnifferEntry sSnifferEntries[]; |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | #endif |