[FFmpeg-devel] FW: Allow multiple programs in MPEGTS output stream

Michael Niedermayer michaelni
Tue Sep 21 19:51:03 CEST 2010


On Wed, Sep 15, 2010 at 04:25:27PM -0700, Uve W. Rick wrote:
> > -----Original Message-----
> > From: ffmpeg-devel-bounces at mplayerhq.hu [mailto:ffmpeg-devel-
> > bounces at mplayerhq.hu] On Behalf Of Carl Eugen Hoyos
> > Sent: Wednesday, September 15, 2010 2:34 PM
> > To: ffmpeg-devel at mplayerhq.hu
> > Subject: Re: [FFmpeg-devel] FW: Allow multiple programs in MPEGTS
> > output stream
> > 
> > Uve W. Rick <Uve.Rick <at> uav.com> writes:
> > 
> > > Changed ff_program_add_stream to av_program_add_stream.
> > >
> > > I've also include the entire patch.
> > 
> > I suspect it was a good idea to send it separately, consider attaching
> > multiple
> > patches.
> > 
> 
> Alright I split into three patches: the first one makes program_add_stream_index
> global, the send one adds a function to utils.c to find the program structure from
> the stream index, and the third one adds program processing to the mpegts encoder.
> 
> > [...]
> > 
> > > +    for(i=0; i<ac->nb_programs; i++)
> > > +        program = ac->programs[i];
> > > +        for(j=0; j<program->nb_stream_indexes; j++)
> > 
> > Either a bug or wrong indentation.
> > 
> 
> Fixed.
> 
> > [...]
> > 
> > > -    service->pmt.opaque = s;
> > > -    service->pmt.cc = 15;
> > 
> > > +        default_service->pmt.opaque = s;
> > > +        default_service->pmt.cc = 15;
> > 
> > Please don't re-indent in a patch that contains functional changes.
> > 
> 
> The changes moved are not re-indents, the code was put inside of an if-else.
> 
> > [...]
> > 
> > +        if (default_service != NULL)
> > +          service = default_service;
> > +        else {
> > 
> > { } missing, please consider using tools/patcheck
> > 
> 
> Ran patcheck on all files.
> 
> > Please fix your line length and cut your quotes, Carl Eugen
> > 
> 
> I guess outlook does not put in carriage returns, I put them in above.
> 
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at mplayerhq.hu
> > https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel

Content-Description: av_program.patch
>  avformat.h |   10 ++++++++++
>  internal.h |    2 --
>  mpegts.c   |    4 ++--
>  utils.c    |    2 +-
>  4 files changed, 13 insertions(+), 5 deletions(-)
> f806d9bd0d850b061c93ff90c68e3d77f1708bd8  av_program.patch
> Index: libavformat/avformat.h
> ===================================================================
> --- libavformat/avformat.h	(revision 25124)
> +++ libavformat/avformat.h	(working copy)
> @@ -1194,6 +1194,16 @@
>  AVProgram *av_new_program(AVFormatContext *s, int id);
>  
>  /**
> + * Add a new program to a media file.
> + *
> + * @param ac media file handle
> + * @param progid the program idendifier given in the av_new_program funciton
> + * @param idx the stream index
> + */

try a spellchecker


[...]
> --- libavformat/internal.h.old	2010-09-15 16:04:13.000000000 -0700
> +++ libavformat/internal.h	2010-09-15 16:04:51.000000000 -0700
> @@ -66,6 +66,16 @@ char *ff_data_to_hex(char *buf, const ui
>  int ff_hex_to_data(uint8_t *data, const char *p);
>  
>  /**
> + * Find the program in the context for the specified stream index.
> + *
> + * @param ac the media file handle
> + * @param idx the stream index
> + * @return a pointer to the program information
> + */
> +AVProgram *ff_program_find_by_stream_index(AVFormatContext *ac,
> +                                           unsigned int idx);

can a stream be in more than one program?
(question is a bit for mans as he is the mpeg systems expert)

if not we can maybe simplify our program related apis if it can than above
is insufficicent

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100921/d8d7744a/attachment.pgp>



More information about the ffmpeg-devel mailing list