[FFmpeg-devel] [PATCH]Basic XSUB encoder (take 5)
Michael Niedermayer
michaelni
Thu Jun 18 15:52:41 CEST 2009
On Sat, May 23, 2009 at 11:03:31PM +0200, Reimar D?ffinger wrote:
> On Sat, May 23, 2009 at 06:54:55PM +0200, Diego Biurrun wrote:
> > On Sat, May 23, 2009 at 05:22:44PM +0200, Reimar D?ffinger wrote:
> > >
> > > Haven't done anything on the muxer code part, but I fixed the trivial
> > > stuff pointed out here and one or two more simplifications and updated
> > > to SVN.
> >
> > > --- libavcodec/xsubenc.c (revision 0)
> > > +++ libavcodec/xsubenc.c (revision 0)
> > > @@ -0,0 +1,224 @@
> > > + if (xsub_encode_rle(&pb,
> > > + h->rects[0]->pict.data[0],
> > > + h->rects[0]->pict.linesize[0]*2,
> > > + h->rects[0]->w, (h->rects[0]->h + 1) >> 1))
> > > +
> > > + if (xsub_encode_rle(&pb,
> > > + h->rects[0]->pict.data[0] + h->rects[0]->pict.linesize[0],
> > > + h->rects[0]->pict.linesize[0]*2,
> > > + h->rects[0]->w, h->rects[0]->h >> 1))
> >
> > This looks weirdly indented.
> >
> > > --- libavformat/avienc.c (revision 18911)
> > > +++ libavformat/avienc.c (working copy)
> > > @@ -212,8 +215,10 @@
> > > - if(stream->codec_type == CODEC_TYPE_VIDEO)
> > > + if(stream->codec_type == CODEC_TYPE_VIDEO
> > > + || stream->codec_type == CODEC_TYPE_SUBTITLE)
> >
> > If you keep the || on the first line, you can align this nicely.
>
> Both changed, avi muxer and pts handling parts unchanged (those are
> hopefully the only parts that need to be changed still).
[...]
> Index: ffmpeg.c
> ===================================================================
> --- ffmpeg.c (revision 18911)
> +++ ffmpeg.c (working copy)
> @@ -818,6 +818,7 @@
> nb = 1;
>
> for(i = 0; i < nb; i++) {
> + sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);
> subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
> subtitle_out_max_size, sub);
>
[...]
> Index: libavcodec/avcodec.h
> ===================================================================
> --- libavcodec/avcodec.h (revision 18915)
> +++ libavcodec/avcodec.h (working copy)
> @@ -30,7 +30,7 @@
> #include "libavutil/avutil.h"
>
> #define LIBAVCODEC_VERSION_MAJOR 52
> -#define LIBAVCODEC_VERSION_MINOR 29
> +#define LIBAVCODEC_VERSION_MINOR 30
> #define LIBAVCODEC_VERSION_MICRO 0
>
> #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> @@ -2721,6 +2721,7 @@
> uint32_t end_display_time; /* relative to packet pts, in ms */
> unsigned num_rects;
> AVSubtitleRect **rects;
> + int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
> } AVSubtitle;
>
> /* packet functions */
these are ok as seperate commit
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090618/f455d8ad/attachment.pgp>
More information about the ffmpeg-devel
mailing list