void _tsmf_presentation_free(TSMF_PRESENTATION* presentation) { tsmf_presentation_stop(presentation); ArrayList_Clear(presentation->stream_list); ArrayList_Free(presentation->stream_list); free(presentation->rects); ZeroMemory(presentation, sizeof(TSMF_PRESENTATION)); free(presentation); }
void _tsmf_presentation_free(TSMF_PRESENTATION *presentation) { tsmf_presentation_stop(presentation); ArrayList_Clear(presentation->stream_list); ArrayList_Free(presentation->stream_list); if (presentation->rects) free(presentation->rects); memset(presentation, 0, sizeof(TSMF_PRESENTATION)); free(presentation); }
void tsmf_presentation_free(TSMF_PRESENTATION* presentation) { TSMF_STREAM* stream; tsmf_presentation_stop(presentation); WaitForSingleObject(presentation->mutex, INFINITE); list_remove(presentation_list, presentation); ReleaseMutex(presentation->mutex); while (list_size(presentation->stream_list) > 0) { stream = (TSMF_STREAM*) list_dequeue(presentation->stream_list); tsmf_stream_free(stream); } list_free(presentation->stream_list); CloseHandle(presentation->mutex); free(presentation); }
int tsmf_ifman_on_playback_stopped(TSMF_IFMAN* ifman) { TSMF_PRESENTATION* presentation; DEBUG_DVC(""); presentation = tsmf_presentation_find_by_id(Stream_Pointer(ifman->input)); if (presentation) tsmf_presentation_stop(presentation); else DEBUG_WARN("unknown presentation id"); Stream_EnsureRemainingCapacity(ifman->output, 16); Stream_Write_UINT32(ifman->output, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ Stream_Write_UINT32(ifman->output, 0); /* StreamId */ Stream_Write_UINT32(ifman->output, TSMM_CLIENT_EVENT_STOP_COMPLETED); /* EventId */ Stream_Write_UINT32(ifman->output, 0); /* cbData */ ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY; return 0; }
int tsmf_ifman_on_playback_stopped(TSMF_IFMAN * ifman) { TSMF_PRESENTATION * presentation; LLOGLN(0, ("tsmf_ifman_on_playback_stopped:")); presentation = tsmf_presentation_find_by_id(ifman->input_buffer); if (presentation) tsmf_presentation_stop(presentation); else LLOGLN(0, ("tsmf_ifman_on_playback_stopped: unknown presentation id")); ifman->output_buffer_size = 16; ifman->output_buffer = malloc(16); SET_UINT32(ifman->output_buffer, 0, CLIENT_EVENT_NOTIFICATION); /* FunctionId */ SET_UINT32(ifman->output_buffer, 4, 0); /* StreamId */ SET_UINT32(ifman->output_buffer, 8, TSMM_CLIENT_EVENT_STOP_COMPLETED); /* EventId */ SET_UINT32(ifman->output_buffer, 12, 0); /* cbData */ ifman->output_interface_id = TSMF_INTERFACE_CLIENT_NOTIFICATIONS | STREAM_ID_PROXY; return 0; }