Beispiel #1
0
static input_plugin_t *pnm_class_get_instance (input_class_t *cls_gen, xine_stream_t *stream, 
				    const char *data) {

  /* pnm_input_class_t  *cls = (pnm_input_class_t *) cls_gen; */
  pnm_input_plugin_t *this;
  char               *mrl = strdup(data);

  if (strncasecmp (mrl, "pnm://", 6)) {
    free (mrl);
    return NULL;
  }

  this = (pnm_input_plugin_t *) xine_xmalloc (sizeof (pnm_input_plugin_t));

  this->stream = stream;
  this->pnm    = NULL;
  this->mrl    = mrl; 
  this->nbc    = nbc_init (this->stream);
  
  this->input_plugin.open              = pnm_plugin_open;
  this->input_plugin.get_capabilities  = pnm_plugin_get_capabilities;
  this->input_plugin.read              = pnm_plugin_read;
  this->input_plugin.read_block        = pnm_plugin_read_block;
  this->input_plugin.seek              = pnm_plugin_seek;
  this->input_plugin.get_current_pos   = pnm_plugin_get_current_pos;
  this->input_plugin.get_length        = pnm_plugin_get_length;
  this->input_plugin.get_blocksize     = pnm_plugin_get_blocksize;
  this->input_plugin.get_mrl           = pnm_plugin_get_mrl;
  this->input_plugin.dispose           = pnm_plugin_dispose;
  this->input_plugin.get_optional_data = pnm_plugin_get_optional_data;
  this->input_plugin.input_class       = cls_gen;
  
  return &this->input_plugin;
}
Beispiel #2
0
static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, xine_stream_t *stream,
				    const char *mrl) {

  /* rtsp_input_class_t  *cls = (rtsp_input_class_t *) cls_gen; */
  rtsp_input_plugin_t *this;

  if (strncasecmp (mrl, "rtsp://", 6))
    return NULL;

  this = calloc(1, sizeof (rtsp_input_plugin_t));

  this->stream  = stream;
  this->rtsp    = NULL;
  this->mrl     = strdup (mrl);
  /* since we handle only real streams yet, we can savely add
   * an .rm extention to force handling by demux_real.
   */
  this->public_mrl = _x_asprintf("%s.rm", this->mrl);

  this->nbc     = nbc_init (stream);

  this->input_plugin.open              = rtsp_plugin_open;
  this->input_plugin.get_capabilities  = rtsp_plugin_get_capabilities;
  this->input_plugin.read              = rtsp_plugin_read;
  this->input_plugin.read_block        = rtsp_plugin_read_block;
  this->input_plugin.seek              = rtsp_plugin_seek;
  this->input_plugin.seek_time         = rtsp_plugin_seek_time;
  this->input_plugin.get_current_pos   = rtsp_plugin_get_current_pos;
  this->input_plugin.get_length        = rtsp_plugin_get_length;
  this->input_plugin.get_blocksize     = rtsp_plugin_get_blocksize;
  this->input_plugin.get_mrl           = rtsp_plugin_get_mrl;
  this->input_plugin.dispose           = rtsp_plugin_dispose;
  this->input_plugin.get_optional_data = rtsp_plugin_get_optional_data;
  this->input_plugin.input_class       = cls_gen;

  return &this->input_plugin;
}