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