[FFmpeg-devel] [PATCH]pes packetizer
realsun
sunxiaohui
Tue Jun 26 14:09:53 CEST 2007
Michael Niedermayer wrote:
> Hi
>
> On Sat, Jun 23, 2007 at 06:11:29PM +0800, realsun wrote:
>
>> Hi,
>> This is the PES packetizer code and I have made MPEG PS encoder to use
>> this packetizer and I hope this could be reused by TS muxer.
>>
>
> please diff files against their proper parent file
>
>
How to diff that, I use "svn diff --new pes.c --old
svn://svn.mplayerhq.hu/ffmpeg/trunk/libavformat/mpegenc.c" and it does
not work.
> following review of pes.c is based on a diff of it against mpegenc.c
> ive also edited the diff to place related functions adjacent to each
> other
>
>
>
>> --- /home/michael/orgmpegmux/mpegenc.c 2007-06-23 23:24:43.000000000 +0200
>> +++ pes.c 2007-06-23 23:24:51.000000000 +0200
>> @@ -1,6 +1,6 @@
>> /*
>> - * MPEG1/2 muxer
>> - * Copyright (c) 2000, 2001, 2002 Fabrice Bellard.
>> + * PES muxer.
>> + * Copyright (c) 2007 Xiaohui Sun <sunxiaohui at dsp.ac.cn>
>> *
>>
>
> this is not correct, you are not the only author of this code
>
>
I will modify that.
> [...]
>
>
>> +/*
>> + * Put timestamp into packet
>> + * @param[in] p the stream to write
>> + * @param[in] id stream id
>> + * @param[in] timestamp the timestamp to put in
>> + * @return NULL
>> + */
>> +static inline void put_timestamp(uint8_t* p, int id, int64_t timestamp)
>> +{
>> + bytestream_put_byte(&p,
>> + (id << 4) |
>> + (((timestamp >> 30) & 0x07) << 1) |
>> + 1);
>> + bytestream_put_be16(&p, (uint16_t)((((timestamp >> 15) & 0x7fff) << 1) | 1));
>> + bytestream_put_be16(&p, (uint16_t)((((timestamp) & 0x7fff) << 1) | 1));
>> }
>>
>
>
>> -static inline void put_timestamp(ByteIOContext *pb, int id, int64_t timestamp)
>> -{
>> - put_byte(pb,
>> - (id << 4) |
>> - (((timestamp >> 30) & 0x07) << 1) |
>> - 1);
>> - put_be16(pb, (uint16_t)((((timestamp >> 15) & 0x7fff) << 1) | 1));
>> - put_be16(pb, (uint16_t)((((timestamp) & 0x7fff) << 1) | 1));
>>
>
> a change from ByteIOContext to uint8_t* belongs into a seperate patch
> the addition of doxygen comments also belongs into a seperate patch
> and so does the splitig out of functions from mpegenc.c
>
>
I made that change since I need to operate that buffer later in TS
muxer. I will use different pathes.
[...]
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list