Main Module - Grade-A-Software/Comcast-DASH-VLC GitHub Wiki

VLC Modules must be defined

vlc_module_begin ()
  set_shortname( N_("DASH"))
  set_description( N_("Dynamic Adaptive Streaming over HTTP") )
  set_capability( "stream_filter", 19 )
  set_category( CAT_INPUT )
  set_subcategory( SUBCAT_INPUT_STREAM_FILTER )
  add_integer( "dash-prefwidth",  480, DASH_WIDTH_TEXT,  DASH_WIDTH_LONGTEXT,  true )
  add_integer( "dash-prefheight", 360, DASH_HEIGHT_TEXT, DASH_HEIGHT_LONGTEXT, true )
  add_integer( "dash-buffersize", 30, DASH_BUFFER_TEXT, DASH_BUFFER_LONGTEXT, true )
  add_string( "dash-url", "", "URL", "URL of the XML file", false);
  set_callbacks( Open, Close )
vlc_module_end ()

This definition informs VLC of the module's configuration.

Not only does it set a name and description, but it sets a capability. This capability definition states that the module is a "stream_filter" and is has a priority of 19 (0 being lowest priority) among stream_filter modules. Additionally, it adds string and integer configuration options for the module that can be accessed from within the module.

Modules must Open(), Close()

All modules open and close.

Open()

In the Open() method, the module must set up the components used to transform a simple URL into video playback. For more information, consult MPD and DASH Design

Close()

Close() simply exists to free up any memory allocated by the module.

Stream Filter modules must Read(), Peek(), and Seek()

Read()

Read() is invoked by VLC itself when it requests data from the module's buffer. Reading returns a specified number of bytes and advances the pointer to the current location in the buffer by that number of bytes.

Peek()

Peek() performs the same function as Read(), though it does not advance the pointer in the buffer.

Seek()

Seek() provides the ability to specify a location in the playback to start from. This simply ignores any preceding information and starts reading from the specified location.

Utilizing User Interface controls

Control()

Control() provides an interface for VLC's user controls to influence the behavior of the module.