FFmpeg
packet_internal.h
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef AVCODEC_PACKET_INTERNAL_H
20 #define AVCODEC_PACKET_INTERNAL_H
21 
22 #include <stdint.h>
23 
24 #include "packet.h"
25 
26 #define AVPACKET_IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems)
27 
28 typedef struct PacketListEntry {
32 
33 typedef struct PacketList {
35 } PacketList;
36 
37 /**
38  * Append an AVPacket to the list.
39  *
40  * @param list A PacketList
41  * @param pkt The packet being appended. The data described in it will
42  * be made reference counted if it isn't already.
43  * @param copy A callback to copy the contents of the packet to the list.
44  May be null, in which case the packet's reference will be
45  moved to the list.
46  * @return 0 on success, negative AVERROR value on failure. On failure,
47  the packet and the list are unchanged.
48  */
50  int (*copy)(AVPacket *dst, const AVPacket *src),
51  int flags);
52 
53 /**
54  * Remove the oldest AVPacket in the list and return it.
55  *
56  * @note The pkt will be overwritten completely on success. The caller
57  * owns the packet and must unref it by itself.
58  *
59  * @param head A pointer to a PacketList struct
60  * @param pkt Pointer to an AVPacket struct
61  * @return 0 on success, and a packet is returned. AVERROR(EAGAIN) if
62  * the list was empty.
63  */
65 
66 /**
67  * Wipe the list and unref all the packets in it.
68  */
70 
71 int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type);
72 
73 int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp);
74 
75 #endif // AVCODEC_PACKET_INTERNAL_H
error
static void error(const char *err)
Definition: target_bsf_fuzzer.c:31
PacketList::head
PacketListEntry * head
Definition: packet_internal.h:34
PacketList
Definition: packet_internal.h:33
quality
trying all byte sequences megabyte in length and selecting the best looking sequence will yield cases to try But a word about quality
Definition: rate_distortion.txt:12
avpriv_packet_list_get
int avpriv_packet_list_get(PacketList *list, AVPacket *pkt)
Remove the oldest AVPacket in the list and return it.
Definition: avpacket.c:580
pkt
AVPacket * pkt
Definition: movenc.c:59
PacketList::tail
PacketListEntry * tail
Definition: packet_internal.h:34
list
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining list
Definition: filter_design.txt:25
PacketListEntry::next
struct PacketListEntry * next
Definition: packet_internal.h:29
copy
static void copy(const float *p1, float *p2, const int length)
Definition: vf_vaguedenoiser.c:185
PacketListEntry::pkt
AVPacket pkt
Definition: packet_internal.h:30
ff_side_data_set_prft
int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp)
Definition: avpacket.c:632
PacketListEntry
Definition: packet_internal.h:28
packet.h
ff_side_data_set_encoder_stats
int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type)
Definition: avpacket.c:607
AVPacket
This structure stores compressed data.
Definition: packet.h:499
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
avpriv_packet_list_free
void avpriv_packet_list_free(PacketList *list)
Wipe the list and unref all the packets in it.
Definition: avpacket.c:594
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:474
avpriv_packet_list_put
int avpriv_packet_list_put(PacketList *list, AVPacket *pkt, int(*copy)(AVPacket *dst, const AVPacket *src), int flags)
Append an AVPacket to the list.
Definition: avpacket.c:541