History

avcodec: add a Producer Reference Time AVPacketSideData type

James Almer committed 7 years ago

Commit 717b2071 parent ea5a9105 files · +39 −2Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +10 −0
  3. libavcodec/avpacket.c +22 −0
  4. libavcodec/internal.h +2 −0
  5. libavcodec/version.h +2 −2
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2017-10-21 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2020-01-15 - xxxxxxxxxx - lavc 58.66.100 - avcodec.h
19+ Add AV_PKT_DATA_PRFT and AVProducerReferenceTime.
20+
1821 2019-12-27 - xxxxxxxxxx - lavu 56.38.100 - eval.h
1922 Add av_expr_count_func().
2023
libavcodec/avcodec.h+10−0
@@ -1176,6 +1176,11 @@ typedef struct AVCPBProperties { · 1175 unmodified lines
11761176 uint64_t vbv_delay;
11771177 } AVCPBProperties;
11781178
1179+typedef struct AVProducerReferenceTime {
1180+ int64_t wallclock;
1181+ int flags;
1182+} AVProducerReferenceTime;
1183+
11791184 /**
11801185 * The decoder will keep a reference to the frame and may reuse it later.
11811186 */
@@ -1410,6 +1415,11 @@ enum AVPacketSideDataType { · 228 unmodified lines
14101415 */
14111416 AV_PKT_DATA_AFD,
14121417
1418+ /**
1419+ * Producer Reference Time data corresponding to the AVProducerReferenceTime struct.
1420+ */
1421+ AV_PKT_DATA_PRFT,
1422+
14131423 /**
14141424 * The number of side data types.
14151425 * This is not part of the public API/ABI in the sense that it may
libavcodec/avpacket.c+22−0
@@ -741,3 +741,25 @@ int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, i · 740 unmodified lines
741741
742742 return 0;
743743 }
744+
745+int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp)
746+{
747+ AVProducerReferenceTime *prft;
748+ uint8_t *side_data;
749+ int side_data_size;
750+
751+ side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_PRFT, &side_data_size);
752+ if (!side_data) {
753+ side_data_size = sizeof(AVProducerReferenceTime);
754+ side_data = av_packet_new_side_data(pkt, AV_PKT_DATA_PRFT, side_data_size);
755+ }
756+
757+ if (!side_data || side_data_size < sizeof(AVProducerReferenceTime))
758+ return AVERROR(ENOMEM);
759+
760+ prft = (AVProducerReferenceTime *)side_data;
761+ prft->wallclock = timestamp;
762+ prft->flags = 0;
763+
764+ return 0;
765+}
libavcodec/internal.h+2−0
@@ -392,6 +392,8 @@ AVCPBProperties *ff_add_cpb_side_data(AVCodecContext *avctx); · 391 unmodified lines
392392
393393 int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type);
394394
395+int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp);
396+
395397 /**
396398 * Check AVFrame for A53 side data and allocate and fill SEI message with A53 info
397399 *
libavcodec/version.h+2−2
@@ -28,8 +28,8 @@ · 27 unmodified lines
2828 #include "libavutil/version.h"
2929
3030 #define LIBAVCODEC_VERSION_MAJOR 58
31−#define LIBAVCODEC_VERSION_MINOR 65
32−#define LIBAVCODEC_VERSION_MICRO 103
31+#define LIBAVCODEC_VERSION_MINOR 66
32+#define LIBAVCODEC_VERSION_MICRO 100
3333
3434 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3535 LIBAVCODEC_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t