michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 tw=80 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsMediaSniffer_h michael@0: #define nsMediaSniffer_h michael@0: michael@0: #include "nsIModule.h" michael@0: #include "nsIFactory.h" michael@0: michael@0: #include "nsIComponentManager.h" michael@0: #include "nsIComponentRegistrar.h" michael@0: #include "nsIContentSniffer.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: // ed905ba3-c656-480e-934e-6bc35bd36aff michael@0: #define NS_MEDIA_SNIFFER_CID \ michael@0: {0x3fdd6c28, 0x5b87, 0x4e3e, \ michael@0: {0x8b, 0x57, 0x8e, 0x83, 0xc2, 0x3c, 0x1a, 0x6d}} michael@0: michael@0: #define NS_MEDIA_SNIFFER_CONTRACTID "@mozilla.org/media/sniffer;1" michael@0: michael@0: class nsMediaSniffer MOZ_FINAL : public nsIContentSniffer michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSICONTENTSNIFFER michael@0: protected: michael@0: ~nsMediaSniffer() {} michael@0: michael@0: #define PATTERN_ENTRY(mask, pattern, contentType) \ michael@0: {(const uint8_t*)mask, (const uint8_t*)pattern, sizeof(mask) - 1, contentType} michael@0: michael@0: struct nsMediaSnifferEntry { michael@0: const uint8_t* mMask; michael@0: const uint8_t* mPattern; michael@0: const uint32_t mLength; michael@0: const char* mContentType; michael@0: }; michael@0: michael@0: static nsMediaSnifferEntry sSnifferEntries[]; michael@0: }; michael@0: michael@0: #endif