History

lavu/avframe: add a time_base field

This adds a time_base field to AVFrame, as an analogue to the AVPacket.time_base field.

Lynne committed 4 years ago

Commit b236ef01 parent 03ab1de4 files · +14 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/frame.c +2 −0
  3. libavutil/frame.h +8 −0
  4. libavutil/version.h +1 −1
doc/APIchanges+3−0
@@ -14,6 +14,9 @@ libavutil: 2021-04-27 · 13 unmodified lines
1414
1515 API changes, most recent first:
1616
17+2021-12-03 - xxxxxxxxxx - lavu 57.10.100 - frame.h
18+ Add AVFrame.time_base
19+
1720 2021-11-22 - xxxxxxxxxx - lavu 57.9.100 - pixfmt.h
1821 Add AV_PIX_FMT_P210, AV_PIX_FMT_P410, AV_PIX_FMT_P216, and AV_PIX_FMT_P416.
1922
libavutil/frame.c+2−0
@@ -63,6 +63,7 @@ static void get_frame_defaults(AVFrame *frame) · 62 unmodified lines
6363 frame->pkt_duration = 0;
6464 frame->pkt_pos = -1;
6565 frame->pkt_size = -1;
66+ frame->time_base = (AVRational){ 0, 1 };
6667 frame->key_frame = 1;
6768 frame->sample_aspect_ratio = (AVRational){ 0, 1 };
6869 frame->format = -1; /* unknown */
@@ -278,6 +279,7 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) · 209 unmodified lines
278279 dst->pkt_pos = src->pkt_pos;
279280 dst->pkt_size = src->pkt_size;
280281 dst->pkt_duration = src->pkt_duration;
282+ dst->time_base = src->time_base;
281283 dst->reordered_opaque = src->reordered_opaque;
282284 dst->quality = src->quality;
283285 dst->best_effort_timestamp = src->best_effort_timestamp;
libavutil/frame.h+8−0
@@ -421,6 +421,14 @@ typedef struct AVFrame { · 420 unmodified lines
421421 */
422422 int64_t pkt_dts;
423423
424+ /**
425+ * Time base for the timestamps in this frame.
426+ * In the future, this field may be set on frames output by decoders or
427+ * filters, but its value will be by default ignored on input to encoders
428+ * or filters.
429+ */
430+ AVRational time_base;
431+
424432 /**
425433 * picture number in bitstream order
426434 */
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 */
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 57
82−#define LIBAVUTIL_VERSION_MINOR 9
82+#define LIBAVUTIL_VERSION_MINOR 10
8383 #define LIBAVUTIL_VERSION_MICRO 101
8484
8585 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

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