Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
launch_avfeed(3)		 Arcan Lua API		      launch_avfeed(3)

NAME
       launch_avfeed - Launch a	customized frameserver

SYNOPSIS
       vid:newvid, aid:newaid, string:guid, int:cookie
       launch_avfeed( string:argument )
       launch_avfeed( string:argument, string:mode )
       launch_avfeed( string:argument, string:mode, func:callback )

DESCRIPTION
       launch_avfeed  is intended for launching	authoritative frameservers for
       the 'decode', 'terminal'	and 'avfeed' archetypes. The  'decode'	arche-
       type  is	 used for providing streaming audio and	video decoding of some
       input source defined by the argument  string. The 'terminal'  archetype
       is  used	 for  spawning	an interactive command-line interface, and the
       'avfeed'	is for unspecified custom input	providers, typically for bind-
       ing to other media frameworks. The support  for	these  archetypes  are
       probed  at  engine  startup  and	 set  in  the  global  variable	FRAME-
       SERVER_MODES . If no mode  argument is provided,	 it  will  default  to
       'avfeed'.  The possible values for argument  is dependent on the	frame-
       server implementation, where the	defaults can be	probed by running  the
       respective  binaries  standalone	 with  the ARCAN_ARG =help environment
       set, though this	can vary slightly with the underlying OS . It  uses  a
       special	key1:key2=value	with a tab character acting as element separa-
       tor, and	the tab	character itself being forbidden. If avmode    is  not
       specified,  it defaults to 'avfeed'. As with other frameserver- related
       management functions, it	is advised that	you provide a handler callback
       function	directly or via	the target_updatehandler  call.	 The  contents
       and  behavior  of  this	callback  function  is	described in detail in
       launch_target . If successful, new audio	and  video  reference  identi-
       fiers  are  returned, along with	a per-instance unique uid (base-64 en-
       coded), intended	to be used to regain tracking should a	connection  be
       lost, by	accident or voluntary.

NOTES
       1      The  reason  argument  comes before mode	is for historical rea-
	      sons as the function name	previously held	a  different  behavior
	      and use.

       2

	      SECURITY	-  alert:  allowing  the _terminal frameserver is cur-
	      rently a possible	scriptable way of running  arbitrary  programs
	      within  the context of the terminal, partly through the possible
	      exec= argument but also by manually inputting  commands  through
	      target_input  . This can be hardened in multiple ways: by	inter-
	      cepting target_input  and	only allow if it is visible (appl spe-
	      cific solution), by intercepting launch_avfeed	and  filtering
	      argstr  or by simply not allowing	the terminal frameserver (dis-
	      able at buildtime	or specify a different set of afsrv_  binaries
	      using the	--binpath argument).

EXAMPLE
       function	launch_avfeed0()
	     local vid,	_, guid	= launch_avfeed("", "terminal",
		   function(source, status)
			 print("[new event]");
			 for k,v in pairs(status) do
			       print("", k, v);
			 end
			 if (status.kind == "resized") then
			       resize_image(source, status.width, status.height);
			 end
		   end
	     );
	     show_image(vid);
	     print("launched as", vid, guid);
       end

SEE ALSO:
       launch_target(3)	define_recordtarget(3) net_open(3) net_listen(3)

targetcontrol			  April	2025		      launch_avfeed(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=launch_avfeed&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help