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