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

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.

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

qint64

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

unicode

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

unicode

Returns the MIME type of a media resource.

This may be null if the MIME type is unknown.

PySide2.QtMultimedia.QMediaResource.__ne__(other)
Parameters

otherQMediaResource

Return type

bool

Compares a media resource to other .

Returns true if they are different, and false otherwise.

PySide2.QtMultimedia.QMediaResource.__eq__(other)
Parameters

otherQMediaResource

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

QNetworkRequest

Returns the network request associated with this media resource.

PySide2.QtMultimedia.QMediaResource.resolution()
Return type

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

rateint

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 – unicode

Sets the audio codec of a media resource.

See also

audioCodec()

PySide2.QtMultimedia.QMediaResource.setChannelCount(channels)
Parameters

channelsint

Sets the number of audio channels in a media resource.

See also

channelCount()

PySide2.QtMultimedia.QMediaResource.setDataSize(size)
Parameters

sizeqint64

Sets the size in bytes of a media resource.

See also

dataSize()

PySide2.QtMultimedia.QMediaResource.setLanguage(language)
Parameters

language – unicode

Sets the language of a media resource.

See also

language()

PySide2.QtMultimedia.QMediaResource.setResolution(resolution)
Parameters

resolutionQSize

Sets the resolution in pixels of a media resource.

See also

resolution()

PySide2.QtMultimedia.QMediaResource.setResolution(width, height)
Parameters
  • widthint

  • heightint

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

PySide2.QtMultimedia.QMediaResource.setSampleRate(frequency)
Parameters

frequencyint

Sets the audio sampleRate of a media resource.

See also

sampleRate()

PySide2.QtMultimedia.QMediaResource.setVideoBitRate(rate)
Parameters

rateint

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 – unicode

Sets the video codec of media resource.

See also

videoCodec()

PySide2.QtMultimedia.QMediaResource.url()
Return type

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

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.

See also

setVideoCodec()