Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-04-29 13:10:17 +0400
committerNicolas George <nicolas.george@normalesup.org>2012-05-03 20:47:16 +0400
commite296f1b1c4f0b8d4d33f83036a80fd602aca7dea (patch)
tree3ea33fc4d2cc8b9bf5e2663f0b3fd56669ba7c4a /libavcodec/avcodec.h
parentc1fe2db3769d1a9e2e8d3ea718e4306648bafede (diff)
lavc: implement accessors for some AVFrame fields.
Compared to av_opt_ptr, accessors bring: - better performance (negligible); - compile-time type check; - link-time existence check (or at worst, a dynamic linker error instead of a NULL dereference).
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r--libavcodec/avcodec.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b2279ea9ef..2e56a021db 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1244,7 +1244,7 @@ typedef struct AVFrame {
/**
* frame timestamp estimated using various heuristics, in stream time base
* Code outside libavcodec should access this field using:
- * av_opt_ptr(avcodec_get_frame_class(), frame, "best_effort_timestamp");
+ * av_frame_get_best_effort_timestamp(frame)
* - encoding: unused
* - decoding: set by libavcodec, read by user.
*/
@@ -1253,7 +1253,7 @@ typedef struct AVFrame {
/**
* reordered pos from the last AVPacket that has been input into the decoder
* Code outside libavcodec should access this field using:
- * av_opt_ptr(avcodec_get_frame_class(), frame, "pkt_pos");
+ * av_frame_get_pkt_pos(frame)
* - encoding: unused
* - decoding: Read by user.
*/
@@ -1264,7 +1264,7 @@ typedef struct AVFrame {
* - encoding: unused
* - decoding: read by user.
* Code outside libavcodec should access this field using:
- * av_opt_ptr(avcodec_get_frame_class(), frame, "channel_layout")
+ * av_frame_get_channel_layout(frame)
*/
int64_t channel_layout;
@@ -1273,12 +1273,26 @@ typedef struct AVFrame {
* - encoding: unused
* - decoding: read by user.
* Code outside libavcodec should access this field using:
- * av_opt_ptr(avcodec_get_frame_class(), frame, "sample_rate")
+ * av_frame_get_channel_layout(frame)
*/
int sample_rate;
} AVFrame;
+/**
+ * Accessors for some AVFrame fields.
+ * The position of these field in the structure is not part of the ABI,
+ * they should not be accessed directly outside libavcodec.
+ */
+int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
+int64_t av_frame_get_pkt_pos (const AVFrame *frame);
+int64_t av_frame_get_channel_layout (const AVFrame *frame);
+int av_frame_get_sample_rate (const AVFrame *frame);
+void av_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
+void av_frame_set_pkt_pos (AVFrame *frame, int64_t val);
+void av_frame_set_channel_layout (AVFrame *frame, int64_t val);
+void av_frame_set_sample_rate (AVFrame *frame, int val);
+
struct AVCodecInternal;
enum AVFieldOrder {