![]() |
libgpac
Documentation of the core library of GPAC
|
FileIO object for file IO callbacks from libgpac. More...
Public Member Functions | |
__init__ (self, url, obj) | |
constructor for FileIO | |
Data Fields | |
url | |
the underlying gfio:// URL to be provided to GPAC | |
FileIO object for file IO callbacks from libgpac.
The FileIO object is used to create input or output interfaces in which GPAC will read or write. This allows generating content in python without any disk IO, or passing python data as input to GPAC without intermediate file.
This object passed to the FileIO constructor must implement the following callbacks:
Opens the file in read or write mode.
Closes the file
Writes the file
return number of bytes writen, at most the size of the array
Reads the file
return number of bytes read, at most the size of the array
Seeks current position in file (same as fopen)
return 0 if no error, error code otherwise
Gets current position in file (same as ftell)
return current position
Checks if the current position is at the end of the file (same as feof)
return true if file end reached, false otherwise
Checks if the given URL exists. This callback is optional
The URL passed to the constructor indentifies the file name wrapped. Some file types such as HLS or DASH manifest may imply reading or writing several files. To handle these cases, the object passed to the constructor will be cloned for each call to open().
All FileIO callbacks will be done in the main thread.
python.libgpac.libgpac.FileIO.__init__ | ( | self, | |
url, | |||
obj | |||
) |
constructor for FileIO
url | url for this fileIO factory |
obj | instance of the class used for IOs. This instance will be cloned (shallow copy) for each new file to open |
python.libgpac.libgpac.FileIO.url |
the underlying gfio:// URL to be provided to GPAC