int tsmf_ifman_check_format_support_request(TSMF_IFMAN * ifman) { uint32 PlatformCookie; uint32 numMediaType; uint32 FormatSupported = 1; PlatformCookie = GET_UINT32(ifman->input_buffer, 0); /* NoRolloverFlags (4 bytes) ignored */ numMediaType = GET_UINT32(ifman->input_buffer, 8); LLOGLN(0, ("tsmf_ifman_check_format_support_request: PlatformCookie %d numMediaType %d", PlatformCookie, numMediaType)); if (tsmf_codec_check_media_type(ifman->input_buffer + 12)) FormatSupported = 0; if (FormatSupported == 1) LLOGLN(0, ("tsmf_ifman_check_format_support_request: format ok.")); ifman->output_buffer_size = 12; ifman->output_buffer = malloc(12); SET_UINT32(ifman->output_buffer, 0, FormatSupported); SET_UINT32(ifman->output_buffer, 4, PlatformCookie); SET_UINT32(ifman->output_buffer, 8, 0); /* Result */ ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB; return 0; }
int tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman) { UINT32 numMediaType; UINT32 PlatformCookie; UINT32 FormatSupported = 1; Stream_Read_UINT32(ifman->input, PlatformCookie); Stream_Seek_UINT32(ifman->input); /* NoRolloverFlags (4 bytes) */ Stream_Read_UINT32(ifman->input, numMediaType); DEBUG_DVC("PlatformCookie %d numMediaType %d", PlatformCookie, numMediaType); if (!tsmf_codec_check_media_type(ifman->input)) FormatSupported = 0; if (FormatSupported) DEBUG_DVC("format ok."); Stream_EnsureRemainingCapacity(ifman->output, 12); Stream_Write_UINT32(ifman->output, FormatSupported); Stream_Write_UINT32(ifman->output, PlatformCookie); Stream_Write_UINT32(ifman->output, 0); /* Result */ ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB; return 0; }
/** * Function description * * @return 0 on success, otherwise a Win32 error code */ UINT tsmf_ifman_check_format_support_request(TSMF_IFMAN* ifman) { UINT32 numMediaType; UINT32 PlatformCookie; UINT32 FormatSupported = 1; if (Stream_GetRemainingLength(ifman->input) < 12) return ERROR_INVALID_DATA; Stream_Read_UINT32(ifman->input, PlatformCookie); Stream_Seek_UINT32(ifman->input); /* NoRolloverFlags (4 bytes) */ Stream_Read_UINT32(ifman->input, numMediaType); DEBUG_TSMF("PlatformCookie %d numMediaType %d", PlatformCookie, numMediaType); if (!tsmf_codec_check_media_type(ifman->decoder_name, ifman->input)) FormatSupported = 0; if (FormatSupported) DEBUG_TSMF("format ok."); if (!Stream_EnsureRemainingCapacity(ifman->output, 12)) return -1; Stream_Write_UINT32(ifman->output, FormatSupported); Stream_Write_UINT32(ifman->output, PlatformCookie); Stream_Write_UINT32(ifman->output, 0); /* Result */ ifman->output_interface_id = TSMF_INTERFACE_DEFAULT | STREAM_ID_STUB; return CHANNEL_RC_OK; }