QMediaResource

The QMediaResource class provides a description of a media resource. More

Inheritance diagram of PySide2.QtMultimedia.QMediaResource

Synopsis

Functions

Detailed Description

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 is the url() .

See also

QMediaContent

class PySide2.QtMultimedia.QMediaResource

PySide2.QtMultimedia.QMediaResource(other)

PySide2.QtMultimedia.QMediaResource(request[, mimeType=””])

PySide2.QtMultimedia.QMediaResource(url[, mimeType=””])

param request:

PySide2.QtNetwork.QNetworkRequest

param url:

PySide2.QtCore.QUrl

param other:

PySide2.QtMultimedia.QMediaResource

param mimeType:

str

Constructs a null media resource.

Constructs a copy of a media resource other .

PySide2.QtMultimedia.QMediaResource.Property
PySide2.QtMultimedia.QMediaResource.audioBitRate()
Return type:

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.

PySide2.QtMultimedia.QMediaResource.audioCodec()
Return type:

str

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.

See also

setAudioCodec()

PySide2.QtMultimedia.QMediaResource.channelCount()
Return type:

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.

PySide2.QtMultimedia.QMediaResource.dataSize()
Return type:

int

Returns the size in bytes of a media resource.

This may be zero if the size is unknown.

See also

setDataSize()

PySide2.QtMultimedia.QMediaResource.isNull()
Return type:

bool

Identifies if a media resource is null.

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

PySide2.QtMultimedia.QMediaResource.language()
Return type:

str

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

This may be null if the language is unknown.

See also

setLanguage()

PySide2.QtMultimedia.QMediaResource.mimeType()
Return type:

str

Returns the MIME type of a media resource.

This may be null if the MIME type is unknown.

PySide2.QtMultimedia.QMediaResource.__ne__(other)
Parameters:

otherPySide2.QtMultimedia.QMediaResource

Return type:

bool

Compares a media resource to other .

Returns true if they are different, and false otherwise.

PySide2.QtMultimedia.QMediaResource.__eq__(other)
Parameters:

otherPySide2.QtMultimedia.QMediaResource

Return type:

bool

Compares a media resource to other .

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

PySide2.QtMultimedia.QMediaResource.request()
Return type:

PySide2.QtNetwork.QNetworkRequest

Returns the network request associated with this media resource.

PySide2.QtMultimedia.QMediaResource.resolution()
Return type:

PySide2.QtCore.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.

See also

setResolution()

PySide2.QtMultimedia.QMediaResource.sampleRate()
Return type:

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.

See also

setSampleRate()

PySide2.QtMultimedia.QMediaResource.setAudioBitRate(rate)
Parameters:

rate – int

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

See also

audioBitRate()

PySide2.QtMultimedia.QMediaResource.setAudioCodec(codec)
Parameters:

codec – str

Sets the audio codec of a media resource.

See also

audioCodec()

PySide2.QtMultimedia.QMediaResource.setChannelCount(channels)
Parameters:

channels – int

Sets the number of audio channels in a media resource.

See also

channelCount()

PySide2.QtMultimedia.QMediaResource.setDataSize(size)
Parameters:

size – int

Sets the size in bytes of a media resource.

See also

dataSize()

PySide2.QtMultimedia.QMediaResource.setLanguage(language)
Parameters:

language – str

Sets the language of a media resource.

See also

language()

PySide2.QtMultimedia.QMediaResource.setResolution(resolution)
Parameters:

resolutionPySide2.QtCore.QSize

Sets the resolution in pixels of a media resource.

See also

resolution()

PySide2.QtMultimedia.QMediaResource.setResolution(width, height)
Parameters:
  • width – int

  • height – int

Sets the width and height in pixels of a media resource.

PySide2.QtMultimedia.QMediaResource.setSampleRate(frequency)
Parameters:

frequency – int

Sets the audio sampleRate of a media resource.

See also

sampleRate()

PySide2.QtMultimedia.QMediaResource.setVideoBitRate(rate)
Parameters:

rate – int

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

See also

videoBitRate()

PySide2.QtMultimedia.QMediaResource.setVideoCodec(codec)
Parameters:

codec – str

Sets the video codec of media resource.

See also

videoCodec()

PySide2.QtMultimedia.QMediaResource.url()
Return type:

PySide2.QtCore.QUrl

Returns the URL of a media resource.

PySide2.QtMultimedia.QMediaResource.videoBitRate()
Return type:

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.

PySide2.QtMultimedia.QMediaResource.videoCodec()
Return type:

str

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.

See also

setVideoCodec()