Clapper.Harvest¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Clapper.Harvest(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An object storing data from enhancers that implement [iface`Clapper`.Extractable] interface.
New in version 0.8.
- fill(media_type, data)¶
-
Fill harvest with extracted data. It can be anything that GStreamer can parse and play such as single URI or a streaming manifest.
Calling again this function will replace previously filled content.
Commonly used media types are:
application/dash+xml- DASH manifestapplication/x-hls- HLS manifesttext/x-uri- direct media URItext/uri-list- playlist of URIsapplication/clapper-playlist- custom playlist format
New in version 0.8.
- fill_with_bytes(media_type, bytes)¶
- Parameters:
media_type (
str) – media mime typebytes (
GLib.Bytes) – aGLib.Bytesto fill self
- Returns:
Truewhen filled successfully,Falseif taken data was empty.- Return type:
A convenience method to fill self with data from
GLib.Bytes.For more info, see [method`Clapper`.Harvest.fill] documentation.
New in version 0.8.
- fill_with_text(media_type, text)¶
-
A convenience method to fill self using a
Noneterminated string.For more info, see [method`Clapper`.Harvest.fill] documentation.
New in version 0.8.
- headers_set(key, value)¶
- Parameters:
key (
str) – a header namevalue (
GObject.Value) – a stringGObject.Valueof header
Set another header in the request headers list using
GObject.Value.Setting again the same key will update its value to the new one.
New in version 0.8.
- set_expiration_date_utc(date_utc)¶
- Parameters:
date_utc (
GLib.DateTime) – aGLib.DateTimein UTC time
Set date in UTC time until harvested content is expected to stay alive.
This is used for harvest caching, so next time user requests to play the same URI, recently harvested data can be reused without the need to run [vfunc`Clapper`.Extractable.extract] again.
New in version 0.10.
- set_expiration_seconds(seconds)¶
- Parameters:
seconds (
float) – time in seconds until expiration
Set amount of seconds for how long harvested content is expected to stay alive.
Alternative function to [method`Clapper`.Harvest.set_expiration_date_utc], but takes time as number in seconds from now.
It is safe to pass zero or negative number to this function in case when calculating time manually and it already expired.
New in version 0.10.
- tags_add(tag, value)¶
- Parameters:
tag (
str) – a name of tag to setvalue (
GObject.Value) – aGObject.Valueof tag
Append another tag into the tag list using
GObject.Value.New in version 0.8.
- toc_add(type, title, start, end)¶
- Parameters:
type (
Gst.TocEntryType) – aGst.TocEntryTypetitle (
str) – an entry titlestart (
float) – entry start time in secondsend (
float) – entry end time in seconds or -1 if none
Append a chapter or track name into table of contents.
New in version 0.8.