[FFmpeg-soc] [soc]: r1173 - dvbmuxer/mpeg_pes_enc.c

realsun subversion at mplayerhq.hu
Fri Aug 24 03:05:46 CEST 2007


Author: realsun
Date: Fri Aug 24 03:05:45 2007
New Revision: 1173

Log:
Cosmetics: add comments

Modified:
   dvbmuxer/mpeg_pes_enc.c

Modified: dvbmuxer/mpeg_pes_enc.c
==============================================================================
--- dvbmuxer/mpeg_pes_enc.c	(original)
+++ dvbmuxer/mpeg_pes_enc.c	Fri Aug 24 03:05:45 2007
@@ -23,6 +23,11 @@
 #include "mpeg_pes.h"
 #include "bytestream.h"
 
+/**
+ * Initialization of PES muxer.
+ * @param[in] ctx the AVFormatContext which contains streams
+ * @return  On error a negative value is returned, on success zero.
+ */
 int ff_pes_muxer_init(AVFormatContext *ctx)
 {
     AVStream *st;
@@ -75,6 +80,13 @@ static inline void insert_timestamp(uint
     bytestream_put_be16(p, (uint16_t)((((timestamp) & 0x7fff) << 1) | 1));
 }
 
+/**
+ * Get total number of frames that have been muxed.
+ * @param[in] ctx    the AVFormatContext
+ * @param[in] stream the PES stream
+ * @param[in] len    PES packet size
+ * @return  the frame number to be muxed
+ */
 int ff_get_nb_frames(AVFormatContext *ctx, PESStream *stream, int len){
     int nb_frames=0;
     PacketDesc *pkt_desc= stream->premux_packet;
@@ -89,6 +101,21 @@ int ff_get_nb_frames(AVFormatContext *ct
     return nb_frames;
 }
 
+/**
+ * Mux streams into a PES packet.
+ * @param [in]      ctx            the AVFormatContext which contains streams
+ * @param [in]      stream_index   the stream index to write
+ * @param [in]      pes_buffer     PES payload data
+ * @param [in]      pts            packet presentation timestamp
+ * @param [in]      dts            packet decoding timestamp
+ * @param [in]      id             stream ID
+ * @param [in]      start_code     PES packet start code
+ * @param [in]      header_len     PES header size
+ * @param [in]      packet_size    total packet size
+ * @param [in]      payload_size   packet payload size
+ * @param [in]      stuffing_size  packet stuffing size
+ * @return   bytes written to PES stream.
+ */
 int ff_pes_muxer_write(AVFormatContext *ctx, int stream_index, uint8_t* pes_buffer,
     int64_t pts,int64_t dts, int  id, int startcode,
     uint8_t* pes_content, int pes_content_len,
@@ -154,6 +181,12 @@ int ff_pes_muxer_write(AVFormatContext *
     return (q - pes_buffer + data_size);
 }
 
+/**
+ * Remove decoded packets of each stream.
+ * @param[in] ctx  the AVFormatContext
+ * @param[in] scr  System Clock Reference of PES stream
+ * @return  On error a negative or zero value is returned, on success 1 is returned.
+ */
 int ff_pes_remove_decoded_packets(AVFormatContext *ctx, int64_t scr)
 {
     int i;
@@ -182,7 +215,14 @@ int ff_pes_remove_decoded_packets(AVForm
     return 0;
 }
 
-
+/**
+ * Find the stream to mux into the PES stream.
+ * @param[in] ctx          the AVFormatContext
+ * @param[in] packet_size  PES stream packet size
+ * @param[in] flush        Flush after every single subtitle packet.
+ * @param[out] best_i      index of stream to be muxed
+ * @return  On error a negative or zero value is returned, on success 1 is returned.
+ */
 int ff_pes_find_beststream(AVFormatContext *ctx, int packet_size, int flush, int64_t *scr, int* best_i)
 {
     int i, avail_space;
@@ -252,6 +292,12 @@ retry:
     return 1;
 }
 
+/**
+ * Write packet into PES FIFO.
+ * @param [in] ctx  the AVFormatContext which contains streams.
+ * @param [in] pkt  the packet to write.
+ * @return  NULL
+ */
 void ff_pes_write_packet(AVFormatContext *ctx, AVPacket *pkt)
 {
     int stream_index= pkt->stream_index;
@@ -286,6 +332,11 @@ void ff_pes_write_packet(AVFormatContext
     av_fifo_write(&stream->fifo, buf, size);
 }
 
+/**
+ * Finalization of PES muxer.
+ * @param [in] ctx the AVFormatContext which contains streams.
+ * @return  NULL
+ */
 void ff_pes_muxer_end(AVFormatContext *ctx)
 {
     PESStream *stream;



More information about the FFmpeg-soc mailing list