On 01/09/14 12:47, Diego Biurrun wrote:
> On Sun, Aug 31, 2014 at 09:24:28PM +0200, Luca Barbato wrote:
>> --- a/libavcodec/avpacket.c
>> +++ b/libavcodec/avpacket.c
>> @@ -393,3 +394,58 @@ void av_packet_rescale_ts(AVPacket *pkt, AVRational 
>> src_tb, AVRational dst_tb)
>> +
>> +int ff_packet_list_put(AVPacketList **head, AVPacketList **tail,
>> +                       AVPacket *pkt)
>> +{
>> +    AVPacketList *pl = av_mallocz(sizeof(AVPacketList));
>> +    int ret;
> 
> Doesn't this warn because of mixed declarations and statements?
> I suggest swapping the lines.
> 
>> --- a/libavcodec/internal.h
>> +++ b/libavcodec/internal.h
>> @@ -200,4 +200,40 @@ int ff_get_format(AVCodecContext *avctx, const enum 
>> AVPixelFormat *fmt);
>>  
>> +/*
>> + * Append an AVPacket to the list creating a new reference
>> + * to it.
>> + *
>> + * @param head List head
>> + * @param tail List tail
>> + * @param pkt  The packet being appended
>> + * @return < 0 on failure and 0 on success.
>> + */
>> +int ff_packet_list_put(AVPacketList **head, AVPacketList **tail,
>> +                       AVPacket *pkt);
>> +
>> +/**
>> + * Remove the oldest AVPacket in the list and return it.
>> + *
>> + * @note The pkt will be overwritten completely. The caller
>> + *       owns the packet and must unref it by itself.
>> + *
>> + * @see av_packet_unref av_packet_ref
>> + *
>> + * @param head List head.
>> + * @param tail List tail.
>> + * @param pkt  Pointer to an initialized AVPacket struct
>> + * @return < 0 on failure and 0 on success.
>> + */
>> +int ff_packet_list_get(AVPacketList **head, AVPacketList **tail,
>> +                       AVPacket *pkt);
>> +
>> +/**
>> + * Wipe the list and unref all the packets in it.
>> + *
>> + * @param head List head.
>> + * @param tail List tail.
>> + */
>> +void ff_packet_list_free(AVPacketList **head, AVPacketList **tail);
> 
> Speaking of "the list" in all these descriptions is confusing, the reader
> does not yet know the signature of the function.  "A list of AVPackets"
> or similar would be less confusing.
> 
> Drop the periods from parameter descriptions that are not sentences, you
> only have periods on some of them anyway.
> 
>> --- a/libavformat/avformat.h
>> +++ b/libavformat/avformat.h
>> @@ -1254,12 +1254,6 @@ typedef struct AVFormatContext {
>>  
>> -typedef struct AVPacketList {
>> -    AVPacket pkt;
>> -    struct AVPacketList *next;
>> -} AVPacketList;
> 
> API change - where is the version and deprecation dance?

In the previous set I guess, those patches are extracted to have some
working code so the hwaccel1.3 stuff could be tried.

Once there is agreement on this step towards hwaccel 1.3 either I'll
prepare the set with all the docs or just go a step further and provide
the implementation of the generic api for hwaccel2 and avoid adding too
many init/close functions.

(help in extending the previous generation hwaccel to use them would be
welcome).

lu
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to