wineqtdecoder: Move the SourceSeeking structure to the source pin.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
9582f6a41d
commit
54ccf805e7
|
@ -131,6 +131,7 @@ extern CLSID CLSID_QTSplitter;
|
||||||
typedef struct QTOutPin {
|
typedef struct QTOutPin {
|
||||||
struct strmbase_source pin;
|
struct strmbase_source pin;
|
||||||
IQualityControl IQualityControl_iface;
|
IQualityControl IQualityControl_iface;
|
||||||
|
SourceSeeking seeking;
|
||||||
|
|
||||||
AM_MEDIA_TYPE * pmt;
|
AM_MEDIA_TYPE * pmt;
|
||||||
OutputQueue * queue;
|
OutputQueue * queue;
|
||||||
|
@ -162,7 +163,6 @@ typedef struct QTSplitter {
|
||||||
DWORD outputSize;
|
DWORD outputSize;
|
||||||
CRITICAL_SECTION csReceive;
|
CRITICAL_SECTION csReceive;
|
||||||
|
|
||||||
SourceSeeking sourceSeeking;
|
|
||||||
TimeValue movie_time;
|
TimeValue movie_time;
|
||||||
TimeValue movie_start;
|
TimeValue movie_start;
|
||||||
TimeScale movie_scale;
|
TimeScale movie_scale;
|
||||||
|
@ -183,9 +183,9 @@ static HRESULT WINAPI QTSplitter_ChangeStart(IMediaSeeking *iface);
|
||||||
static HRESULT WINAPI QTSplitter_ChangeStop(IMediaSeeking *iface);
|
static HRESULT WINAPI QTSplitter_ChangeStop(IMediaSeeking *iface);
|
||||||
static HRESULT WINAPI QTSplitter_ChangeRate(IMediaSeeking *iface);
|
static HRESULT WINAPI QTSplitter_ChangeRate(IMediaSeeking *iface);
|
||||||
|
|
||||||
static inline QTSplitter *impl_from_IMediaSeeking( IMediaSeeking *iface )
|
static inline QTOutPin *impl_from_IMediaSeeking(IMediaSeeking *iface)
|
||||||
{
|
{
|
||||||
return CONTAINING_RECORD(iface, QTSplitter, sourceSeeking.IMediaSeeking_iface);
|
return CONTAINING_RECORD(iface, QTOutPin, seeking.IMediaSeeking_iface);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QTSplitter *impl_from_strmbase_filter(struct strmbase_filter *iface)
|
static inline QTSplitter *impl_from_strmbase_filter(struct strmbase_filter *iface)
|
||||||
|
@ -374,9 +374,6 @@ IUnknown * CALLBACK QTSplitter_create(IUnknown *outer, HRESULT *phr)
|
||||||
This->pInputPin.pin.peer = NULL;
|
This->pInputPin.pin.peer = NULL;
|
||||||
This->pInputPin.pin.pFuncsTable = &sink_ops;
|
This->pInputPin.pin.pFuncsTable = &sink_ops;
|
||||||
|
|
||||||
strmbase_seeking_init(&This->sourceSeeking, &QT_Seeking_Vtbl,
|
|
||||||
QTSplitter_ChangeStop, QTSplitter_ChangeStart, QTSplitter_ChangeRate);
|
|
||||||
|
|
||||||
*phr = S_OK;
|
*phr = S_OK;
|
||||||
return &This->filter.IUnknown_inner;
|
return &This->filter.IUnknown_inner;
|
||||||
}
|
}
|
||||||
|
@ -731,6 +728,7 @@ static void free_source_pin(QTOutPin *pin)
|
||||||
}
|
}
|
||||||
|
|
||||||
DeleteMediaType(pin->pmt);
|
DeleteMediaType(pin->pmt);
|
||||||
|
strmbase_seeking_cleanup(&pin->seeking);
|
||||||
strmbase_source_cleanup(&pin->pin);
|
strmbase_source_cleanup(&pin->pin);
|
||||||
heap_free(pin);
|
heap_free(pin);
|
||||||
}
|
}
|
||||||
|
@ -914,7 +912,7 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
|
||||||
Track trk;
|
Track trk;
|
||||||
short id = 0;
|
short id = 0;
|
||||||
DWORD tid;
|
DWORD tid;
|
||||||
LONGLONG time;
|
LONGLONG time, duration;
|
||||||
|
|
||||||
TRACE("Trying movie connect\n");
|
TRACE("Trying movie connect\n");
|
||||||
|
|
||||||
|
@ -955,10 +953,12 @@ static HRESULT QT_Process_Movie(QTSplitter* filter)
|
||||||
|
|
||||||
time = GetMovieDuration(filter->pQTMovie);
|
time = GetMovieDuration(filter->pQTMovie);
|
||||||
filter->movie_scale = GetMovieTimeScale(filter->pQTMovie);
|
filter->movie_scale = GetMovieTimeScale(filter->pQTMovie);
|
||||||
filter->sourceSeeking.llDuration = ((double)time / filter->movie_scale) * 10000000;
|
duration = ((double)time / filter->movie_scale) * 10000000;
|
||||||
filter->sourceSeeking.llStop = filter->sourceSeeking.llDuration;
|
TRACE("Movie duration is %s.\n", wine_dbgstr_longlong(duration));
|
||||||
|
if (filter->pVideo_Pin)
|
||||||
TRACE("Movie duration is %s\n",wine_dbgstr_longlong(filter->sourceSeeking.llDuration));
|
filter->pVideo_Pin->seeking.llStop = filter->pVideo_Pin->seeking.llDuration = duration;
|
||||||
|
if (filter->pAudio_Pin)
|
||||||
|
filter->pAudio_Pin->seeking.llStop = filter->pAudio_Pin->seeking.llDuration = duration;
|
||||||
|
|
||||||
filter->loaderThread = CreateThread(NULL, 0, QTSplitter_loading_thread, filter, 0, &tid);
|
filter->loaderThread = CreateThread(NULL, 0, QTSplitter_loading_thread, filter, 0, &tid);
|
||||||
if (filter->loaderThread)
|
if (filter->loaderThread)
|
||||||
|
@ -1171,7 +1171,7 @@ static HRESULT WINAPI QTOutPin_QueryInterface(IPin *iface, REFIID riid, void **p
|
||||||
else if (IsEqualIID(riid, &IID_IPin))
|
else if (IsEqualIID(riid, &IID_IPin))
|
||||||
*ppv = iface;
|
*ppv = iface;
|
||||||
else if (IsEqualIID(riid, &IID_IMediaSeeking))
|
else if (IsEqualIID(riid, &IID_IMediaSeeking))
|
||||||
*ppv = &This->sourceSeeking.IMediaSeeking_iface;
|
*ppv = &This->seeking.IMediaSeeking_iface;
|
||||||
else if (IsEqualIID(riid, &IID_IQualityControl))
|
else if (IsEqualIID(riid, &IID_IQualityControl))
|
||||||
*ppv = &This->IQualityControl_iface;
|
*ppv = &This->IQualityControl_iface;
|
||||||
|
|
||||||
|
@ -1328,6 +1328,8 @@ static HRESULT QT_AddPin(QTSplitter *filter, const WCHAR *name,
|
||||||
pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
|
pin->pmt = CoTaskMemAlloc(sizeof(AM_MEDIA_TYPE));
|
||||||
CopyMediaType(pin->pmt, mt);
|
CopyMediaType(pin->pmt, mt);
|
||||||
pin->IQualityControl_iface.lpVtbl = &QTOutPin_QualityControl_Vtbl;
|
pin->IQualityControl_iface.lpVtbl = &QTOutPin_QualityControl_Vtbl;
|
||||||
|
strmbase_seeking_init(&pin->seeking, &QT_Seeking_Vtbl,
|
||||||
|
QTSplitter_ChangeStop, QTSplitter_ChangeStart, QTSplitter_ChangeRate);
|
||||||
BaseFilterImpl_IncrementPinVersion(&filter->filter);
|
BaseFilterImpl_IncrementPinVersion(&filter->filter);
|
||||||
|
|
||||||
return OutputQueue_Construct(&pin->pin, TRUE, TRUE, 5, FALSE,
|
return OutputQueue_Construct(&pin->pin, TRUE, TRUE, 5, FALSE,
|
||||||
|
@ -1336,12 +1338,12 @@ static HRESULT QT_AddPin(QTSplitter *filter, const WCHAR *name,
|
||||||
|
|
||||||
static HRESULT WINAPI QTSplitter_ChangeStart(IMediaSeeking *iface)
|
static HRESULT WINAPI QTSplitter_ChangeStart(IMediaSeeking *iface)
|
||||||
{
|
{
|
||||||
QTSplitter *This = impl_from_IMediaSeeking(iface);
|
QTOutPin *pin = impl_from_IMediaSeeking(iface);
|
||||||
|
QTSplitter *filter = impl_from_strmbase_filter(pin->pin.pin.filter);
|
||||||
TRACE("(%p)\n", iface);
|
TRACE("(%p)\n", iface);
|
||||||
EnterCriticalSection(&This->csReceive);
|
EnterCriticalSection(&filter->csReceive);
|
||||||
This->movie_time = (This->sourceSeeking.llCurrent * This->movie_scale)/10000000;
|
filter->movie_start = filter->movie_time = (pin->seeking.llCurrent * filter->movie_scale)/10000000;
|
||||||
This->movie_start = This->movie_time;
|
LeaveCriticalSection(&filter->csReceive);
|
||||||
LeaveCriticalSection(&This->csReceive);
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1357,25 +1359,22 @@ static HRESULT WINAPI QTSplitter_ChangeRate(IMediaSeeking *iface)
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI QT_Seeking_QueryInterface(IMediaSeeking * iface, REFIID riid, LPVOID * ppv)
|
static HRESULT WINAPI QT_Seeking_QueryInterface(IMediaSeeking *iface, REFIID iid, void **out)
|
||||||
{
|
{
|
||||||
QTSplitter *This = impl_from_IMediaSeeking(iface);
|
QTOutPin *pin = impl_from_IMediaSeeking(iface);
|
||||||
|
return IPin_QueryInterface(&pin->pin.pin.IPin_iface, iid, out);
|
||||||
return IBaseFilter_QueryInterface(&This->filter.IBaseFilter_iface, riid, ppv);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI QT_Seeking_AddRef(IMediaSeeking * iface)
|
static ULONG WINAPI QT_Seeking_AddRef(IMediaSeeking * iface)
|
||||||
{
|
{
|
||||||
QTSplitter *This = impl_from_IMediaSeeking(iface);
|
QTOutPin *pin = impl_from_IMediaSeeking(iface);
|
||||||
|
return IPin_AddRef(&pin->pin.pin.IPin_iface);
|
||||||
return IBaseFilter_AddRef(&This->filter.IBaseFilter_iface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static ULONG WINAPI QT_Seeking_Release(IMediaSeeking * iface)
|
static ULONG WINAPI QT_Seeking_Release(IMediaSeeking * iface)
|
||||||
{
|
{
|
||||||
QTSplitter *This = impl_from_IMediaSeeking(iface);
|
QTOutPin *pin = impl_from_IMediaSeeking(iface);
|
||||||
|
return IPin_Release(&pin->pin.pin.IPin_iface);
|
||||||
return IBaseFilter_Release(&This->filter.IBaseFilter_iface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const IMediaSeekingVtbl QT_Seeking_Vtbl =
|
static const IMediaSeekingVtbl QT_Seeking_Vtbl =
|
||||||
|
|
Loading…
Reference in New Issue