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