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