[FFmpeg-devel] Google Summer of Code participation

Stefano Sabatini stefano.sabatini-lala
Tue Apr 7 01:01:37 CEST 2009


On Monday 2009-04-06 17:46:37 +0200, Thilo Borgmann wrote:
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index e35e819..031821c 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -22,6 +22,7 @@ OBJS = allcodecs.o                                                      \
>         resample2.o                                                      \
>         simple_idct.o                                                    \
>         utils.o                                                          \
> +       avpacket.o                                                       \

Non in alphabetical order.
  
>  # parts needed for many different codecs
>  OBJS-$(CONFIG_AANDCT)                  += aandcttab.o
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 1414c94..1e569b1 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2629,6 +2629,49 @@ typedef struct AVSubtitle {
>      AVSubtitleRect **rects;
>  } AVSubtitle;
>  
> +/* packet functions */
> +
> +void av_destruct_packet_nofree(AVPacket *pkt);
> +
> +/**
> + * Default packet destructor.
> + */
> +void av_destruct_packet(AVPacket *pkt);
> +
> +/**
> + * Initialize optional fields of a packet with default values.
> + *
> + * @param pkt packet
> + */
> +void av_init_packet(AVPacket *pkt);
> +
> +/**
> + * Allocate the payload of a packet and initialize its fields with
> + * default values.
> + *
> + * @param pkt packet
> + * @param size wanted payload size
> + * @return 0 if OK, AVERROR_xxx otherwise
> + */
> +int av_new_packet(AVPacket *pkt, int size);
> +
> +/**
> + * @warning This is a hack - the packet memory allocation stuff is broken. The
> + * packet is allocated if it was not really allocated.
> + */
> +int av_dup_packet(AVPacket *pkt);
> +
> +/**
> + * Free a packet.
> + *
> + * @param pkt packet to free
> + */
> +static inline void av_free_packet(AVPacket *pkt)
> +{
> +    if (pkt && pkt->destruct) {
> +        pkt->destruct(pkt);
> +    }
> +}
>  
>  /* resample.c */
>  
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index e69de29..8d9332b 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c

I think here Michael means something like this, I don't use git so I
don't know which are the corresponding commands, so I'll use the svn
commands.

svn cp libavformat/utils.c libavcodec/avpacket.c

Then you edit libavcodec/avpacket.c so that it will contain *only* the
relevant functions. When copying the file the history for the file will
be inherited by the new file.

Finally you can do:
svn diff libavformat/utils.c libavformat/avformat.h libavcodec/avcodec.h libavcodec/avpacket.c

to get the complete patch.

[...]

Regards.
-- 
FFmpeg = Faithful Fundamental Mastering Patchable Epic God



More information about the ffmpeg-devel mailing list