discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] writing a module for mpeg ts sink


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] writing a module for mpeg ts sink
Date: Fri, 20 Nov 2009 10:59:31 -0800
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Nov 20, 2009 at 11:38:09PM +1100, Kyle Zhou wrote:
> 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  
> flexibility.
> Now the question is how I should override forecast, general_work and how  
> consume will be called?
> Thanks
> Kyle

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.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]