Transport Stream file push souce filter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Hyrum Mortensen (hymort_at_hotmail.com)
Date: 08/18/04


Date: 18 Aug 2004 14:05:31 -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



Relevant Pages

  • push source filter
    ... I'm trying to implement a push source filter that will read a MPEG-2 ... Transport Stream file and push it to a demux and eventually a ... In the Demux, I map PID 0x11 to Output pin ...
    (microsoft.public.multimedia.directx.dshow.programming)
  • push source filter
    ... I'm trying to implement a push source filter that will read a MPEG-2 ... Transport Stream file and push it to a demux and eventually a ... In the Demux, I map PID 0x11 to Output pin ...
    (microsoft.public.multimedia.directx.dshow.programming)
  • push source filter
    ... I'm trying to implement a push source filter that will read a MPEG-2 ... Transport Stream file and push it to a demux and eventually a ... In the Demux, I map PID 0x11 to Output pin ...
    (microsoft.public.multimedia.directx.dshow.programming)
  • Re: MPEG-2 Demux Query
    ... HD still images into an MPEG transport stream (alongside ... normal 25fps SD video). ... I was having some problems getting the microsoft MPEG-2 demux to pass ... from the PES frame in order to forward it to my MPEG-2 video decoder. ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: help for BDA on Vista ?
    ... Does it means that when the driver pass the transport stream to demux ... I've not done VIsta development, but this also ... question of which windows media libraries you install). ...
    (microsoft.public.win32.programmer.directx.video)