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