@@ -28,6 +28,7 @@
#include <stdint.h>
#include <stdlib.h>
+#include "libavutil/rational.h"
/**
* @ingroup lavc_decoding
@@ -131,6 +132,17 @@ typedef struct AVBarData {
} AVBarData;
/**
+ * Original Transport Timestamp. Provides the original timestamp
+ * of the packet as specified by the libavformat source This allows that
+ * data to be used in calculations even if the clocks have been
+ * rebased or otherwise modified.
+ */
+typedef struct AVTransportTimestamp {
+ int64_t pts;
+ AVRational time_base;
+} AVTransportTimestamp;
+
+/**
* This structure describes the bitrate properties of an encoded bitstream. It
* roughly corresponds to a subset the VBV parameters for MPEG-2 or HRD
* parameters for H.264/HEVC.
@@ -306,6 +306,17 @@ enum AVPacketSideDataType {
AV_PKT_DATA_BARDATA,
/**
+ * Provides the original PTS when passed through the demux. This can
+ * be used to offset any subsequent changes made by the caller to
+ * adjust PTS values (such as pts_offset). We need this for SCTE-35,
+ * since by the time the packets reach the output the PTS values have
+ * already been re-written, and we cannot calculate pre-roll values
+ * using the PTS values embedded in the packet content
+ * Format for this data can be found in AVTransportTimestamp struct
+ */
+ AV_PKT_DATA_TRANSPORT_TIMESTAMP,
+
+ /**
* The number of side data types.
* This is not part of the public API/ABI in the sense that it may
* change when new side data types are added.
In order to properly process SCTE-35 packets, we need the original PTS value from the demux (i.e. not mangled by the application or reclocked for the output). This allows us to set the pts_adjustment field in an BSF on the output side. Introduce a new side data type to store the original PTS. Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com> --- libavcodec/defs.h | 12 ++++++++++++ libavcodec/packet.h | 11 +++++++++++ 2 files changed, 23 insertions(+)