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