QMediaResourceclass provides a description of a media resource. 更多 …
def
__eq__
(other)
def
__ne__
(other)
def
audioBitRate
()
def
audioCodec
()
def
channelCount
()
def
dataSize
()
def
isNull
()
def
language
()
def
mimeType
()
def
request
()
def
resolution
()
def
sampleRate
()
def
setAudioBitRate
(rate)
def
setAudioCodec
(codec)
def
setChannelCount
(channels)
def
setDataSize
(size)
def
setLanguage
(language)
def
setResolution
(resolution)
def
setResolution
(width, height)
def
setSampleRate
(frequency)
def
setVideoBitRate
(rate)
def
setVideoCodec
(codec)
def
url
()
def
videoBitRate
()
def
videoCodec
()
A media resource is composed of a
URLcontaining 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.
QMediaResourceincludes information such as theMIME type,audioandvideocodecs,audioandvideobit rates, andresolutionso these constraints and others can be evaluated.The only mandatory property of a
QMediaResource是url().另请参阅
QMediaResource
¶
QMediaResource(other)
QMediaResource(request[, mimeType=””])
QMediaResource(url[, mimeType=””])
- param request
QNetworkRequest- param url
QUrl- param other
- 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.
另请参阅
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.
另请参阅
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.
另请参阅
PySide2.QtMultimedia.QMediaResource.
dataSize
(
)
¶
qint64
Returns the size in bytes of a media resource.
This may be zero if the size is unknown.
另请参阅
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.
另请参阅
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.
另请参阅
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.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setAudioBitRate
(
rate
)
¶
rate
–
int
Sets the bit
rate
in bits per second of a media resource’s video stream.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setAudioCodec
(
codec
)
¶
codec – unicode
Sets the audio
codec
of a media resource.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setChannelCount
(
channels
)
¶
channels
–
int
Sets the number of audio
channels
in a media resource.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setDataSize
(
size
)
¶
size
–
qint64
设置
size
in bytes of a media resource.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setLanguage
(
language
)
¶
language – unicode
设置
language
of a media resource.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setResolution
(
resolution
)
¶
resolution
–
QSize
设置
resolution
in pixels of a media resource.
另请参阅
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.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setVideoBitRate
(
rate
)
¶
rate
–
int
Sets the bit
rate
in bits per second of a media resource’s video stream.
另请参阅
PySide2.QtMultimedia.QMediaResource.
setVideoCodec
(
codec
)
¶
codec – unicode
Sets the video
codec
of media resource.
另请参阅
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.
另请参阅
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.
另请参阅