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