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