int STDCALL stream_input_descriptor_imp::send_start_streaming_cmd(void * notification_id) { struct jdksavdecc_frame cmd_frame; struct jdksavdecc_aem_command_start_streaming aem_cmd_start_streaming; ssize_t aem_cmd_start_streaming_returned; memset(&aem_cmd_start_streaming, 0, sizeof(aem_cmd_start_streaming)); /******************************************** AECP Common Data *******************************************/ aem_cmd_start_streaming.aem_header.aecpdu_header.controller_entity_id = base_end_station_imp_ref->get_adp()->get_controller_entity_id(); // Fill aem_cmd_start_streaming.sequence_id in AEM Controller State Machine aem_cmd_start_streaming.aem_header.command_type = JDKSAVDECC_AEM_COMMAND_START_STREAMING; /******************** AECP Message Specific Data *****************/ aem_cmd_start_streaming.descriptor_type = descriptor_type(); aem_cmd_start_streaming.descriptor_index = descriptor_index(); /************************** Fill frame payload with AECP data and send the frame ***************************/ aecp_controller_state_machine_ref->ether_frame_init(base_end_station_imp_ref->mac(), &cmd_frame, ETHER_HDR_SIZE + JDKSAVDECC_AEM_COMMAND_START_STREAMING_COMMAND_LEN); aem_cmd_start_streaming_returned = jdksavdecc_aem_command_start_streaming_write(&aem_cmd_start_streaming, cmd_frame.payload, ETHER_HDR_SIZE, sizeof(cmd_frame.payload)); if (aem_cmd_start_streaming_returned < 0) { log_imp_ref->post_log_msg(LOGGING_LEVEL_ERROR, "aem_cmd_start_streaming_write error\n"); assert(aem_cmd_start_streaming_returned >= 0); return -1; } aecp_controller_state_machine_ref->common_hdr_init(JDKSAVDECC_AECP_MESSAGE_TYPE_AEM_COMMAND, &cmd_frame, base_end_station_imp_ref->entity_id(), JDKSAVDECC_AEM_COMMAND_START_STREAMING_COMMAND_LEN - JDKSAVDECC_COMMON_CONTROL_HEADER_LEN); system_queue_tx(notification_id, CMD_WITH_NOTIFICATION, cmd_frame.payload, cmd_frame.length); return 0; }
int STDCALL stream_input_descriptor_imp::send_start_streaming_cmd(void *notification_id) { struct jdksavdecc_frame *cmd_frame; struct jdksavdecc_aem_command_start_streaming aem_cmd_start_streaming; int aem_cmd_start_streaming_returned; cmd_frame = (struct jdksavdecc_frame *)malloc(sizeof(struct jdksavdecc_frame)); /******************************************** AECP Common Data *******************************************/ aem_cmd_start_streaming.controller_entity_id = base_end_station_imp_ref->get_adp()->get_controller_guid(); // Fill aem_cmd_start_streaming.sequence_id in AEM Controller State Machine aem_cmd_start_streaming.command_type = JDKSAVDECC_AEM_COMMAND_START_STREAMING; /******************** AECP Message Specific Data *****************/ aem_cmd_start_streaming.descriptor_type = descriptor_type(); aem_cmd_start_streaming.descriptor_index = descriptor_index(); /************************** Fill frame payload with AECP data and send the frame ***************************/ aem_controller_state_machine_ref->ether_frame_init(base_end_station_imp_ref->mac(), cmd_frame); aem_cmd_start_streaming_returned = jdksavdecc_aem_command_start_streaming_write(&aem_cmd_start_streaming, cmd_frame->payload, ETHER_HDR_SIZE, sizeof(cmd_frame->payload)); if(aem_cmd_start_streaming_returned < 0) { log_imp_ref->post_log_msg(LOGGING_LEVEL_ERROR, "aem_cmd_start_streaming_write error\n"); assert(aem_cmd_start_streaming_returned >= 0); return -1; } aem_controller_state_machine_ref->common_hdr_init(cmd_frame, base_end_station_imp_ref->guid()); system_queue_tx(notification_id, CMD_WITH_NOTIFICATION, cmd_frame->payload, cmd_frame->length); free(cmd_frame); return 0; }