xref: /haiku/headers/private/media/DataExchange.h (revision 7c06546a8e8df703165baff0156d95f622d00538)
1 /*
2  * Copyright 2002, Marcus Overhagen. All rights reserved.
3  * Copyright 2009, Axel Dörfler, axeld@pinc-software.de.
4  *
5  * Distributed under the terms of the MIT License.
6  */
7 #ifndef _DATA_EXCHANGE_H
8 #define _DATA_EXCHANGE_H
9 
10 #include <string.h>
11 
12 #include <MediaFormats.h>
13 #include <MediaNode.h>
14 #include <MediaAddOn.h>
15 #include <Messenger.h>
16 #include <Buffer.h>
17 #include <Entry.h>
18 
19 
20 namespace BPrivate {
21 namespace media {
22 namespace dataexchange {
23 
24 struct reply_data;
25 struct request_data;
26 struct command_data;
27 
28 // BMessage based data exchange with the media_server
29 status_t SendToServer(BMessage *msg);
30 status_t QueryServer(BMessage &request, BMessage &reply);
31 
32 // Raw data based data exchange with the media_server
33 status_t SendToServer(int32 msgcode, command_data *msg, int size);
34 status_t QueryServer(int32 msgcode, request_data *request, int requestsize,
35 	reply_data *reply, int replysize);
36 
37 // Raw data based data exchange with the media_addon_server
38 status_t SendToAddonServer(int32 msgcode, command_data *msg, int size);
39 status_t QueryAddonServer(int32 msgcode, request_data *request, int requestSize,
40 	reply_data *reply, int replysize);
41 
42 // Raw data based data exchange with any (media node control-) port
43 status_t SendToPort(port_id sendport, int32 msgcode, command_data *msg,
44 	int size);
45 status_t QueryPort(port_id requestport, int32 msgcode, request_data *request,
46 	int requestsize, reply_data *reply, int replysize);
47 
48 // The base struct used for all raw requests
49 struct request_data {
50 	port_id					reply_port;
51 
52 	status_t SendReply(status_t result, reply_data *reply, int replysize) const;
53 };
54 
55 // The base struct used for all raw replys
56 struct reply_data {
57 	status_t				result;
58 };
59 
60 // The base struct used for all raw commands (asynchronous, no answer)
61 struct command_data {
62 	// yes, it's empty ;)
63 };
64 
65 // The base struct used for all requests using an area
66 struct area_request_data : request_data {
67 	area_id					area;
68 };
69 
70 // The base struct used for all replies using an area
71 struct area_reply_data : reply_data {
72 	area_id					area;
73 };
74 
75 } // namespace dataexchange
76 } // namespace media
77 } // namespace BPrivate
78 
79 using namespace BPrivate::media::dataexchange;
80 
81 // BMessage based server communication
82 enum {
83 	// BMediaRoster notification service
84 	MEDIA_SERVER_REQUEST_NOTIFICATIONS = 1000,
85 	MEDIA_SERVER_CANCEL_NOTIFICATIONS,
86 	MEDIA_SERVER_SEND_NOTIFICATIONS,
87 
88 	MEDIA_SERVER_GET_FORMATS,
89 	MEDIA_SERVER_MAKE_FORMAT_FOR,
90 
91 	// add_system_beep_event()
92 	MEDIA_SERVER_ADD_SYSTEM_BEEP_EVENT,
93 
94 	// media addon server
95 	MEDIA_ADDON_SERVER_PLAY_MEDIA = '_TRU'
96 };
97 
98 // Raw port based communication
99 enum {
100 	ADDONSERVER_RESCAN_MEDIAADDON_FLAVORS = 0x50,
101 
102 	SERVER_MESSAGE_START = 0x100,
103 	SERVER_REGISTER_APP,
104 	SERVER_UNREGISTER_APP,
105 	SERVER_GET_NODE,
106 	SERVER_SET_NODE,
107 	SERVER_PUBLISH_INPUTS,
108 	SERVER_PUBLISH_OUTPUTS,
109 	SERVER_NODE_ID_FOR,
110 	SERVER_GET_LIVE_NODE_INFO,
111 	SERVER_GET_LIVE_NODES,
112 	SERVER_GET_NODE_FOR,
113 	SERVER_RELEASE_NODE,
114 	SERVER_REGISTER_NODE,
115 	SERVER_UNREGISTER_NODE,
116 	SERVER_GET_DORMANT_NODE_FOR,
117 	SERVER_GET_INSTANCES_FOR,
118 	SERVER_GET_SHARED_BUFFER_AREA,
119 	SERVER_REGISTER_BUFFER,
120 	SERVER_UNREGISTER_BUFFER,
121 	SERVER_RESCAN_DEFAULTS,
122 	SERVER_SET_NODE_CREATOR,
123 	SERVER_CHANGE_ADDON_FLAVOR_INSTANCES_COUNT,
124 	SERVER_REWINDTYPES,
125 	SERVER_REWINDREFS,
126 	SERVER_GETREFFOR,
127 	SERVER_SETREFFOR,
128 	SERVER_REMOVEREFFOR,
129 	SERVER_REMOVEITEM,
130 	SERVER_GET_FORMAT_FOR_DESCRIPTION,
131 	SERVER_GET_DESCRIPTION_FOR_FORMAT,
132 	SERVER_GET_READERS,
133 	SERVER_GET_DECODER_FOR_FORMAT,
134 	SERVER_GET_WRITER_FOR_FORMAT_FAMILY,
135 	SERVER_GET_FILE_FORMAT_FOR_COOKIE,
136 	SERVER_GET_ENCODER_FOR_FORMAT,
137 	SERVER_MESSAGE_END,
138 	NODE_MESSAGE_START = 0x200,
139 
140 	NODE_START,
141 	NODE_STOP,
142 	NODE_SEEK,
143 	NODE_SET_RUN_MODE,
144 	NODE_TIME_WARP,
145 	NODE_PREROLL,
146 	NODE_SET_TIMESOURCE,
147 	NODE_GET_TIMESOURCE,
148 	NODE_REQUEST_COMPLETED,
149 	NODE_FINAL_RELEASE,
150 
151 	NODE_MESSAGE_END,
152 	CONSUMER_MESSAGE_START = 0x300,
153 	CONSUMER_GET_NEXT_INPUT,
154 	CONSUMER_DISPOSE_INPUT_COOKIE,
155 	CONSUMER_ACCEPT_FORMAT,
156 	CONSUMER_CONNECTED,
157 	CONSUMER_DISCONNECTED,
158 
159 	CONSUMER_BUFFER_RECEIVED,
160 	CONSUMER_PRODUCER_DATA_STATUS,
161 	CONSUMER_GET_LATENCY_FOR,
162 	CONSUMER_FORMAT_CHANGED,
163 	CONSUMER_SEEK_TAG_REQUESTED,
164 
165 	CONSUMER_MESSAGE_END,
166 	PRODUCER_MESSAGE_START = 0x400,
167 	PRODUCER_GET_NEXT_OUTPUT,
168 	PRODUCER_DISPOSE_OUTPUT_COOKIE,
169 	PRODUCER_FORMAT_PROPOSAL,
170 	PRODUCER_PREPARE_TO_CONNECT,
171 	PRODUCER_CONNECT,
172 	PRODUCER_DISCONNECT,
173 
174 	PRODUCER_LATE_NOTICE_RECEIVED,
175 	PRODUCER_LATENCY_CHANGED,
176 	PRODUCER_ADDITIONAL_BUFFER_REQUESTED,
177 	PRODUCER_VIDEO_CLIPPING_CHANGED,
178 	PRODUCER_FORMAT_CHANGE_REQUESTED,
179 	PRODUCER_SET_BUFFER_GROUP,
180 	PRODUCER_GET_LATENCY,
181 	PRODUCER_GET_INITIAL_LATENCY,
182 	PRODUCER_FORMAT_SUGGESTION_REQUESTED,
183 	PRODUCER_SET_PLAY_RATE,
184 	PRODUCER_ENABLE_OUTPUT,
185 	PRODUCER_SET_RUN_MODE_DELAY,
186 
187 	PRODUCER_MESSAGE_END,
188 	FILEINTERFACE_MESSAGE_START = 0x500,
189 	FILEINTERFACE_SET_REF,
190 	FILEINTERFACE_GET_REF,
191 	FILEINTERFACE_SNIFF_REF,
192 	FILEINTERFACE_MESSAGE_END,
193 	CONTROLLABLE_MESSAGE_START = 0x600,
194 	CONTROLLABLE_GET_PARAMETER_WEB,
195 	CONTROLLABLE_GET_PARAMETER_DATA,
196 	CONTROLLABLE_SET_PARAMETER_DATA,
197 	CONTROLLABLE_START_CONTROL_PANEL,
198 	CONTROLLABLE_MESSAGE_END,
199 	TIMESOURCE_MESSAGE_START = 0x700,
200 
201 	TIMESOURCE_OP, // datablock is a struct time_source_op_info
202 	TIMESOURCE_ADD_SLAVE_NODE,
203 	TIMESOURCE_REMOVE_SLAVE_NODE,
204 	TIMESOURCE_GET_START_LATENCY,
205 
206 	TIMESOURCE_MESSAGE_END,
207 };
208 
209 
210 /* We can't send an entry_ref through a port to another team,
211  * but we can assign it to an xfer_entry_ref and send this one,
212  * when we receive it we can assign it to a normal entry_ref
213  */
214 struct xfer_entry_ref {
215 public:
216 	xfer_entry_ref()
217 	{
218 		device = -1;
219 		directory = -1;
220 		name[0] = 0;
221 	}
222 
223 	operator entry_ref() const
224 	{
225 		entry_ref ref(device, directory, name);
226 		return ref;
227 	}
228 
229 	xfer_entry_ref& operator=(const entry_ref& ref)
230 	{
231 		device = ref.device;
232 		directory = ref.directory;
233 		if (ref.name)
234 			strcpy(name, ref.name);
235 		else
236 			name[0] = 0;
237 
238 		return *this;
239 	}
240 
241 private:
242 	dev_t	device;
243 	ino_t	directory;
244 	char	name[B_FILE_NAME_LENGTH];
245 };
246 
247 // used by SERVER_GET_NODE and SERVER_SET_NODE
248 enum node_type {
249 	VIDEO_INPUT,
250 	AUDIO_INPUT,
251 	VIDEO_OUTPUT,
252 	AUDIO_MIXER,
253 	AUDIO_OUTPUT,
254 	AUDIO_OUTPUT_EX,
255 	TIME_SOURCE,
256 	SYSTEM_TIME_SOURCE
257 };
258 
259 // used by SERVER_PUBLISH_INPUTS and SERVER_PUBLISH_OUTPUTS
260 enum {
261 	MAX_OUTPUTS = 8,
262 	MAX_INPUTS = 8,
263 };
264 
265 // used by SERVER_GET_LIVE_NODES
266 enum {
267 	MAX_LIVE_INFO = 16,
268 };
269 
270 // used by SERVER_GET_INSTANCES_FOR
271 enum {
272 	MAX_NODE_ID = 4000,
273 };
274 
275 // used by SERVER_GET_READERS
276 enum {
277 	MAX_READERS = 40,
278 };
279 
280 struct addonserver_instantiate_dormant_node_request : request_data {
281 	media_addon_id			addonid;
282 	int32					flavorid;
283 	team_id					creator_team;
284 };
285 
286 struct addonserver_instantiate_dormant_node_reply : reply_data {
287 	media_node				node;
288 };
289 
290 struct server_set_node_request : request_data {
291 	node_type				type;
292 	bool					use_node;
293 	media_node				node;
294 	bool					use_dni;
295 	dormant_node_info		dni;
296 	bool					use_input;
297 	media_input				input;
298 };
299 
300 struct server_set_node_reply : reply_data {
301 };
302 
303 struct server_get_node_request : request_data {
304 	node_type				type;
305 	team_id					team;
306 };
307 
308 struct server_get_node_reply : public reply_data {
309 	media_node				node;
310 
311 	// for AUDIO_OUTPUT_EX
312 	char					input_name[B_MEDIA_NAME_LENGTH];
313 	int32					input_id;
314 };
315 
316 struct producer_format_proposal_request : public request_data {
317 	media_source			output;
318 	media_format			format;
319 };
320 
321 struct producer_format_proposal_reply : reply_data {
322 	media_format			format;
323 };
324 
325 struct producer_prepare_to_connect_request : request_data {
326 	media_source			source;
327 	media_destination		destination;
328 	media_format			format;
329 	char					name[B_MEDIA_NAME_LENGTH];
330 };
331 
332 struct producer_prepare_to_connect_reply : reply_data {
333 	media_format			format;
334 	media_source			out_source;
335 	char					name[B_MEDIA_NAME_LENGTH];
336 };
337 
338 struct producer_connect_request : request_data {
339 	status_t				error;
340 	media_source			source;
341 	media_destination		destination;
342 	media_format			format;
343 	char					name[B_MEDIA_NAME_LENGTH];
344 };
345 
346 struct producer_connect_reply : reply_data {
347 	char					name[B_MEDIA_NAME_LENGTH];
348 };
349 
350 struct producer_disconnect_request : request_data {
351 	media_source			source;
352 	media_destination		destination;
353 };
354 
355 struct producer_disconnect_reply : reply_data {
356 };
357 
358 struct producer_format_suggestion_requested_request : request_data {
359 	media_type				type;
360 	int32					quality;
361 };
362 
363 struct producer_format_suggestion_requested_reply : reply_data {
364 	media_format			format;
365 };
366 
367 struct producer_set_play_rate_request : request_data {
368 	int32					numer;
369 	int32					denom;
370 };
371 
372 struct producer_set_play_rate_reply : reply_data {
373 };
374 
375 struct producer_get_initial_latency_request : request_data {
376 };
377 
378 struct producer_get_initial_latency_reply : reply_data {
379 	bigtime_t				initial_latency;
380 	uint32					flags;
381 };
382 
383 struct producer_get_latency_request : request_data {
384 };
385 
386 struct producer_get_latency_reply : reply_data {
387 	bigtime_t				latency;
388 };
389 
390 struct producer_set_buffer_group_command : command_data {
391 	media_source			source;
392 	media_destination		destination;
393 	void*					user_data;
394 	int32					change_tag;
395 	int32					buffer_count;
396 	media_buffer_id			buffers[1];
397 };
398 
399 struct producer_format_change_requested_command : command_data {
400 	media_source			source;
401 	media_destination		destination;
402 	media_format			format;
403 	void*					user_data;
404 	int32					change_tag;
405 };
406 
407 struct producer_video_clipping_changed_command : command_data {
408 	media_source			source;
409 	media_destination		destination;
410 	media_video_display_info display;
411 	void*					user_data;
412 	int32					change_tag;
413 	int32					short_count;
414 	int16					shorts[1];
415 };
416 
417 struct producer_additional_buffer_requested_command : command_data {
418 	media_source			source;
419 	media_buffer_id			prev_buffer;
420 	bigtime_t				prev_time;
421 	bool					has_seek_tag;
422 	media_seek_tag			prev_tag;
423 };
424 
425 struct producer_latency_changed_command : command_data {
426 	media_source			source;
427 	media_destination		destination;
428 	bigtime_t				latency;
429 	uint32					flags;
430 };
431 
432 struct producer_enable_output_command : command_data {
433 	media_source			source;
434 	media_destination		destination;
435 	bool					enabled;
436 	void*					user_data;
437 	int32					change_tag;
438 };
439 
440 struct producer_late_notice_received_command : command_data {
441 	media_source			source;
442 	bigtime_t				how_much;
443 	bigtime_t				performance_time;
444 };
445 
446 struct producer_set_run_mode_delay_command : command_data {
447 	BMediaNode::run_mode	mode;
448 	bigtime_t				delay;
449 };
450 
451 struct consumer_accept_format_request : request_data {
452 	media_destination		dest;
453 	media_format			format;
454 };
455 
456 struct consumer_accept_format_reply : reply_data {
457 	media_format			format;
458 };
459 
460 struct consumer_connected_request : request_data {
461 	media_input				input;
462 };
463 
464 struct consumer_connected_reply : reply_data {
465 	media_input				input;
466 };
467 
468 struct server_publish_inputs_request : request_data {
469 	media_node				node;
470 	int32					count;
471 	area_id area;	// if count > MAX_INPUTS, inputs are in the area
472 					// area is created in the library, and also deleted
473 					// in the library after the reply has been received
474 	media_input inputs[MAX_INPUTS];
475 };
476 
477 struct server_publish_inputs_reply : reply_data {
478 };
479 
480 struct server_publish_outputs_request : area_request_data {
481 	media_node				node;
482 	int32					count;
483 		// if count > MAX_OUTPUTS, outputs are in the area
484 		// area is created in the library, and also deleted
485 		// in the library after the reply has been received
486 	media_output outputs[MAX_OUTPUTS];
487 };
488 
489 struct server_publish_outputs_reply : reply_data {
490 };
491 
492 struct producer_get_next_output_request : request_data {
493 	int32					cookie;
494 };
495 
496 struct producer_get_next_output_reply : reply_data
497 {
498 	int32					cookie;
499 	media_output			output;
500 };
501 
502 struct producer_dispose_output_cookie_request : request_data
503 {
504 	int32					cookie;
505 };
506 
507 struct producer_dispose_output_cookie_reply : reply_data {
508 };
509 
510 struct consumer_get_next_input_request : request_data {
511 	int32					cookie;
512 };
513 
514 struct consumer_get_next_input_reply : reply_data {
515 	int32					cookie;
516 	media_input				input;
517 };
518 
519 struct consumer_dispose_input_cookie_request : request_data {
520 	int32					cookie;
521 };
522 
523 struct consumer_dispose_input_cookie_reply : reply_data {
524 };
525 
526 struct consumer_disconnected_request : request_data {
527 	media_source			source;
528 	media_destination		destination;
529 };
530 
531 struct consumer_disconnected_reply : reply_data {
532 };
533 
534 struct consumer_buffer_received_command : command_data {
535 	media_buffer_id			buffer;
536 	media_header			header;
537 };
538 
539 struct consumer_producer_data_status_command : command_data {
540 	media_destination		for_whom;
541 	int32					status;
542 	bigtime_t				at_performance_time;
543 };
544 
545 struct consumer_get_latency_for_request : request_data {
546 	media_destination		for_whom;
547 };
548 
549 struct consumer_get_latency_for_reply : reply_data {
550 	bigtime_t				latency;
551 	media_node_id			timesource;
552 };
553 
554 struct consumer_format_changed_request : request_data {
555 	media_source			producer;
556 	media_destination		consumer;
557 	int32					change_tag;
558 	media_format			format;
559 };
560 
561 struct consumer_format_changed_reply : reply_data {
562 };
563 
564 struct consumer_seek_tag_requested_request : request_data {
565 	media_destination		destination;
566 	bigtime_t				target_time;
567 	uint32					flags;
568 };
569 
570 struct consumer_seek_tag_requested_reply : reply_data {
571 	media_seek_tag			seek_tag;
572 	bigtime_t				tagged_time;
573 	uint32					flags;
574 };
575 
576 struct server_register_app_request : request_data {
577 	team_id					team;
578 	BMessenger				messenger;
579 };
580 
581 struct server_register_app_reply : reply_data {
582 };
583 
584 struct server_unregister_app_request : request_data {
585 	team_id					team;
586 };
587 
588 struct server_unregister_app_reply : reply_data {
589 };
590 
591 struct server_set_node_creator_request : request_data {
592 	media_node_id			node;
593 	team_id					creator;
594 };
595 
596 struct server_set_node_creator_reply : reply_data {
597 };
598 
599 struct server_change_addon_flavor_instances_count_request : request_data {
600 	media_addon_id			addonid;
601 	int32					flavorid;
602 	int32					delta; // must be +1 or -1
603 	team_id					team;
604 };
605 
606 struct server_change_addon_flavor_instances_count_reply : reply_data {
607 };
608 
609 struct server_register_node_request : request_data {
610 	media_addon_id			addon_id;
611 	int32					addon_flavor_id;
612 	char					name[B_MEDIA_NAME_LENGTH];
613 	uint64					kinds;
614 	port_id					port;
615 	team_id					team;
616 };
617 
618 struct server_register_node_reply : reply_data {
619 	media_node_id			nodeid;
620 };
621 
622 struct server_unregister_node_request : request_data {
623 	media_node_id			nodeid;
624 	team_id					team;
625 };
626 
627 struct server_unregister_node_reply : reply_data {
628 	media_addon_id			addonid;
629 	int32					flavorid;
630 };
631 
632 struct server_get_live_node_info_request : request_data {
633 	media_node				node;
634 };
635 
636 struct server_get_live_node_info_reply : reply_data {
637 	live_node_info			live_info;
638 };
639 
640 struct server_get_live_nodes_request : request_data {
641 	int32					maxcount;
642 	bool					has_input;
643 	bool					has_output;
644 	bool					has_name;
645 	media_format			inputformat;
646 	media_format			outputformat;
647 	char					name[B_MEDIA_NAME_LENGTH + 1];
648 								// +1 for a trailing "*"
649 	uint64					require_kinds;
650 };
651 
652 struct server_get_live_nodes_reply : area_reply_data {
653 	int32					count;
654 		// if count > MAX_LIVE_INFO, live_node_infos are in the area
655 		// area is created in the server, but deleted in the library
656 	live_node_info			live_info[MAX_LIVE_INFO];
657 };
658 
659 struct server_node_id_for_request : request_data {
660 	port_id					port;
661 };
662 
663 struct server_node_id_for_reply : reply_data {
664 	media_node_id			nodeid;
665 };
666 
667 struct server_get_node_for_request : request_data {
668 	media_node_id			nodeid;
669 	team_id					team;
670 };
671 
672 struct server_get_node_for_reply : reply_data {
673 	media_node				clone;
674 };
675 
676 struct server_release_node_request : request_data {
677 	media_node				node;
678 	team_id					team;
679 };
680 
681 struct server_release_node_reply : reply_data {
682 };
683 
684 struct server_get_dormant_node_for_request : request_data {
685 	media_node				node;
686 };
687 
688 struct server_get_dormant_node_for_reply : reply_data {
689 	dormant_node_info		node_info;
690 };
691 
692 struct server_get_instances_for_request : request_data {
693 	int32					maxcount;
694 	media_addon_id			addon_id;
695 	int32					addon_flavor_id;
696 };
697 
698 struct server_get_instances_for_reply : reply_data {
699 	int32					count;
700 	media_node_id			node_id[MAX_NODE_ID];
701 		// no area here, MAX_NODE_ID is really large
702 };
703 
704 struct server_rescan_defaults_command : command_data {
705 };
706 
707 struct addonserver_rescan_mediaaddon_flavors_command : command_data {
708 	media_addon_id			addonid;
709 };
710 
711 struct server_register_mediaaddon_request : request_data {
712 	xfer_entry_ref			ref;
713 };
714 
715 struct server_register_mediaaddon_reply : reply_data {
716 	media_addon_id			addonid;
717 };
718 
719 struct server_unregister_mediaaddon_command : command_data {
720 	media_addon_id			addonid;
721 };
722 
723 struct server_get_mediaaddon_ref_request : request_data {
724 	media_addon_id			addonid;
725 };
726 
727 struct server_get_mediaaddon_ref_reply : reply_data {
728 	xfer_entry_ref			ref;
729 };
730 
731 struct server_get_shared_buffer_area_request : request_data {
732 };
733 
734 struct server_get_shared_buffer_area_reply : area_reply_data {
735 };
736 
737 struct server_register_buffer_request : request_data {
738 	team_id					team;
739 	buffer_clone_info		info;
740 		// either info.buffer is != 0, or the area, size, offset is used
741 };
742 
743 struct server_register_buffer_reply : reply_data {
744 	buffer_clone_info		info;
745 };
746 
747 struct server_unregister_buffer_command : command_data {
748 	team_id					team;
749 	media_buffer_id			bufferid;
750 };
751 
752 struct server_rewindtypes_request : request_data {
753 };
754 
755 struct server_rewindtypes_reply : area_reply_data {
756 	int32					count;
757 };
758 
759 struct server_rewindrefs_request : request_data {
760 	char					type[B_MEDIA_NAME_LENGTH];
761 };
762 
763 struct server_rewindrefs_reply : area_reply_data {
764 	int32					count;
765 };
766 
767 struct server_getreffor_request : request_data {
768 	char					type[B_MEDIA_NAME_LENGTH];
769 	char					item[B_MEDIA_NAME_LENGTH];
770 };
771 
772 struct server_getreffor_reply : reply_data {
773 	xfer_entry_ref			ref;
774 };
775 
776 struct server_setreffor_request : request_data {
777 	char					type[B_MEDIA_NAME_LENGTH];
778 	char					item[B_MEDIA_NAME_LENGTH];
779 	xfer_entry_ref			ref;
780 };
781 
782 struct server_setreffor_reply : reply_data {
783 };
784 
785 struct server_removereffor_request : request_data {
786 	char					type[B_MEDIA_NAME_LENGTH];
787 	char					item[B_MEDIA_NAME_LENGTH];
788 	xfer_entry_ref			ref;
789 };
790 
791 struct server_removereffor_reply : reply_data {
792 };
793 
794 struct server_removeitem_request : request_data {
795 	char					type[B_MEDIA_NAME_LENGTH];
796 	char					item[B_MEDIA_NAME_LENGTH];
797 };
798 
799 struct server_removeitem_reply : reply_data {
800 };
801 
802 struct server_get_decoder_for_format_request : request_data {
803 	media_format			format;
804 };
805 
806 struct server_get_decoder_for_format_reply : reply_data {
807 	xfer_entry_ref			ref;
808 		// a ref to the decoder
809 };
810 
811 struct server_get_encoder_for_format_request : request_data {
812 	media_format			format;
813 };
814 
815 struct server_get_encoder_for_format_reply : reply_data {
816 	xfer_entry_ref			ref;
817 		// a ref to the encoder
818 };
819 
820 struct server_get_readers_request : request_data {
821 };
822 
823 struct server_get_readers_reply : reply_data {
824 	xfer_entry_ref			ref[MAX_READERS];
825 		// a list of refs to the reader
826 	int32					count;
827 };
828 
829 struct server_get_writer_request : request_data {
830 	uint32					internal_id;
831 };
832 
833 struct server_get_writer_reply : reply_data {
834 	xfer_entry_ref			ref;
835 		// a ref to the writer
836 };
837 
838 struct server_get_file_format_request : request_data {
839 	int32					cookie;
840 };
841 
842 struct server_get_file_format_reply : reply_data {
843 	media_file_format		file_format;
844 		// the file format matching the cookie
845 };
846 
847 struct node_request_completed_command : command_data {
848 	media_request_info		info;
849 };
850 
851 struct node_start_command : command_data {
852 	bigtime_t				performance_time;
853 };
854 
855 struct node_stop_command : command_data {
856 	bigtime_t				performance_time;
857 	bool					immediate;
858 };
859 
860 struct node_seek_command : command_data {
861 	bigtime_t				media_time;
862 	bigtime_t				performance_time;
863 };
864 
865 struct node_set_run_mode_command : command_data {
866 	BMediaNode::run_mode	mode;
867 };
868 
869 struct node_time_warp_command : command_data {
870 	bigtime_t				at_real_time;
871 	bigtime_t				to_performance_time;
872 };
873 
874 struct node_set_timesource_command : command_data {
875 	media_node_id			timesource_id;
876 };
877 
878 struct node_get_timesource_request : request_data {
879 };
880 
881 struct node_get_timesource_reply : reply_data {
882 	media_node_id			timesource_id;
883 };
884 
885 struct node_final_release_command : command_data {
886 };
887 
888 struct timesource_add_slave_node_command : command_data {
889 	media_node				node;
890 };
891 
892 struct timesource_remove_slave_node_command : command_data {
893 	media_node				node;
894 };
895 
896 struct timesource_get_start_latency_request : request_data {
897 };
898 
899 struct timesource_get_start_latency_reply : reply_data {
900 	bigtime_t				start_latency;
901 };
902 
903 struct fileinterface_set_ref_request : request_data {
904 	dev_t					device;
905 	ino_t					directory;
906 	char					name[B_FILE_NAME_LENGTH];
907 	bigtime_t				duration;
908 	bool					create;
909 };
910 
911 struct fileinterface_set_ref_reply : reply_data {
912 	bigtime_t				duration;
913 };
914 
915 struct fileinterface_get_ref_request : request_data {
916 };
917 
918 struct fileinterface_get_ref_reply : reply_data {
919 	dev_t					device;
920 	ino_t					directory;
921 	char					name[B_FILE_NAME_LENGTH];
922 	char					mimetype[B_MIME_TYPE_LENGTH];
923 };
924 
925 struct fileinterface_sniff_ref_request : request_data {
926 	dev_t					device;
927 	ino_t					directory;
928 	char					name[B_FILE_NAME_LENGTH];
929 };
930 
931 struct fileinterface_sniff_ref_reply : reply_data {
932 	char					mimetype[B_MIME_TYPE_LENGTH];
933 	float					capability;
934 };
935 
936 struct controllable_get_parameter_web_request : area_request_data {
937 	int32					max_size;
938 };
939 
940 struct controllable_get_parameter_web_reply : reply_data {
941 	type_code				code;
942 	int32					size;
943 		// = -1: parameter web data too large,
944 		// = 0: no p.w., > 0: flattened p.w. data
945 };
946 
947 #define MAX_PARAMETER_DATA (B_MEDIA_MESSAGE_SIZE - 100)
948 
949 struct controllable_get_parameter_data_request : area_request_data {
950 	int32					parameter_id;
951 	size_t					request_size;
952 };
953 
954 struct controllable_get_parameter_data_reply : reply_data {
955 	bigtime_t				last_change;
956 	char					raw_data[MAX_PARAMETER_DATA];
957 	size_t					size;
958 };
959 
960 struct controllable_set_parameter_data_request : area_request_data {
961 	int32					parameter_id;
962 	bigtime_t				when;
963 	size_t					size;
964 	char					raw_data[MAX_PARAMETER_DATA];
965 };
966 
967 struct controllable_set_parameter_data_reply : reply_data {
968 };
969 
970 struct controllable_start_control_panel_request : request_data {
971 	media_node				node;
972 };
973 
974 struct controllable_start_control_panel_reply : reply_data {
975 	team_id					team;
976 };
977 
978 #endif // _DATA_EXCHANGE_H
979