[FFmpeg-soc] [soc]: r261 - in dvbmuxer: pes.c pes.diff pes.h
Xiaohui Sun
sunxiaohui at dsp.ac.cn
Sat Jun 23 18:30:13 CEST 2007
Baptiste Coudurier wrote:
> Hi
>
> realsun wrote:
>
>> Author: realsun
>> Date: Sat Jun 23 12:10:23 2007
>> New Revision: 261
>>
>> Log:
>> extract PES packetizer from mpeg PS muxer and this could be reused by TS muxer.
>>
>> [...]
>>
>> + } else if (st->codec->codec_id == CODEC_ID_PCM_S16BE) {
>> + stream->id = lpcm_id++;
>> + for(j = 0; j < 4; j++) {
>> + if (lpcm_freq_tab[j] == st->codec->sample_rate)
>> + break;
>> + }
>> + if (j == 4)
>> + return AVERROR(ENOMEM);
>> + if (st->codec->channels > 8)
>> + return -1;
>> + stream->lpcm_header[0] = 0x0c;
>> + stream->lpcm_header[1] = (st->codec->channels - 1) | (j << 4);
>> + stream->lpcm_header[2] = 0x80;
>> + stream->lpcm_align = st->codec->channels * 2;
>>
>
> I don't think it is PES muxer job to format PES payload. PS/TS muxer
> should feed PES muxer with formatted data.
>
How to handle that gracefully, pass another parameter representing a
predefined payload?
> Also I think startcode computation could be done by PS/TS muxer, and
> given to the PES muxer. I feel that TS or PS could use pes startcodes
> which are specific to themselves.
>
Currently it is passed in as a parameter.
> For example PCM_S16BE is used in DVD but not in TS, and TS might format
> it differently.
>
>
>> [...]
>>
>> +
>> + /* Both the MPEG-2 and the SVCD standards demand that the
>> + P-STD_buffer_size field be included in the first packet of
>> + every stream. (see SVCD standard p. 26 V.2.3.1 and V.2.3.2
>> + and MPEG-2 standard 2.7.7) */
>> + if (context->packet_number == 0)
>> + pes_flags |= 0x01;
>>
>
> That seems to be a requirement for Program Stream, but not TS (hence the
> P-), overlying muxer might be specified during init.
>
Yes, P-STD means Program Stream Target Decoder, I think maybe another
parameter should be set in PES context identifying PS/TS streams.
[...]
More information about the FFmpeg-soc
mailing list