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