#ifndef HTMLVideoElement_h
#define HTMLVideoElement_h
#include "core/html/HTMLMediaElement.h"
#include "core/html/canvas/CanvasImageSource.h"
namespace blink {
class WebGraphicsContext3D;
}
namespace WebCore {
class ExceptionState;
class HTMLImageLoader;
class HTMLVideoElement FINAL : public HTMLMediaElement, public CanvasImageSource {
public:
static PassRefPtr<HTMLVideoElement> create(Document&);
unsigned videoWidth() const;
unsigned videoHeight() const;
void webkitEnterFullscreen(ExceptionState&);
void webkitExitFullscreen();
bool webkitSupportsFullscreen();
bool webkitDisplayingFullscreen();
unsigned webkitDecodedFrameCount() const;
unsigned webkitDroppedFrameCount() const;
void paintCurrentFrameInContext(GraphicsContext*, const IntRect&) const;
bool copyVideoTextureToPlatformTexture(blink::WebGraphicsContext3D*, Platform3DObject texture, GC3Dint level, GC3Denum type, GC3Denum internalFormat, bool premultiplyAlpha, bool flipY);
bool shouldDisplayPosterImage() const { return displayMode() == Poster || displayMode() == PosterWaitingForVideo; }
KURL posterImageURL() const;
virtual KURL mediaPlayerPosterURL() OVERRIDE;
virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceImageStatus*) const OVERRIDE;
virtual bool isVideoElement() const OVERRIDE { return true; }
virtual bool wouldTaintOrigin(SecurityOrigin*) const OVERRIDE;
virtual FloatSize sourceSize() const OVERRIDE;
private:
HTMLVideoElement(Document&);
virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE;
virtual RenderObject* createRenderer(RenderStyle*) OVERRIDE;
virtual void attach(const AttachContext& = AttachContext()) OVERRIDE;
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStylePropertySet*) OVERRIDE;
virtual bool hasVideo() const OVERRIDE { return player() && player()->hasVideo(); }
bool supportsFullscreen() const;
virtual bool isURLAttribute(const Attribute&) const OVERRIDE;
virtual const AtomicString imageSourceURL() const OVERRIDE;
bool hasAvailableVideoFrame() const;
virtual void updateDisplayState() OVERRIDE;
virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE;
virtual void setDisplayMode(DisplayMode) OVERRIDE;
OwnPtr<HTMLImageLoader> m_imageLoader;
AtomicString m_defaultPosterURL;
};
}
#endif