content/media/VideoPlaybackQuality.h

branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
equal deleted inserted replaced
-1:000000000000 0:42bd6ef504cf
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
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 mozilla_dom_VideoPlaybackQuality_h_
8 #define mozilla_dom_VideoPlaybackQuality_h_
9
10 #include "mozilla/dom/HTMLMediaElement.h"
11 #include "nsCycleCollectionParticipant.h"
12 #include "nsDOMNavigationTiming.h"
13 #include "nsWrapperCache.h"
14
15 namespace mozilla {
16 namespace dom {
17
18 class VideoPlaybackQuality MOZ_FINAL : public nsWrapperCache
19 {
20 public:
21 NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VideoPlaybackQuality)
22 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VideoPlaybackQuality)
23
24 VideoPlaybackQuality(HTMLMediaElement* aElement, DOMHighResTimeStamp aCreationTime,
25 uint64_t aTotalFrames, uint64_t aDroppedFrames,
26 uint64_t aCorruptedFrames);
27
28 HTMLMediaElement* GetParentObject() const;
29
30 JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
31
32 DOMHighResTimeStamp CreationTime() const
33 {
34 return mCreationTime;
35 }
36
37 uint64_t TotalVideoFrames()
38 {
39 return mTotalFrames;
40 }
41
42 uint64_t DroppedVideoFrames()
43 {
44 return mDroppedFrames;
45 }
46
47 uint64_t CorruptedVideoFrames()
48 {
49 return mCorruptedFrames;
50 }
51
52 private:
53 nsRefPtr<HTMLMediaElement> mElement;
54 DOMHighResTimeStamp mCreationTime;
55 uint64_t mTotalFrames;
56 uint64_t mDroppedFrames;
57 uint64_t mCorruptedFrames;
58 };
59
60 } // namespace dom
61 } // namespace mozilla
62 #endif /* mozilla_dom_VideoPlaybackQuality_h_ */

mercurial