toolkit/components/mediasniffer/nsMediaSniffer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/mediasniffer/nsMediaSniffer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,46 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim:set ts=2 sw=2 sts=2 tw=80 et cindent: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef nsMediaSniffer_h
    1.11 +#define nsMediaSniffer_h
    1.12 +
    1.13 +#include "nsIModule.h"
    1.14 +#include "nsIFactory.h"
    1.15 +
    1.16 +#include "nsIComponentManager.h"
    1.17 +#include "nsIComponentRegistrar.h"
    1.18 +#include "nsIContentSniffer.h"
    1.19 +#include "mozilla/Attributes.h"
    1.20 +
    1.21 +// ed905ba3-c656-480e-934e-6bc35bd36aff
    1.22 +#define NS_MEDIA_SNIFFER_CID \
    1.23 +{0x3fdd6c28, 0x5b87, 0x4e3e, \
    1.24 +{0x8b, 0x57, 0x8e, 0x83, 0xc2, 0x3c, 0x1a, 0x6d}}
    1.25 +
    1.26 +#define NS_MEDIA_SNIFFER_CONTRACTID "@mozilla.org/media/sniffer;1"
    1.27 +
    1.28 +class nsMediaSniffer MOZ_FINAL : public nsIContentSniffer
    1.29 +{
    1.30 +  public:
    1.31 +    NS_DECL_ISUPPORTS
    1.32 +    NS_DECL_NSICONTENTSNIFFER
    1.33 +  protected:
    1.34 +    ~nsMediaSniffer() {}
    1.35 +
    1.36 +#define PATTERN_ENTRY(mask, pattern, contentType) \
    1.37 +    {(const uint8_t*)mask, (const uint8_t*)pattern, sizeof(mask) - 1, contentType}
    1.38 +
    1.39 +  struct nsMediaSnifferEntry {
    1.40 +    const uint8_t* mMask;
    1.41 +    const uint8_t* mPattern;
    1.42 +    const uint32_t mLength;
    1.43 +    const char* mContentType;
    1.44 +  };
    1.45 +
    1.46 +  static nsMediaSnifferEntry sSnifferEntries[];
    1.47 +};
    1.48 +
    1.49 +#endif

mercurial