Writing a module for mpeg ts sink

Hi all,
I am planning to write a sink module that accepts mpeg transport stream
and displays to the screen.
Due to the variable bit rate nature of mpeg stream, this sink will
consume the input at variable rate.
I plan to use the generic gr_block as base class as it provides the most
Now the question is how I should override forecast, general_work and how
consume will be called?

On Fri, Nov 20, 2009 at 11:38:09PM +1100, Kyle Z. wrote:

IIRC, mpeg transports streams are composed of fixed length “records”,
that are something like 188 bytes long. That fact that they may
contain video compressed using a variable rate coder doesn’t impact
the TS, or for that matter, any handling done by GNU Radio.

I think you can subclass gr_sync_block, specify that the element size
is 188, and you should be done. (This assumes that you are always
passed properly aligned records in the TS. That is, you know where
the SYNC byte occurs, and its the first thing in the “record”).

It may be easier to just use gr.file_descriptor_sink and use a
pipe or socket to connect to external display code such as mplayer.