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