>
</File>
<File
+ RelativePath=".\QStreamer.h"
+ >
+ </File>
+ <File
RelativePath=".\QWaveOutputer.h"
>
</File>
QFilter() : m_pStreamer(0), m_pFGraph(0), m_pPinVideo(0),
m_state(State_Stopped),
- m_StartPos(0)
+ m_StartPos(-1)
{
memset(m_Pins, 0, sizeof(m_Pins));
}
INT64 pos = *pCurrent;
if (m_pStreamer != 0) {
+ m_pStreamer->BeginFlush();
m_pStreamer->RequestSeek(pos);
m_pStreamer->RequestStart();
return hRslt;
}
- if (m_StartPos != 0) {
+ if (m_StartPos != -1) {
m_pStreamer->RequestSeek(m_StartPos);
- m_StartPos = 0;
+ m_StartPos = -1;
}
}
ALLOCATOR_PROPERTIES aprop = { 0 };
rprop.cBuffers = 20;
- rprop.cbBuffer = 2 * m_WaveHeader.nChannels * m_WaveHeader.nSamplesPerSec / 20;
+ rprop.cbBuffer = 2 * m_WaveHeader.nChannels * m_WaveHeader.nSamplesPerSec / 10;
rprop.cbAlign = 1;
rprop.cbPrefix = 0;
bool Setup()
{
INT64 scale = QM_GetTimeCodeScale(m_reader);
+#if 0
if (scale != 1000*1000) {
return false;
}
+#else
+ // matroska ts -> RT : 1ns -> 100ns
+ m_scale = (INT32)(scale / 100);
+ // 1s / matroska ts
+ m_ascale = (INT32)(1000*1000*1000 / scale);
+#endif
DOUBLE d = QM_GetDuraion(m_reader);
m_duration = (INT64)(d * m_scale);
IMemAllocator* alloc,
const VIDEOINFOHEADER2* v)
{
+ if (pin == 0) {
+ return S_OK;
+ }
+
ATL::CComQIPtr<IPin> vp(pin);
if (vp == 0) {
return E_NOINTERFACE;
IMemAllocator* alloc,
const WAVEFORMATEX* w)
{
+ if (pin == 0) {
+ return S_OK;
+ }
+
ATL::CComQIPtr<IPin> vp(pin);
if (vp == 0) {
return E_NOINTERFACE;
/* */
+ HRESULT BeginFlush()
+ {
+ if (m_VideoPin != 0) {
+ m_VideoPin->BeginFlush();
+ }
+
+ if (m_AudioPin != 0) {
+ m_AudioPin->BeginFlush();
+ }
+
+ return S_OK;
+ }
+
+ /* */
+
void RequestSeek(INT64 pos)
{
ATL::CComCritSecLock<ATL::CComCriticalSection> lock(m_cs);
m_Outputer.Flush();
- if (m_VideoPin != 0) {
- m_VideoPin->BeginFlush();
- }
-
- if (m_AudioPin != 0) {
- m_AudioPin->BeginFlush();
- }
-
if (!m_pReader->Seek(m_SeekPos)) {
ATLTRACE("QStreamer::DoStreaming() Seek ERROR!\n");
break;
if (m_sample != 0) {
m_sample->SetActualDataLength(m_cbFilled);
+ //ATLTRACE("AS: %d\n", m_cbFilled);
+
HRESULT hRslt = pin->Receive(m_sample);
if (FAILED(hRslt)) {
return false;
m_sample->SetDiscontinuity(TRUE);
}
+ // INT32 ss = (INT32)(rt / (1000*100));
+ // ATLTRACE("A: %d.%02d\n", ss / 100, ss % 100);
+
return true;
}