Exemple #1
0
static gavl_video_source_t *
connect_cropscale(void * priv, gavl_video_source_t * src,
                   const gavl_video_options_t * opt)
  {
  cropscale_priv_t * vp = priv;
  const gavl_video_format_t * format;

  format = gavl_video_source_get_src_format(src);
  
  gavl_video_format_copy(&vp->in_format, format);
  gavl_video_format_copy(&vp->out_format, format);
  set_framesize(vp);
  set_out_format(vp);
  
  if(vp->deinterlace != DEINTERLACE_NEVER)
    vp->out_format.interlace_mode = GAVL_INTERLACE_NONE;

  vp->in_src = src;
  gavl_video_source_set_dst(vp->in_src, 0, &vp->in_format);

  if(opt)
    gavl_video_options_copy(vp->global_opt, opt);
  
  vp->need_reinit = 1;
  vp->need_restart = 0;

  vp->out_src =
    gavl_video_source_create(read_func,
                             vp, 0,
                             &vp->out_format);
  return vp->out_src;
  }
int remote_thumbnail::open_file(const wchar_t*file)
{
	cmd.cmd = thumbnail_cmd_open_file;
	cmd.data_size = wcslen(file)*2 + 2;
	if (!WriteFile(m_pipe, &cmd, sizeof(cmd), &byteWritten, NULL ) || byteWritten != sizeof(cmd))
		error_exit(error_fail);
	if (!WriteFile(m_pipe, file, wcslen(file)*2+2, &byteWritten, NULL ) || byteWritten != wcslen(file)*2+2)
		error_exit(error_fail);

	if (!ReadFile(m_pipe, &cmd, sizeof(cmd), &byteWritten, NULL) || byteWritten != sizeof(cmd))
		error_exit(error_fail);

	return set_out_format(m_pixel_format, m_width, m_height);
}
Exemple #3
0
static void
set_input_format_cropscale(void * priv,
                           gavl_video_format_t * format, int port)
  {
  cropscale_priv_t * vp;
  vp = priv;

  if(!port)
    {
    gavl_video_format_copy(&vp->in_format, format);
    gavl_video_format_copy(&vp->out_format, format);
    set_framesize(vp);
    set_out_format(vp);
    
    if(vp->deinterlace != DEINTERLACE_NEVER)
      vp->out_format.interlace_mode = GAVL_INTERLACE_NONE;
    
    vp->need_reinit = 1;
    vp->need_restart = 0;
    }
  }