content/media/VideoPlaybackQuality.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/media/VideoPlaybackQuality.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     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 mozilla_dom_VideoPlaybackQuality_h_
    1.11 +#define mozilla_dom_VideoPlaybackQuality_h_
    1.12 +
    1.13 +#include "mozilla/dom/HTMLMediaElement.h"
    1.14 +#include "nsCycleCollectionParticipant.h"
    1.15 +#include "nsDOMNavigationTiming.h"
    1.16 +#include "nsWrapperCache.h"
    1.17 +
    1.18 +namespace mozilla {
    1.19 +namespace dom {
    1.20 +
    1.21 +class VideoPlaybackQuality MOZ_FINAL : public nsWrapperCache
    1.22 +{
    1.23 +public:
    1.24 +  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VideoPlaybackQuality)
    1.25 +  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VideoPlaybackQuality)
    1.26 +
    1.27 +  VideoPlaybackQuality(HTMLMediaElement* aElement, DOMHighResTimeStamp aCreationTime,
    1.28 +                       uint64_t aTotalFrames, uint64_t aDroppedFrames,
    1.29 +                       uint64_t aCorruptedFrames);
    1.30 +
    1.31 +  HTMLMediaElement* GetParentObject() const;
    1.32 +
    1.33 +  JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    1.34 +
    1.35 +  DOMHighResTimeStamp CreationTime() const
    1.36 +  {
    1.37 +    return mCreationTime;
    1.38 +  }
    1.39 +
    1.40 +  uint64_t TotalVideoFrames()
    1.41 +  {
    1.42 +    return mTotalFrames;
    1.43 +  }
    1.44 +
    1.45 +  uint64_t DroppedVideoFrames()
    1.46 +  {
    1.47 +    return mDroppedFrames;
    1.48 +  }
    1.49 +
    1.50 +  uint64_t CorruptedVideoFrames()
    1.51 +  {
    1.52 +    return mCorruptedFrames;
    1.53 +  }
    1.54 +
    1.55 +private:
    1.56 +  nsRefPtr<HTMLMediaElement> mElement;
    1.57 +  DOMHighResTimeStamp mCreationTime;
    1.58 +  uint64_t mTotalFrames;
    1.59 +  uint64_t mDroppedFrames;
    1.60 +  uint64_t mCorruptedFrames;
    1.61 +};
    1.62 +
    1.63 +} // namespace dom
    1.64 +} // namespace mozilla
    1.65 +#endif /* mozilla_dom_VideoPlaybackQuality_h_ */

mercurial