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