Beispiel #1
0
int tsmf_ifman_add_stream(TSMF_IFMAN* ifman)
{
	UINT32 StreamId;
	int status = 0;
	TSMF_STREAM* stream;
	TSMF_PRESENTATION* presentation;

	DEBUG_DVC("");

	presentation = tsmf_presentation_find_by_id(Stream_Pointer(ifman->input));
	Stream_Seek(ifman->input, 16);

	if (presentation == NULL)
	{
		status = 1;
	}
	else
	{
		Stream_Read_UINT32(ifman->input, StreamId);
		Stream_Seek_UINT32(ifman->input); /* numMediaType */
		stream = tsmf_stream_new(presentation, StreamId);

		if (stream)
			tsmf_stream_set_format(stream, ifman->decoder_name, ifman->input);
	}

	ifman->output_pending = TRUE;

	return status;
}
Beispiel #2
0
/**
 * Function description
 *
 * @return 0 on success, otherwise a Win32 error code
 */
UINT tsmf_ifman_add_stream(TSMF_IFMAN* ifman, rdpContext* rdpcontext)
{
	UINT32 StreamId;
	UINT status = CHANNEL_RC_OK;
	TSMF_STREAM* stream;
	TSMF_PRESENTATION* presentation;

	DEBUG_TSMF("");

	if (Stream_GetRemainingLength(ifman->input) < GUID_SIZE + 8)
		return ERROR_INVALID_DATA;

	presentation = tsmf_presentation_find_by_id(Stream_Pointer(ifman->input));
	Stream_Seek(ifman->input, GUID_SIZE);

	if (!presentation)
	{
		WLog_ERR(TAG, "unknown presentation id");
		status = ERROR_NOT_FOUND;
	}
	else
	{
		Stream_Read_UINT32(ifman->input, StreamId);
		Stream_Seek_UINT32(ifman->input); /* numMediaType */

		stream = tsmf_stream_new(presentation, StreamId, rdpcontext);
		if (!stream)
		{
			WLog_ERR(TAG, "failed to create stream");
			return ERROR_OUTOFMEMORY;
		}

		if (!tsmf_stream_set_format(stream, ifman->decoder_name, ifman->input))
		{
			WLog_ERR(TAG, "failed to set stream format");
			return ERROR_OUTOFMEMORY;
		}
	}

	ifman->output_pending = TRUE;
	return status;
}
Beispiel #3
0
int
tsmf_ifman_add_stream(TSMF_IFMAN * ifman)
{
	TSMF_PRESENTATION * presentation;
	TSMF_STREAM * stream;
	uint32 StreamId;
	int error = 0;

	LLOGLN(0, ("tsmf_ifman_add_stream:"));
	presentation = tsmf_presentation_find_by_id(ifman->input_buffer);
	if (presentation == NULL)
		error = 1;
	else
	{
		StreamId = GET_UINT32(ifman->input_buffer, 16);
		stream = tsmf_stream_new(presentation, StreamId);
		if (stream)
			tsmf_stream_set_format(stream, ifman->decoder_name, ifman->input_buffer + 24);
	}
	ifman->output_pending = 1;
	return error;
}