• PySide 模块
  • PySide.phonon
  • 内容表

    上一话题

    Phonon.VolumeSlider

    下一话题

    Phonon.VideoPlayer

    Phonon.VideoWidget

    概要

    详细描述

    VideoWidget class provides a widget that is used to display video.

    VideoWidget class renders the video of a media stream on a PySide.QtGui.QWidget . It is connected to the Phonon.MediaObject , of which video stream it should render. You connect the two objects using the Phonon.createPath() 函数。

    The widget has some possibilities to manipulate the video stream. You can change the PySide.phonon.Phonon::VideoWidget.brightness() , PySide.phonon.Phonon::VideoWidget.hue() , PySide.phonon.Phonon::VideoWidget.saturation() ,和 PySide.phonon.Phonon::VideoWidget.contrast() .

    Resizing of the video is handled automatically, but you can affect the way the video is resized with the PySide.phonon.Phonon::VideoWidget.aspectRatio() and PySide.phonon.Phonon::VideoWidget.scaleMode() properties. By default, the widget will use the aspect ratio of the video stream itself.

    The video widget takes the size of the video when it receives a new video stream (i.e., when a new MediaSource is set on the MediaObject to which it is connected). If you need to know the size of the video, you can call PySide.QtGui.QWidget.sizeHint() after the video has been loaded (i.e., after the MediaObject leaves the LoadingState ).

    It is also possible to go to full screen 模式。

    A typical example of usage follows below:

    <Code snippet "doc/src/snippets/code/doc_src_phonon-api.cpp:21" not found>
    									

    另请参阅

    Phonon Module

    class PySide.phonon.Phonon. VideoWidget ( [ parent=None ] )
    参数: parent PySide.QtGui.QWidget

    Constructs a new video widget with the specified parent .

    PySide.phonon.Phonon.VideoWidget. AspectRatio

    Defines the width:height to be used for the video.

    常量 描述
    Phonon.VideoWidget.AspectRatioAuto Let the decoder find the aspect ratio automatically from the media file (this is the default).
    Phonon.VideoWidget.AspectRatioWidget Fits the video into the widget making the aspect ratio depend solely on the size of the widget. This way the aspect ratio is freely resizeable by the user.
    Phonon.VideoWidget.AspectRatio4_3 Make width/height == 4/3, which is the old TV size and monitor size (1024/768 == 4/3). (4:3)
    Phonon.VideoWidget.AspectRatio16_9 Make width/height == 16/9, which is the size of most current media. (16:9)
    PySide.phonon.Phonon.VideoWidget. ScaleMode

    Phonon.VideoWidget.ScaleMode enum describes how to treat aspect ratio during resizing of video.

    常量 描述
    Phonon.VideoWidget.FitInView The video will be fitted to fill the view keeping aspect ratio.
    Phonon.VideoWidget.ScaleAndCrop The video is scaled
    PySide.phonon.Phonon.VideoWidget. aspectRatio ( )
    返回类型: PySide.phonon.Phonon::VideoWidget.AspectRatio

    默认为 AspectRatioAuto .

    另请参阅

    Phonon.VideoWidget.AspectRatio

    PySide.phonon.Phonon.VideoWidget. brightness ( )
    返回类型: PySide.QtCore.qreal

    This property holds brightness of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. contrast ( )
    返回类型: PySide.QtCore.qreal

    This property holds the contrast of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. enterFullScreen ( )

    Convenience slot, calling setFullScreen(true)

    PySide.phonon.Phonon.VideoWidget. exitFullScreen ( )

    Convenience slot, calling setFullScreen(false)

    PySide.phonon.Phonon.VideoWidget. hue ( )
    返回类型: PySide.QtCore.qreal

    This property holds the hue of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. saturation ( )
    返回类型: PySide.QtCore.qreal

    This property holds saturation of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. scaleMode ( )
    返回类型: PySide.phonon.Phonon::VideoWidget.ScaleMode

    If the size of the widget and the size of the video are not equal. The video will be zoomed to fit the widget. The smaller zoom (AddBarsScaleMode) adds black bars at the left/right or top/bottom to make all of the image visible (default). The bigger zoom (ExpandMode) fills the widget completely, keeping all information in one direction and leaving parts of the image outside of the widget in the other direction.

    PySide.phonon.Phonon.VideoWidget. setAspectRatio ( arg__1 )
    参数: arg__1 PySide.phonon.Phonon::VideoWidget.AspectRatio

    默认为 AspectRatioAuto .

    另请参阅

    Phonon.VideoWidget.AspectRatio

    PySide.phonon.Phonon.VideoWidget. setBrightness ( value )
    参数: value PySide.QtCore.qreal

    This property holds brightness of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. setContrast ( value )
    参数: value PySide.QtCore.qreal

    This property holds the contrast of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. setFullScreen ( fullscreen )
    参数: fullscreen PySide.QtCore.bool

    This property holds whether the video is shown using the complete screen.

    The property differs from QWidget.fullScreen in that it is writeable.

    By default the widget is not shown in fullScreen() .

    警告

    When switching to full screen mode using PySide.phonon.Phonon::VideoWidget.setFullScreen() , the widget onto which the video is rendered is shown as a top-level window. Key event forwarding is handled by VideoWidget , but if you need to handle other events, e.g., mouse events, you should handle fullscreen mode yourself.

    PySide.phonon.Phonon.VideoWidget. setHue ( value )
    参数: value PySide.QtCore.qreal

    This property holds the hue of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. setSaturation ( value )
    参数: value PySide.QtCore.qreal

    This property holds saturation of the video.

    Default is 0. Acceptable values are in range of -1, 1.

    PySide.phonon.Phonon.VideoWidget. setScaleMode ( arg__1 )
    参数: arg__1 PySide.phonon.Phonon::VideoWidget.ScaleMode

    If the size of the widget and the size of the video are not equal. The video will be zoomed to fit the widget. The smaller zoom (AddBarsScaleMode) adds black bars at the left/right or top/bottom to make all of the image visible (default). The bigger zoom (ExpandMode) fills the widget completely, keeping all information in one direction and leaving parts of the image outside of the widget in the other direction.

    PySide.phonon.Phonon.VideoWidget. snapshot ( )
    返回类型: PySide.QtGui.QImage

    Returns a snapshot of the current frame shown in the widget.