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