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