OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/html/HTMLMediaElement.h" | 29 #include "core/html/HTMLMediaElement.h" |
30 | 30 |
31 namespace WebCore { | 31 namespace WebCore { |
32 | 32 |
33 class ExceptionState; | 33 class ExceptionState; |
34 class HTMLImageLoader; | 34 class HTMLImageLoader; |
35 | 35 |
36 class HTMLVideoElement FINAL : public HTMLMediaElement { | 36 class HTMLVideoElement FINAL : public HTMLMediaElement { |
37 public: | 37 public: |
38 static PassRefPtr<HTMLVideoElement> create(Document&, bool createdByParser =
false); | 38 static PassRefPtr<HTMLVideoElement> create(Document&); |
39 | 39 |
40 unsigned videoWidth() const; | 40 unsigned videoWidth() const; |
41 unsigned videoHeight() const; | 41 unsigned videoHeight() const; |
42 | 42 |
43 // Fullscreen | 43 // Fullscreen |
44 void webkitEnterFullscreen(ExceptionState&); | 44 void webkitEnterFullscreen(ExceptionState&); |
45 void webkitExitFullscreen(); | 45 void webkitExitFullscreen(); |
46 bool webkitSupportsFullscreen(); | 46 bool webkitSupportsFullscreen(); |
47 bool webkitDisplayingFullscreen(); | 47 bool webkitDisplayingFullscreen(); |
48 | 48 |
49 // Statistics | 49 // Statistics |
50 unsigned webkitDecodedFrameCount() const; | 50 unsigned webkitDecodedFrameCount() const; |
51 unsigned webkitDroppedFrameCount() const; | 51 unsigned webkitDroppedFrameCount() const; |
52 | 52 |
53 // Used by canvas to gain raw pixel access | 53 // Used by canvas to gain raw pixel access |
54 void paintCurrentFrameInContext(GraphicsContext*, const IntRect&); | 54 void paintCurrentFrameInContext(GraphicsContext*, const IntRect&); |
55 | 55 |
56 // Used by WebGL to do GPU-GPU textures copy if possible. | 56 // Used by WebGL to do GPU-GPU textures copy if possible. |
57 // See more details at MediaPlayer::copyVideoTextureToPlatformTexture() defi
ned in Source/WebCore/platform/graphics/MediaPlayer.h. | 57 // See more details at MediaPlayer::copyVideoTextureToPlatformTexture() defi
ned in Source/WebCore/platform/graphics/MediaPlayer.h. |
58 bool copyVideoTextureToPlatformTexture(GraphicsContext3D*, Platform3DObject
texture, GC3Dint level, GC3Denum type, GC3Denum internalFormat, bool premultiply
Alpha, bool flipY); | 58 bool copyVideoTextureToPlatformTexture(GraphicsContext3D*, Platform3DObject
texture, GC3Dint level, GC3Denum type, GC3Denum internalFormat, bool premultiply
Alpha, bool flipY); |
59 | 59 |
60 bool shouldDisplayPosterImage() const { return displayMode() == Poster || di
splayMode() == PosterWaitingForVideo; } | 60 bool shouldDisplayPosterImage() const { return displayMode() == Poster || di
splayMode() == PosterWaitingForVideo; } |
61 | 61 |
62 KURL posterImageURL() const; | 62 KURL posterImageURL() const; |
63 | 63 |
64 private: | 64 private: |
65 HTMLVideoElement(Document&, bool); | 65 HTMLVideoElement(Document&); |
66 | 66 |
67 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; | 67 virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE; |
68 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; | 68 virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE; |
69 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; | 69 virtual void attach(const AttachContext& = AttachContext()) OVERRIDE; |
70 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; | 70 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR
IDE; |
71 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; | 71 virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE; |
72 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; | 72 virtual void collectStyleForPresentationAttribute(const QualifiedName&, cons
t AtomicString&, MutableStylePropertySet*) OVERRIDE; |
73 virtual bool isVideo() const OVERRIDE { return true; } | 73 virtual bool isVideo() const OVERRIDE { return true; } |
74 virtual bool hasVideo() const OVERRIDE { return player() && player()->hasVid
eo(); } | 74 virtual bool hasVideo() const OVERRIDE { return player() && player()->hasVid
eo(); } |
75 bool supportsFullscreen() const; | 75 bool supportsFullscreen() const; |
76 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; | 76 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; |
77 virtual const AtomicString imageSourceURL() const OVERRIDE; | 77 virtual const AtomicString imageSourceURL() const OVERRIDE; |
78 | 78 |
79 bool hasAvailableVideoFrame() const; | 79 bool hasAvailableVideoFrame() const; |
80 virtual void updateDisplayState() OVERRIDE; | 80 virtual void updateDisplayState() OVERRIDE; |
81 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; | 81 virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE; |
82 virtual void setDisplayMode(DisplayMode) OVERRIDE; | 82 virtual void setDisplayMode(DisplayMode) OVERRIDE; |
83 | 83 |
84 OwnPtr<HTMLImageLoader> m_imageLoader; | 84 OwnPtr<HTMLImageLoader> m_imageLoader; |
85 | 85 |
86 AtomicString m_defaultPosterURL; | 86 AtomicString m_defaultPosterURL; |
87 }; | 87 }; |
88 | 88 |
89 DEFINE_NODE_TYPE_CASTS(HTMLVideoElement, hasTagName(HTMLNames::videoTag)); | 89 DEFINE_NODE_TYPE_CASTS(HTMLVideoElement, hasTagName(HTMLNames::videoTag)); |
90 | 90 |
91 } //namespace | 91 } //namespace |
92 | 92 |
93 #endif | 93 #endif |
OLD | NEW |