mf: Add a helper to trace timestamp arguments.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-03-25 15:01:23 +03:00 committed by Alexandre Julliard
parent 914bb084e5
commit e121a55293
4 changed files with 31 additions and 8 deletions

View File

@ -1894,7 +1894,7 @@ static HRESULT WINAPI sample_copier_transform_GetOutputStatus(IMFTransform *ifac
static HRESULT WINAPI sample_copier_transform_SetOutputBounds(IMFTransform *iface, LONGLONG lower, LONGLONG upper)
{
TRACE("%p, %s, %s.\n", iface, wine_dbgstr_longlong(lower), wine_dbgstr_longlong(upper));
TRACE("%p, %s, %s.\n", iface, debugstr_time(lower), debugstr_time(upper));
return E_NOTIMPL;
}

View File

@ -19,6 +19,7 @@
#include "mfidl.h"
#include "wine/heap.h"
#include "wine/debug.h"
static inline BOOL mf_array_reserve(void **elements, size_t *capacity, size_t count, size_t size)
{
@ -55,3 +56,23 @@ struct activate_funcs
};
HRESULT create_activation_object(void *context, const struct activate_funcs *funcs, IMFActivate **ret) DECLSPEC_HIDDEN;
static inline const char *debugstr_time(LONGLONG time)
{
ULONGLONG abstime = time >= 0 ? time : -time;
unsigned int i = 0, j = 0;
char buffer[23], rev[23];
while (abstime || i <= 8)
{
buffer[i++] = '0' + (abstime % 10);
abstime /= 10;
if (i == 7) buffer[i++] = '.';
}
if (time < 0) buffer[i++] = '-';
while (i--) rev[j++] = buffer[i];
rev[j] = 0;
return wine_dbg_sprintf("%s", rev);
}

View File

@ -1151,7 +1151,7 @@ static HRESULT WINAPI sample_grabber_clock_sink_OnClockStart(IMFClockStateSink *
{
struct sample_grabber *grabber = impl_from_IMFClockStateSink(iface);
TRACE("%p, %s, %s.\n", iface, wine_dbgstr_longlong(systime), wine_dbgstr_longlong(offset));
TRACE("%p, %s, %s.\n", iface, debugstr_time(systime), debugstr_time(offset));
sample_grabber_set_state(grabber, SINK_STATE_RUNNING);
@ -1162,7 +1162,7 @@ static HRESULT WINAPI sample_grabber_clock_sink_OnClockStop(IMFClockStateSink *i
{
struct sample_grabber *grabber = impl_from_IMFClockStateSink(iface);
TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(systime));
TRACE("%p, %s.\n", iface, debugstr_time(systime));
sample_grabber_set_state(grabber, SINK_STATE_STOPPED);
@ -1173,7 +1173,7 @@ static HRESULT WINAPI sample_grabber_clock_sink_OnClockPause(IMFClockStateSink *
{
struct sample_grabber *grabber = impl_from_IMFClockStateSink(iface);
TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(systime));
TRACE("%p, %s.\n", iface, debugstr_time(systime));
return IMFSampleGrabberSinkCallback_OnClockPause(sample_grabber_get_callback(grabber), systime);
}
@ -1182,7 +1182,7 @@ static HRESULT WINAPI sample_grabber_clock_sink_OnClockRestart(IMFClockStateSink
{
struct sample_grabber *grabber = impl_from_IMFClockStateSink(iface);
TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(systime));
TRACE("%p, %s.\n", iface, debugstr_time(systime));
sample_grabber_set_state(grabber, SINK_STATE_RUNNING);
@ -1193,7 +1193,7 @@ static HRESULT WINAPI sample_grabber_clock_sink_OnClockSetRate(IMFClockStateSink
{
struct sample_grabber *grabber = impl_from_IMFClockStateSink(iface);
TRACE("%p, %s, %f.\n", iface, wine_dbgstr_longlong(systime), rate);
TRACE("%p, %s, %f.\n", iface, debugstr_time(systime), rate);
return IMFSampleGrabberSinkCallback_OnClockSetRate(sample_grabber_get_callback(grabber), systime, rate);
}

View File

@ -31,6 +31,8 @@
#include "wine/heap.h"
#include "wine/list.h"
#include "mf_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(mfplat);
enum session_command
@ -3547,7 +3549,7 @@ static HRESULT WINAPI present_clock_Start(IMFPresentationClock *iface, LONGLONG
struct clock_state_change_param param = {{0}};
HRESULT hr;
TRACE("%p, %s.\n", iface, wine_dbgstr_longlong(start_offset));
TRACE("%p, %s.\n", iface, debugstr_time(start_offset));
EnterCriticalSection(&clock->cs);
clock->start_offset = param.u.offset = start_offset;
@ -3772,7 +3774,7 @@ static HRESULT WINAPI present_clock_timer_SetTimer(IMFTimer *iface, DWORD flags,
struct clock_timer *clock_timer;
HRESULT hr;
TRACE("%p, %#x, %s, %p, %p, %p.\n", iface, flags, wine_dbgstr_longlong(time), callback, state, cancel_key);
TRACE("%p, %#x, %s, %p, %p, %p.\n", iface, flags, debugstr_time(time), callback, state, cancel_key);
if (!(clock_timer = heap_alloc_zero(sizeof(*clock_timer))))
return E_OUTOFMEMORY;