Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QAbstractVideoSurface Class

TheQAbstractVideoSurface class is a base class for video presentation surfaces.More...

Header:#include <QAbstractVideoSurface>
Since: Qt 4.6
Inherits:QObject

Public Types

enumError { NoError, UnsupportedFormatError, IncorrectFormatError, StoppedError, ResourceError }

Public Functions

QAbstractVideoSurface(QObject * parent = 0)
~QAbstractVideoSurface()
Errorerror() const
boolisActive() const
virtual boolisFormatSupported(const QVideoSurfaceFormat & format) const
virtual QVideoSurfaceFormatnearestFormat(const QVideoSurfaceFormat & format) const
virtual boolpresent(const QVideoFrame & frame) = 0
virtual boolstart(const QVideoSurfaceFormat & format)
virtual voidstop()
virtual QList<QVideoFrame::PixelFormat>supportedPixelFormats(QAbstractVideoBuffer::HandleType type = QAbstractVideoBuffer::NoHandle) const = 0
QVideoSurfaceFormatsurfaceFormat() const
  • 29 public functions inherited fromQObject

Signals

voidactiveChanged(bool active)
voidsupportedFormatsChanged()
voidsurfaceFormatChanged(const QVideoSurfaceFormat & format)

Protected Functions

voidsetError(Error error)
  • 8 protected functions inherited fromQObject

Additional Inherited Members

  • 1 property inherited fromQObject
  • 1 public slot inherited fromQObject
  • 7 static public members inherited fromQObject

Detailed Description

TheQAbstractVideoSurface class is a base class for video presentation surfaces.

TheQAbstractVideoSurface class defines the standard interface that video producers use to inter-operate with video presentation surfaces. It is not supposed to be instantiated directly. Instead, you should subclass it to create new video surfaces.

A video surface presents a continuous stream of identically formatted frames, where the format of each frame is compatible with a stream format supplied when starting a presentation.

A list of pixel formats a surface can present is given by thesupportedPixelFormats() function, and theisFormatSupported() function will test if a video surface format is supported. If a format is not supported thenearestFormat() function may be able to suggest a similar format. For example if a surface supports fixed set of resolutions it may suggest the smallest supported resolution that contains the proposed resolution.

Thestart() function takes a supported format and enables a video surface. Once started a surface will begin displaying the frames it receives in thepresent() function. Surfaces may hold a reference to the buffer of a presented video frame until a new frame is presented or streaming is stopped. Thestop() function will disable a surface and a release any video buffers it holds references to.

Member Type Documentation

enum QAbstractVideoSurface::Error

This enum describes the errors that may be returned by theerror() function.

ConstantValueDescription
QAbstractVideoSurface::NoError0No error occurred.
QAbstractVideoSurface::UnsupportedFormatError1A video format was not supported.
QAbstractVideoSurface::IncorrectFormatError2A video frame was not compatible with the format of the surface.
QAbstractVideoSurface::StoppedError3The surface has not been started.
QAbstractVideoSurface::ResourceError4The surface could not allocate some resource.

Member Function Documentation

QAbstractVideoSurface::QAbstractVideoSurface(QObject * parent = 0)

Constructs a video surface with the givenparent.

QAbstractVideoSurface::~QAbstractVideoSurface()

Destroys a video surface.

[signal]void QAbstractVideoSurface::activeChanged(bool active)

Signals that theactive state of a video surface has changed.

See alsoisActive(),start(), andstop().

Error QAbstractVideoSurface::error() const

Returns the last error that occurred.

If a surface fails tostart(), or stops unexpectedly this function can be called to discover what error occurred.

See alsosetError().

bool QAbstractVideoSurface::isActive() const

Indicates whether a video surface has been started.

Returns true if the surface has been started, and false otherwise.

[virtual]bool QAbstractVideoSurface::isFormatSupported(constQVideoSurfaceFormat & format) const

Tests a video surfaceformat to determine if a surface can accept it.

Returns true if the format is supported by the surface, and false otherwise.

[virtual]QVideoSurfaceFormat QAbstractVideoSurface::nearestFormat(constQVideoSurfaceFormat & format) const

Returns a supported video surface format that is similar toformat.

A similar surface format is one that has the samepixel format andhandle type but differs in some of the other properties. For example if there are restrictions on theframe sizes a video surface can accept it may suggest a format with a larger frame size and aviewport the size of the original frame size.

If the format is already supported it will be returned unchanged, or if there is no similar supported format an invalid format will be returned.

[pure virtual]bool QAbstractVideoSurface::present(constQVideoFrame & frame)

Presents a videoframe.

Returns true if the frame was presented, and false if an error occurred.

Not all surfaces will block until the presentation of a frame has completed. Calling present() on a non-blocking surface may fail if called before the presentation of a previous frame has completed. In such cases the surface may not return to a ready state until it's had an opportunity to process events.

If present() fails for any other reason the surface will immediately enter the stopped state and anerror() value will be set.

A video surface must be in the started state for present() to succeed, and the format of the video frame must be compatible with the current video surface format.

See alsoerror().

[protected]void QAbstractVideoSurface::setError(Error error)

Sets the value oferror() toerror.

See alsoerror().

[virtual]bool QAbstractVideoSurface::start(constQVideoSurfaceFormat & format)

Starts a video surface presentingformat frames.

Returns true if the surface was started, and false if an error occurred.

See alsoisActive() andstop().

[virtual]void QAbstractVideoSurface::stop()

Stops a video surface presenting frames and releases any resources acquired instart().

See alsoisActive() andstart().

[signal]void QAbstractVideoSurface::supportedFormatsChanged()

Signals that the set of formats supported by a video surface has changed.

See alsosupportedPixelFormats() andisFormatSupported().

[pure virtual]QList<QVideoFrame::PixelFormat> QAbstractVideoSurface::supportedPixelFormats(QAbstractVideoBuffer::HandleType type = QAbstractVideoBuffer::NoHandle) const

Returns a list of pixel formats a video surface can present for a given handletype.

The pixel formats returned for theQAbstractVideoBuffer::NoHandle type are valid for any buffer that can be mapped in read-only mode.

Types that are first in the list can be assumed to be faster to render.

QVideoSurfaceFormat QAbstractVideoSurface::surfaceFormat() const

Returns the format of a video surface.

[signal]void QAbstractVideoSurface::surfaceFormatChanged(constQVideoSurfaceFormat & format)

Signals that the configuredformat of a video surface has changed.

See alsosurfaceFormat() andstart().

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp