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