summaryrefslogtreecommitdiff
path: root/libavformat/avformat.h
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2011-06-30 19:45:22 +0200
committerNicolas George <nicolas.george@normalesup.org>2011-07-01 09:49:27 +0200
commitb442ca69d9d3cc50f00b43a25b200631cfb1e9ec (patch)
tree1d8afaadda50785a4580a35678892f6c28a20b9f /libavformat/avformat.h
parentd1b029dec97cd740943eb0222a519a571e3349c5 (diff)
lavf: add an API to get output timestamps.
Diffstat (limited to 'libavformat/avformat.h')
-rw-r--r--libavformat/avformat.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 1734649a95..6069f19950 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -316,6 +316,9 @@ typedef struct AVOutputFormat {
const AVClass *priv_class; ///< AVClass for the private context
+ void (*get_output_timestamp)(struct AVFormatContext *s, int stream,
+ int64_t *dts, int64_t *wall);
+
/* private fields */
struct AVOutputFormat *next;
} AVOutputFormat;
@@ -1518,6 +1521,24 @@ int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
*/
int av_write_trailer(AVFormatContext *s);
+/**
+ * Get timing information for the data currently output.
+ * The exact meaning of "currently output" depends on the format.
+ * It is mostly relevant for devices that have an internal buffer and/or
+ * work in real time.
+ * @param s media file handle
+ * @param stream stream in the media file
+ * @param dts[out] DTS of the last packet output for the stream, in stream
+ * time_base units
+ * @param wall[out] absolute time when that packet whas output,
+ * in microsecond
+ * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it
+ * Note: some formats or devices may not allow to measure dts and wall
+ * atomically.
+ */
+int av_get_output_timestamp(struct AVFormatContext *s, int stream,
+ int64_t *dts, int64_t *wall);
+
#if FF_API_DUMP_FORMAT
/**
* @deprecated Deprecated in favor of av_dump_format().