Media Engine

This module provides methods to fill/drain the playout buffer and to decode and play the video stream. The logic for draining the buffer, decode and play the video stream depends on the particular media engine. TAPAS already includes three media engines that allow to give different levels of detail to the experimental evaluation:

  1. FullMediaEngine is a complete player that decodes and renders the raw video to the screen (for now it works only with MPEGTS container);
  2. NodecMediaEngine is a player that only demuxes the video stream without decoding and rendering the video;
  3. FakeMediaEngine only keeps track of the playout buffer length, but does not demux, decode, and render the video.

Both the FullMediaEngine and the NodecMediaEngine employ the GStreamer multimedia framework for playing the received video.

Base class methods

class media_engines.BaseMediaEngine.BaseMediaEngine(min_queue_time=10)[source]
Constructors:
Object(**properties)
new(object_type:GType, parameters:list)
getQueuedBytes()[source]

Gets the amount of data (in bytes) in the playout buffer.

getQueuedTime()[source]

Gets the amount of data (in seconds) in the playout buffer.

getStatus()[source]

Gets the player status. Returns true when the media engine is in play. Returns false when the media engine is in pause.

Return type:bool
getVideoContainer()[source]

Gets the video container type (e.g. MP4 or MPEGTS).

Return type:str
onRunning()[source]

Called when changing state from pause to play. (It must be implemented for new media engine).

pushData(data, fragment_duration, level, caps)[source]

Enqueues data into the playout buffer. Called when the segment download is completed. (It must be implemented for new media engine).

Parameters:
  • data – data downloaded
  • fragment_duration – duration of the segment to be appendend
  • level – the level of the segment downloaded.
  • caps – codec data to be passed to the pipeline for mp4 videos.
setVideoContainer(video_container)[source]

Sets the video container type. Called from the Parser instance.

Parameters:video_container – string of the corresponding video container (e.g. MP4 or MPEGTS).
start()[source]

Starts the media engine.

stop()[source]

Stops the media engine.

Table Of Contents

Previous topic

Parser

This Page