push source filter
From: Hyrum Mortensen (hymort_at_hotmail.com)
Date: 08/18/04
- Next message: Hyrum Mortensen: "push source filter"
- Previous message: James Kirsch: "Smart Tee Video Splits"
- Next in thread: The March Hare (MVP): "Re: push source filter"
- Reply: The March Hare (MVP): "Re: push source filter"
- Messages sorted by: [ date ] [ thread ]
Date: 18 Aug 2004 14:03:03 -0700
Hi,
I'm trying to implement a push source filter that will read a MPEG-2
Transport Stream (.TS) file and push it to a demux and eventually a
render. Right now, I can get everything connected using GraphEdit,
but I see a blank preview screen. Below are the steps that I
followed. Could someone tell me what I'm doing wrong?
1. read .TS file into an char array (char *m_buffer).
2. define the output pin as a subclass of CSourceStream, and override
the following member functions (non-relevant code cut out):
GetMediaType(CMediaType *pMediaType)
pMediaType->SetType(&MEDIATYPE_Stream);
pMediaType->SetSubtype(&MEDIASUBTYPE_MPEG2_TRANSPORT);
pMediaType->SetFormatType(&CLSID_NULL);
return S_OK;
CheckMediaType(CMediaType *pMediaType)
if (pMediaType->majortype != MEDIATYPE_Stream ||
pMediaType->subtype != MEDIASUBTYPE_MPEG2_TRANSPORT)
{
return E_FAIL;
}
return S_OK;
DecideBufferSize(IMemAllocator *pAlloc, ALLOCATOR_PROPERTIES
*pRequest)
pRequest->cBuffers = 1;
pRequest->cbBuffer = 188;
pRequest->cbAlign = 1 ;
pRequest->cbPrefix = 0 ;
ALLOCATOR_PROPERTIES Actual;
hr = pAlloc->SetProperties(pRequest, &Actual);
FillBuffer(IMediaSample *pms)
pms->GetPointer(&pData);
lDataLen = pms->GetSize();
memcpy(pData, m_buffer, sizeof(char) * lDataLen);
m_buffer += lDataLen;
3. In the Demux, I map PID 0x11 (elementary stream) to Output pin
(MPEG-2 Program Video media type)
Please let me know what I'm doing wrong. I appreciate your help!
Hyrum
- Next message: Hyrum Mortensen: "push source filter"
- Previous message: James Kirsch: "Smart Tee Video Splits"
- Next in thread: The March Hare (MVP): "Re: push source filter"
- Reply: The March Hare (MVP): "Re: push source filter"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|