内容表

上一话题

QMediaRecorderControl

下一话题

QMediaService

QMediaResource

QMediaResource class provides a description of a media resource. 更多

Inheritance diagram of PySide2.QtMultimedia.QMediaResource

概要

函数

详细描述

A media resource is composed of a URL containing the location of the resource and a set of properties that describe the format of the resource. The properties provide a means to assess a resource without first attempting to load it, and in situations where media be represented by multiple alternative representations provide a means to select the appropriate resource.

Media made available by a remote services can often be available in multiple encodings or quality levels, this allows a client to select an appropriate resource based on considerations such as codecs supported, network bandwidth, and display constraints. QMediaResource includes information such as the MIME type , audio and video codecs, audio and video bit rates, and resolution so these constraints and others can be evaluated.

The only mandatory property of a QMediaResource url() .

另请参阅

QMediaContent

class QMediaResource

QMediaResource(other)

QMediaResource(request[, mimeType=””])

QMediaResource(url[, mimeType=””])

param request

QNetworkRequest

param url

QUrl

param other

QMediaResource

param mimeType

unicode

Constructs a null media resource.

Constructs a copy of a media resource other .

PySide2.QtMultimedia.QMediaResource. 特性
PySide2.QtMultimedia.QMediaResource. audioBitRate ( )
返回类型

int

Returns the bit rate in bits per second of a media resource’s audio stream.

This may be zero if the bit rate is unknown, or the resource contains no audio stream.

另请参阅

setAudioBitRate()

PySide2.QtMultimedia.QMediaResource. audioCodec ( )
返回类型

unicode

Returns the audio codec of a media resource.

This may be null if the media resource does not contain an audio stream, or the codec is unknown.

另请参阅

setAudioCodec()

PySide2.QtMultimedia.QMediaResource. channelCount ( )
返回类型

int

Returns the number of audio channels in a media resource.

This may be zero if the sample size is unknown, or the resource contains no audio stream.

另请参阅

setChannelCount()

PySide2.QtMultimedia.QMediaResource. dataSize ( )
返回类型

qint64

Returns the size in bytes of a media resource.

This may be zero if the size is unknown.

另请参阅

setDataSize()

PySide2.QtMultimedia.QMediaResource. isNull ( )
返回类型

bool

Identifies if a media resource is null.

Returns true if the resource is null, and false otherwise.

PySide2.QtMultimedia.QMediaResource. language ( )
返回类型

unicode

Returns the language of a media resource as an ISO 639-2 code.

This may be null if the language is unknown.

另请参阅

setLanguage()

PySide2.QtMultimedia.QMediaResource. mimeType ( )
返回类型

unicode

Returns the MIME type of a media resource.

This may be null if the MIME type is unknown.

PySide2.QtMultimedia.QMediaResource. __ne__ ( other )
参数

other QMediaResource

返回类型

bool

Compares a media resource to other .

Returns true if they are different, and false otherwise.

PySide2.QtMultimedia.QMediaResource. __eq__ ( other )
参数

other QMediaResource

返回类型

bool

Compares a media resource to other .

Returns true if the resources are identical, and false otherwise.

PySide2.QtMultimedia.QMediaResource. request ( )
返回类型

QNetworkRequest

Returns the network request associated with this media resource.

PySide2.QtMultimedia.QMediaResource. resolution ( )
返回类型

QSize

Returns the resolution in pixels of a media resource.

This may be null is the resolution is unknown, or the resource contains no pixel data (i.e. the resource is an audio stream.

另请参阅

setResolution()

PySide2.QtMultimedia.QMediaResource. sampleRate ( )
返回类型

int

Returns the audio sample rate of a media resource.

This may be zero if the sample size is unknown, or the resource contains no audio stream.

另请参阅

setSampleRate()

PySide2.QtMultimedia.QMediaResource. setAudioBitRate ( rate )
参数

rate int

Sets the bit rate in bits per second of a media resource’s video stream.

另请参阅

audioBitRate()

PySide2.QtMultimedia.QMediaResource. setAudioCodec ( codec )
参数

codec – unicode

Sets the audio codec of a media resource.

另请参阅

audioCodec()

PySide2.QtMultimedia.QMediaResource. setChannelCount ( channels )
参数

channels int

Sets the number of audio channels in a media resource.

另请参阅

channelCount()

PySide2.QtMultimedia.QMediaResource. setDataSize ( size )
参数

size qint64

设置 size in bytes of a media resource.

另请参阅

dataSize()

PySide2.QtMultimedia.QMediaResource. setLanguage ( language )
参数

language – unicode

设置 language of a media resource.

另请参阅

language()

PySide2.QtMultimedia.QMediaResource. setResolution ( resolution )
参数

resolution QSize

设置 resolution in pixels of a media resource.

另请参阅

resolution()

PySide2.QtMultimedia.QMediaResource. setResolution ( width , height )
参数
  • width int

  • height int

设置 width and height in pixels of a media resource.

PySide2.QtMultimedia.QMediaResource. setSampleRate ( frequency )
参数

frequency int

Sets the audio sampleRate of a media resource.

另请参阅

sampleRate()

PySide2.QtMultimedia.QMediaResource. setVideoBitRate ( rate )
参数

rate int

Sets the bit rate in bits per second of a media resource’s video stream.

另请参阅

videoBitRate()

PySide2.QtMultimedia.QMediaResource. setVideoCodec ( codec )
参数

codec – unicode

Sets the video codec of media resource.

另请参阅

videoCodec()

PySide2.QtMultimedia.QMediaResource. url ( )
返回类型

QUrl

Returns the URL of a media resource.

PySide2.QtMultimedia.QMediaResource. videoBitRate ( )
返回类型

int

Returns the bit rate in bits per second of a media resource’s video stream.

This may be zero if the bit rate is unknown, or the resource contains no video stream.

另请参阅

setVideoBitRate()

PySide2.QtMultimedia.QMediaResource. videoCodec ( )
返回类型

unicode

Returns the video codec of a media resource.

This may be null if the media resource does not contain a video stream, or the codec is unknonwn.

另请参阅

setVideoCodec()