ServerInterface.h revision 75486484
1/*
2 * Copyright 2002, Marcus Overhagen. All Rights Reserved.
3 * Copyright 2009, Axel D��rfler, axeld@pinc-software.de.
4 * Distributed under the terms of the MIT License.
5 */
6#ifndef _SERVER_INTERFACE_H_
7#define _SERVER_INTERFACE_H_
8
9
10#include <string.h>
11
12#include <Buffer.h>
13#include <Entry.h>
14#include <MediaAddOn.h>
15#include <MediaDefs.h>
16#include <MediaFormats.h>
17#include <MediaNode.h>
18#include <Messenger.h>
19
20
21// BMessage based server communication
22enum {
23	// BMediaRoster notification service
24	MEDIA_SERVER_REQUEST_NOTIFICATIONS = 1000,
25	MEDIA_SERVER_CANCEL_NOTIFICATIONS,
26	MEDIA_SERVER_SEND_NOTIFICATIONS,
27
28	// add_system_beep_event()
29	MEDIA_SERVER_ADD_SYSTEM_BEEP_EVENT,
30
31	// media add-on server
32	MEDIA_ADD_ON_SERVER_PLAY_MEDIA = '_TRU'
33};
34
35// Raw port based communication
36enum {
37	GENERAL_PURPOSE_WAKEUP = 0,	// when no action but wait termination needed
38
39	ADD_ON_SERVER_RESCAN_ADD_ON_FLAVORS = 0x50,
40	ADD_ON_SERVER_RESCAN_FINISHED_NOTIFY,
41	ADD_ON_SERVER_INSTANTIATE_DORMANT_NODE,
42
43	SERVER_MESSAGE_START = 0x100,
44	SERVER_REGISTER_APP,
45	SERVER_UNREGISTER_APP,
46	SERVER_GET_NODE,
47	SERVER_SET_NODE,
48	SERVER_PUBLISH_INPUTS,
49	SERVER_PUBLISH_OUTPUTS,
50	SERVER_NODE_ID_FOR,
51	SERVER_GET_LIVE_NODE_INFO,
52	SERVER_GET_LIVE_NODES,
53	SERVER_GET_NODE_FOR,
54	SERVER_RELEASE_NODE,
55	SERVER_RELEASE_NODE_ALL,
56	SERVER_REGISTER_NODE,
57	SERVER_UNREGISTER_NODE,
58	SERVER_GET_DORMANT_NODE_FOR,
59	SERVER_GET_INSTANCES_FOR,
60	SERVER_GET_SHARED_BUFFER_AREA,
61	SERVER_REGISTER_BUFFER,
62	SERVER_UNREGISTER_BUFFER,
63	SERVER_RESCAN_DEFAULTS,
64	SERVER_SET_NODE_CREATOR,
65	SERVER_CHANGE_FLAVOR_INSTANCES_COUNT,
66	SERVER_GET_MEDIA_FILE_TYPES,
67	SERVER_GET_MEDIA_FILE_ITEMS,
68	SERVER_GET_REF_FOR,
69	SERVER_SET_REF_FOR,
70	SERVER_INVALIDATE_MEDIA_ITEM,
71	SERVER_REMOVE_MEDIA_ITEM,
72	SERVER_GET_ITEM_AUDIO_GAIN,
73	SERVER_SET_ITEM_AUDIO_GAIN,
74	SERVER_GET_FORMAT_FOR_DESCRIPTION,
75	SERVER_GET_DESCRIPTION_FOR_FORMAT,
76	SERVER_REGISTER_ADD_ON,
77	SERVER_UNREGISTER_ADD_ON,
78	SERVER_GET_ADD_ON_REF,
79	SERVER_REGISTER_DORMANT_NODE,
80	SERVER_GET_DORMANT_NODES,
81	SERVER_GET_DORMANT_FLAVOR_INFO,
82	SERVER_SET_NODE_TIMESOURCE,
83	SERVER_MESSAGE_END,
84
85	NODE_MESSAGE_START = 0x200,
86	NODE_START,
87	NODE_STOP,
88	NODE_SEEK,
89	NODE_SET_RUN_MODE,
90	NODE_TIME_WARP,
91	NODE_PREROLL,
92	NODE_ROLL,
93	NODE_SYNC_TO,
94	NODE_SET_TIMESOURCE,
95	NODE_GET_TIMESOURCE,
96	NODE_REQUEST_COMPLETED,
97	NODE_FINAL_RELEASE,
98	NODE_MESSAGE_END,
99
100	CONSUMER_MESSAGE_START = 0x300,
101	CONSUMER_GET_NEXT_INPUT,
102	CONSUMER_DISPOSE_INPUT_COOKIE,
103	CONSUMER_ACCEPT_FORMAT,
104	CONSUMER_CONNECTED,
105	CONSUMER_DISCONNECTED,
106	CONSUMER_BUFFER_RECEIVED,
107	CONSUMER_PRODUCER_DATA_STATUS,
108	CONSUMER_GET_LATENCY_FOR,
109	CONSUMER_FORMAT_CHANGED,
110	CONSUMER_SEEK_TAG_REQUESTED,
111	CONSUMER_MESSAGE_END,
112
113	PRODUCER_MESSAGE_START = 0x400,
114	PRODUCER_GET_NEXT_OUTPUT,
115	PRODUCER_DISPOSE_OUTPUT_COOKIE,
116	PRODUCER_FORMAT_PROPOSAL,
117	PRODUCER_PREPARE_TO_CONNECT,
118	PRODUCER_CONNECT,
119	PRODUCER_DISCONNECT,
120	PRODUCER_LATE_NOTICE_RECEIVED,
121	PRODUCER_LATENCY_CHANGED,
122	PRODUCER_ADDITIONAL_BUFFER_REQUESTED,
123	PRODUCER_VIDEO_CLIPPING_CHANGED,
124	PRODUCER_FORMAT_CHANGE_REQUESTED,
125	PRODUCER_SET_BUFFER_GROUP,
126	PRODUCER_GET_LATENCY,
127	PRODUCER_GET_INITIAL_LATENCY,
128	PRODUCER_FORMAT_SUGGESTION_REQUESTED,
129	PRODUCER_SET_PLAY_RATE,
130	PRODUCER_ENABLE_OUTPUT,
131	PRODUCER_SET_RUN_MODE_DELAY,
132	PRODUCER_MESSAGE_END,
133
134	FILEINTERFACE_MESSAGE_START = 0x500,
135	FILEINTERFACE_SET_REF,
136	FILEINTERFACE_GET_REF,
137	FILEINTERFACE_SNIFF_REF,
138	FILEINTERFACE_MESSAGE_END,
139
140	CONTROLLABLE_MESSAGE_START = 0x600,
141	CONTROLLABLE_GET_PARAMETER_WEB,
142	CONTROLLABLE_GET_PARAMETER_DATA,
143	CONTROLLABLE_SET_PARAMETER_DATA,
144	CONTROLLABLE_START_CONTROL_PANEL,
145	CONTROLLABLE_MESSAGE_END,
146
147	TIMESOURCE_MESSAGE_START = 0x700,
148	TIMESOURCE_OP, // datablock is a struct time_source_op_info
149	TIMESOURCE_ADD_SLAVE_NODE,
150	TIMESOURCE_REMOVE_SLAVE_NODE,
151	TIMESOURCE_GET_START_LATENCY,
152	TIMESOURCE_MESSAGE_END,
153};
154
155
156namespace BPrivate {
157namespace media {
158
159
160struct reply_data;
161struct request_data;
162struct command_data;
163
164
165// The base struct used for all raw requests
166struct request_data {
167	port_id					reply_port;
168
169	request_data();
170	~request_data();
171
172	status_t SendReply(status_t result, reply_data* reply,
173		size_t replySize) const;
174};
175
176// The base struct used for all raw replys
177struct reply_data {
178	status_t				result;
179};
180
181// The base struct used for all raw commands (asynchronous, no answer)
182struct command_data {
183	// yes, it's empty ;)
184
185#if __GNUC__ == 4
186	int32 _padding;
187		// GCC 2 and GCC 4 treat empty structures differently
188#endif
189};
190
191// The base struct used for all requests using an area
192struct area_request_data : request_data {
193	area_id					area;
194};
195
196// The base struct used for all requests requesting an area
197struct request_area_data : request_data {
198	team_id					team;
199};
200
201// The base struct used for all replies using an area
202struct area_reply_data : reply_data {
203	area_id					area;
204	void*					address;
205};
206
207
208/* We can't send an entry_ref through a port to another team,
209 * but we can assign it to an xfer_entry_ref and send this one,
210 * when we receive it we can assign it to a normal entry_ref
211 */
212struct xfer_entry_ref {
213public:
214	xfer_entry_ref()
215	{
216		device = -1;
217		directory = -1;
218		name[0] = 0;
219	}
220
221	operator entry_ref() const
222	{
223		entry_ref ref(device, directory, name);
224		return ref;
225	}
226
227	xfer_entry_ref& operator=(const entry_ref& ref)
228	{
229		device = ref.device;
230		directory = ref.directory;
231		if (ref.name)
232			strcpy(name, ref.name);
233		else
234			name[0] = 0;
235
236		return *this;
237	}
238
239private:
240	dev_t	device;
241	ino_t	directory;
242	char	name[B_FILE_NAME_LENGTH];
243};
244
245
246}	// namespace media
247}	// namespace BPrivate
248
249using namespace BPrivate::media;
250
251// used by SERVER_GET_NODE and SERVER_SET_NODE
252enum node_type {
253	VIDEO_INPUT,
254	AUDIO_INPUT,
255	VIDEO_OUTPUT,
256	AUDIO_MIXER,
257	AUDIO_OUTPUT,
258	AUDIO_OUTPUT_EX,
259	TIME_SOURCE,
260	SYSTEM_TIME_SOURCE
261};
262
263// used by SERVER_PUBLISH_INPUTS and SERVER_PUBLISH_OUTPUTS
264enum {
265	MAX_OUTPUTS = 8,
266	MAX_INPUTS = 8,
267};
268
269// used by SERVER_GET_LIVE_NODES
270enum {
271	MAX_LIVE_INFO = 16,
272};
273
274// used by SERVER_GET_INSTANCES_FOR
275enum {
276	MAX_NODE_ID = 4000,
277};
278
279// used by SERVER_GET_READERS
280enum {
281	MAX_READERS = 40,
282};
283
284
285// #pragma mark - media add-on server commands
286
287
288struct add_on_server_instantiate_dormant_node_request : request_data {
289	media_addon_id			add_on_id;
290	int32					flavor_id;
291	team_id					creator_team;
292};
293
294struct add_on_server_instantiate_dormant_node_reply : reply_data {
295	media_node				node;
296};
297
298struct add_on_server_rescan_flavors_command : command_data {
299	media_addon_id			add_on_id;
300};
301
302struct add_on_server_rescan_finished_notify_command : command_data {
303};
304
305
306// #pragma mark - media server commands
307
308
309struct server_set_node_request : request_data {
310	node_type				type;
311	bool					use_node;
312	media_node				node;
313	bool					use_dni;
314	dormant_node_info		dni;
315	bool					use_input;
316	media_input				input;
317};
318
319struct server_set_node_reply : reply_data {
320};
321
322struct server_get_node_request : request_data {
323	node_type				type;
324	team_id					team;
325};
326
327struct server_get_node_reply : public reply_data {
328	media_node				node;
329
330	// for AUDIO_OUTPUT_EX
331	char					input_name[B_MEDIA_NAME_LENGTH];
332	int32					input_id;
333};
334
335struct server_publish_inputs_request : request_data {
336	media_node				node;
337	int32					count;
338	area_id area;	// if count > MAX_INPUTS, inputs are in the area
339					// area is created in the library, and also deleted
340					// in the library after the reply has been received
341	media_input inputs[MAX_INPUTS];
342};
343
344struct server_publish_inputs_reply : reply_data {
345};
346
347struct server_publish_outputs_request : area_request_data {
348	media_node				node;
349	int32					count;
350		// if count > MAX_OUTPUTS, outputs are in the area
351		// area is created in the library, and also deleted
352		// in the library after the reply has been received
353	media_output outputs[MAX_OUTPUTS];
354};
355
356struct server_publish_outputs_reply : reply_data {
357};
358
359struct server_register_app_request : request_data {
360	team_id					team;
361	BMessenger				messenger;
362};
363
364struct server_register_app_reply : reply_data {
365};
366
367struct server_unregister_app_request : request_data {
368	team_id					team;
369};
370
371struct server_unregister_app_reply : reply_data {
372};
373
374struct server_set_node_creator_request : request_data {
375	media_node_id			node;
376	team_id					creator;
377};
378
379struct server_set_node_creator_reply : reply_data {
380};
381
382struct server_change_flavor_instances_count_request : request_data {
383	media_addon_id			add_on_id;
384	int32					flavor_id;
385	int32					delta; // must be +1 or -1
386	team_id					team;
387};
388
389struct server_change_flavor_instances_count_reply : reply_data {
390};
391
392struct server_register_node_request : request_data {
393	media_addon_id			add_on_id;
394	int32					flavor_id;
395	media_node_id			timesource_id;
396	char					name[B_MEDIA_NAME_LENGTH];
397	uint64					kinds;
398	port_id					port;
399	team_id					team;
400};
401
402struct server_register_node_reply : reply_data {
403	media_node_id			node_id;
404};
405
406struct server_unregister_node_request : request_data {
407	media_node_id			node_id;
408	team_id					team;
409};
410
411struct server_unregister_node_reply : reply_data {
412	media_addon_id			add_on_id;
413	int32					flavor_id;
414};
415
416struct server_get_live_node_info_request : request_data {
417	media_node				node;
418};
419
420struct server_get_live_node_info_reply : reply_data {
421	live_node_info			live_info;
422};
423
424struct server_get_live_nodes_request : request_area_data {
425	int32					max_count;
426	bool					has_input;
427	bool					has_output;
428	bool					has_name;
429	media_format			input_format;
430	media_format			output_format;
431	char					name[B_MEDIA_NAME_LENGTH + 1];
432								// +1 for a trailing "*"
433	uint64					require_kinds;
434};
435
436struct server_get_live_nodes_reply : area_reply_data {
437	int32					count;
438		// if count > MAX_LIVE_INFO, live_node_infos are in the area
439		// area is created in the server, but deleted in the library
440	live_node_info			live_info[MAX_LIVE_INFO];
441};
442
443struct server_node_id_for_request : request_data {
444	port_id					port;
445};
446
447struct server_node_id_for_reply : reply_data {
448	media_node_id			node_id;
449};
450
451struct server_get_node_for_request : request_data {
452	media_node_id			node_id;
453	team_id					team;
454};
455
456struct server_get_node_for_reply : reply_data {
457	media_node				clone;
458};
459
460struct server_release_node_request : request_data {
461	media_node				node;
462	team_id					team;
463};
464
465struct server_release_node_reply : reply_data {
466};
467
468struct server_get_dormant_node_for_request : request_data {
469	media_node				node;
470};
471
472struct server_get_dormant_node_for_reply : reply_data {
473	dormant_node_info		node_info;
474};
475
476struct server_get_instances_for_request : request_data {
477	media_addon_id			add_on_id;
478	int32					flavor_id;
479	int32					max_count;
480};
481
482struct server_get_instances_for_reply : reply_data {
483	int32					count;
484	media_node_id			node_id[MAX_NODE_ID];
485		// no area here, MAX_NODE_ID is really large
486};
487
488struct server_rescan_defaults_command : command_data {
489};
490
491struct server_register_add_on_request : request_data {
492	xfer_entry_ref			ref;
493};
494
495struct server_register_add_on_reply : reply_data {
496	media_addon_id			add_on_id;
497};
498
499struct server_unregister_add_on_command : command_data {
500	media_addon_id			add_on_id;
501};
502
503struct server_get_add_on_ref_request : request_data {
504	media_addon_id			add_on_id;
505};
506
507struct server_get_add_on_ref_reply : reply_data {
508	xfer_entry_ref			ref;
509};
510
511struct server_get_shared_buffer_area_request : request_data {
512};
513
514struct server_get_shared_buffer_area_reply : area_reply_data {
515};
516
517struct server_register_buffer_request : request_data {
518	team_id					team;
519	buffer_clone_info		info;
520		// either info.buffer is != 0, or the area, size, offset is used
521};
522
523struct server_register_buffer_reply : reply_data {
524	buffer_clone_info		info;
525};
526
527struct server_unregister_buffer_command : command_data {
528	team_id					team;
529	media_buffer_id			buffer_id;
530};
531
532struct server_get_media_types_request : request_area_data {
533};
534
535struct server_get_media_types_reply : area_reply_data {
536	int32					count;
537};
538
539struct server_get_media_items_request : request_area_data {
540	char					type[B_MEDIA_NAME_LENGTH];
541};
542
543struct server_get_media_items_reply : area_reply_data {
544	int32					count;
545};
546
547struct server_get_ref_for_request : request_data {
548	char					type[B_MEDIA_NAME_LENGTH];
549	char					item[B_MEDIA_NAME_LENGTH];
550};
551
552struct server_get_ref_for_reply : reply_data {
553	xfer_entry_ref			ref;
554};
555
556struct server_set_ref_for_request : request_data {
557	char					type[B_MEDIA_NAME_LENGTH];
558	char					item[B_MEDIA_NAME_LENGTH];
559	xfer_entry_ref			ref;
560};
561
562struct server_set_ref_for_reply : reply_data {
563};
564
565struct server_invalidate_item_request : request_data {
566	char					type[B_MEDIA_NAME_LENGTH];
567	char					item[B_MEDIA_NAME_LENGTH];
568};
569
570struct server_invalidate_item_reply : reply_data {
571};
572
573struct server_remove_media_item_request : request_data {
574	char					type[B_MEDIA_NAME_LENGTH];
575	char					item[B_MEDIA_NAME_LENGTH];
576};
577
578struct server_remove_media_item_reply : reply_data {
579};
580
581struct server_get_item_audio_gain_request : request_data {
582	char					type[B_MEDIA_NAME_LENGTH];
583	char					item[B_MEDIA_NAME_LENGTH];
584};
585
586struct server_get_item_audio_gain_reply : reply_data {
587	float					gain;
588};
589
590struct server_set_item_audio_gain_request : request_data {
591	char					type[B_MEDIA_NAME_LENGTH];
592	char					item[B_MEDIA_NAME_LENGTH];
593	float					gain;
594};
595
596struct server_set_item_audio_gain_reply : reply_data {
597};
598
599
600struct server_get_dormant_flavor_info_request : request_data {
601	media_addon_id	add_on_id;
602	int32			flavor_id;
603};
604
605struct server_get_dormant_flavor_info_reply : reply_data {
606	type_code		type; // the flatten type_code
607	size_t 			flattened_size;
608	char 			flattened_data[1];
609		// a flattened dormant_flavor_info, flattened_size large
610};
611
612struct server_get_dormant_nodes_request : request_data {
613	int32			max_count;
614	bool			has_input;
615	media_format	input_format;
616	bool			has_output;
617	media_format	output_format;
618	bool			has_name;
619	char			name[B_MEDIA_NAME_LENGTH + 1]; // 1 for a trailing "*"
620	uint64			require_kinds;
621	uint64			deny_kinds;
622};
623
624struct server_get_dormant_nodes_reply : reply_data {
625	int32			count;
626		// if count > 0, a second reply containing count dormant_node_infos
627		// is send
628};
629
630struct server_register_dormant_node_command : command_data {
631	media_addon_id	purge_id;
632		// if > 0, server must first remove all dormant_flavor_infos
633		// belonging to that id
634	type_code		type; // the flatten type_code
635	size_t 			flattened_size;
636	char 			flattened_data[1];
637		// a flattened dormant_flavor_info, flattened_size large
638};
639
640struct server_set_node_timesource_request : request_data {
641	media_node_id			node_id;
642	media_node_id			timesource_id;
643};
644
645struct server_set_node_timesource_reply : reply_data {
646};
647
648
649// #pragma mark - buffer producer commands
650
651
652struct producer_format_proposal_request : public request_data {
653	media_source			output;
654	media_format			format;
655};
656
657struct producer_format_proposal_reply : reply_data {
658	media_format			format;
659};
660
661struct producer_prepare_to_connect_request : request_data {
662	media_source			source;
663	media_destination		destination;
664	media_format			format;
665	char					name[B_MEDIA_NAME_LENGTH];
666};
667
668struct producer_prepare_to_connect_reply : reply_data {
669	media_format			format;
670	media_source			out_source;
671	char					name[B_MEDIA_NAME_LENGTH];
672};
673
674struct producer_connect_request : request_data {
675	status_t				error;
676	media_source			source;
677	media_destination		destination;
678	media_format			format;
679	char					name[B_MEDIA_NAME_LENGTH];
680};
681
682struct producer_connect_reply : reply_data {
683	char					name[B_MEDIA_NAME_LENGTH];
684};
685
686struct producer_disconnect_request : request_data {
687	media_source			source;
688	media_destination		destination;
689};
690
691struct producer_disconnect_reply : reply_data {
692};
693
694struct producer_format_suggestion_requested_request : request_data {
695	media_type				type;
696	int32					quality;
697};
698
699struct producer_format_suggestion_requested_reply : reply_data {
700	media_format			format;
701};
702
703struct producer_set_play_rate_request : request_data {
704	int32					numer;
705	int32					denom;
706};
707
708struct producer_set_play_rate_reply : reply_data {
709};
710
711struct producer_get_initial_latency_request : request_data {
712};
713
714struct producer_get_initial_latency_reply : reply_data {
715	bigtime_t				initial_latency;
716	uint32					flags;
717};
718
719struct producer_get_latency_request : request_data {
720};
721
722struct producer_get_latency_reply : reply_data {
723	bigtime_t				latency;
724};
725
726struct producer_set_buffer_group_command : command_data {
727	media_source			source;
728	media_destination		destination;
729	void*					user_data;
730	int32					change_tag;
731	int32					buffer_count;
732	media_buffer_id			buffers[1];
733};
734
735struct producer_format_change_requested_command : command_data {
736	media_source			source;
737	media_destination		destination;
738	media_format			format;
739	void*					user_data;
740	int32					change_tag;
741};
742
743struct producer_video_clipping_changed_command : command_data {
744	media_source			source;
745	media_destination		destination;
746	media_video_display_info display;
747	void*					user_data;
748	int32					change_tag;
749	int32					short_count;
750	int16					shorts[1];
751};
752
753struct producer_additional_buffer_requested_command : command_data {
754	media_source			source;
755	media_buffer_id			prev_buffer;
756	bigtime_t				prev_time;
757	bool					has_seek_tag;
758	media_seek_tag			prev_tag;
759};
760
761struct producer_latency_changed_command : command_data {
762	media_source			source;
763	media_destination		destination;
764	bigtime_t				latency;
765	uint32					flags;
766};
767
768struct producer_enable_output_command : command_data {
769	media_source			source;
770	media_destination		destination;
771	bool					enabled;
772	void*					user_data;
773	int32					change_tag;
774};
775
776struct producer_late_notice_received_command : command_data {
777	media_source			source;
778	bigtime_t				how_much;
779	bigtime_t				performance_time;
780};
781
782struct producer_set_run_mode_delay_command : command_data {
783	BMediaNode::run_mode	mode;
784	bigtime_t				delay;
785};
786
787struct producer_get_next_output_request : request_data {
788	int32					cookie;
789};
790
791struct producer_get_next_output_reply : reply_data
792{
793	int32					cookie;
794	media_output			output;
795};
796
797struct producer_dispose_output_cookie_request : request_data
798{
799	int32					cookie;
800};
801
802struct producer_dispose_output_cookie_reply : reply_data {
803};
804
805
806// #pragma mark - buffer consumer commands
807
808
809struct consumer_accept_format_request : request_data {
810	media_destination		dest;
811	media_format			format;
812};
813
814struct consumer_accept_format_reply : reply_data {
815	media_format			format;
816};
817
818struct consumer_connected_request : request_data {
819	media_input				input;
820};
821
822struct consumer_connected_reply : reply_data {
823	media_input				input;
824};
825
826struct consumer_get_next_input_request : request_data {
827	int32					cookie;
828};
829
830struct consumer_get_next_input_reply : reply_data {
831	int32					cookie;
832	media_input				input;
833};
834
835struct consumer_dispose_input_cookie_request : request_data {
836	int32					cookie;
837};
838
839struct consumer_dispose_input_cookie_reply : reply_data {
840};
841
842struct consumer_disconnected_request : request_data {
843	media_source			source;
844	media_destination		destination;
845};
846
847struct consumer_disconnected_reply : reply_data {
848};
849
850struct consumer_buffer_received_command : command_data {
851	media_buffer_id			buffer;
852	media_header			header;
853};
854
855struct consumer_producer_data_status_command : command_data {
856	media_destination		for_whom;
857	int32					status;
858	bigtime_t				at_performance_time;
859};
860
861struct consumer_get_latency_for_request : request_data {
862	media_destination		for_whom;
863};
864
865struct consumer_get_latency_for_reply : reply_data {
866	bigtime_t				latency;
867	media_node_id			timesource;
868};
869
870struct consumer_format_changed_request : request_data {
871	media_source			producer;
872	media_destination		consumer;
873	int32					change_tag;
874	media_format			format;
875};
876
877struct consumer_format_changed_reply : reply_data {
878};
879
880struct consumer_seek_tag_requested_request : request_data {
881	media_destination		destination;
882	bigtime_t				target_time;
883	uint32					flags;
884};
885
886struct consumer_seek_tag_requested_reply : reply_data {
887	media_seek_tag			seek_tag;
888	bigtime_t				tagged_time;
889	uint32					flags;
890};
891
892
893// #pragma mark - node commands
894
895
896struct node_request_completed_command : command_data {
897	media_request_info		info;
898};
899
900struct node_start_command : command_data {
901	bigtime_t				performance_time;
902};
903
904struct node_stop_command : command_data {
905	bigtime_t				performance_time;
906	bool					immediate;
907};
908
909struct node_seek_command : command_data {
910	bigtime_t				media_time;
911	bigtime_t				performance_time;
912};
913
914struct node_roll_command : command_data {
915	bigtime_t				start_performance_time;
916	bigtime_t				stop_performance_time;
917	bigtime_t				seek_media_time;
918};
919
920struct node_sync_to_request : request_data {
921	bigtime_t				performance_time;
922	port_id					port;
923};
924
925struct node_sync_to_reply : reply_data {
926};
927
928struct node_set_run_mode_command : command_data {
929	BMediaNode::run_mode	mode;
930};
931
932struct node_time_warp_command : command_data {
933	bigtime_t				at_real_time;
934	bigtime_t				to_performance_time;
935};
936
937struct node_set_timesource_command : command_data {
938	media_node_id			timesource_id;
939};
940
941struct node_get_timesource_request : request_data {
942};
943
944struct node_get_timesource_reply : reply_data {
945	media_node_id			timesource_id;
946};
947
948struct node_final_release_command : command_data {
949};
950
951
952// #pragma mark - time source commands
953
954
955struct timesource_add_slave_node_command : command_data {
956	media_node				node;
957};
958
959struct timesource_remove_slave_node_command : command_data {
960	media_node				node;
961};
962
963struct timesource_get_start_latency_request : request_data {
964};
965
966struct timesource_get_start_latency_reply : reply_data {
967	bigtime_t				start_latency;
968};
969
970
971// #pragma mark - file interface commands
972
973
974struct fileinterface_set_ref_request : request_data {
975	dev_t					device;
976	ino_t					directory;
977	char					name[B_FILE_NAME_LENGTH];
978	bigtime_t				duration;
979	bool					create;
980};
981
982struct fileinterface_set_ref_reply : reply_data {
983	bigtime_t				duration;
984};
985
986struct fileinterface_get_ref_request : request_data {
987};
988
989struct fileinterface_get_ref_reply : reply_data {
990	dev_t					device;
991	ino_t					directory;
992	char					name[B_FILE_NAME_LENGTH];
993	char					mimetype[B_MIME_TYPE_LENGTH];
994};
995
996struct fileinterface_sniff_ref_request : request_data {
997	dev_t					device;
998	ino_t					directory;
999	char					name[B_FILE_NAME_LENGTH];
1000};
1001
1002struct fileinterface_sniff_ref_reply : reply_data {
1003	char					mimetype[B_MIME_TYPE_LENGTH];
1004	float					capability;
1005};
1006
1007
1008// #pragma mark - controllable commands
1009
1010
1011struct controllable_get_parameter_web_request : area_request_data {
1012	int32					max_size;
1013};
1014
1015struct controllable_get_parameter_web_reply : reply_data {
1016	type_code				code;
1017	int32					size;
1018		// = -1: parameter web data too large,
1019		// = 0: no p.w., > 0: flattened p.w. data
1020};
1021
1022#define MAX_PARAMETER_DATA (B_MEDIA_MESSAGE_SIZE - 100)
1023
1024struct controllable_get_parameter_data_request : area_request_data {
1025	int32					parameter_id;
1026	size_t					request_size;
1027};
1028
1029struct controllable_get_parameter_data_reply : reply_data {
1030	bigtime_t				last_change;
1031	char					raw_data[MAX_PARAMETER_DATA];
1032	size_t					size;
1033};
1034
1035struct controllable_set_parameter_data_request : area_request_data {
1036	int32					parameter_id;
1037	bigtime_t				when;
1038	size_t					size;
1039	char					raw_data[MAX_PARAMETER_DATA];
1040};
1041
1042struct controllable_set_parameter_data_reply : reply_data {
1043};
1044
1045struct controllable_start_control_panel_request : request_data {
1046	media_node				node;
1047};
1048
1049struct controllable_start_control_panel_reply : reply_data {
1050	team_id					team;
1051};
1052
1053
1054#endif	// _SERVER_INTERFACE_H_
1055