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