History

lavc: add pkt_size field to AVFrame

Stefano Sabatini committed 13 years ago

Commit 96d815f1 parent a8b3f0c5 files · +22 −2Browse files

Unified · Split

5 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +12 −0
  3. libavcodec/options.c +1 −0
  4. libavcodec/utils.c +4 −0
  5. libavcodec/version.h +2 −2
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2012-10-22 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2012-12-15 - xxxxxxx - lavc 54.80.100 - avcodec.h
19+ Add pkt_size field to AVFrame.
20+
1821 2012-11-25 - xxxxxxx - lavu 52.9.100 - opt.h
1922 Add the following convenience functions to opt.h:
2023 av_opt_get_image_size
libavcodec/avcodec.h+12−0
@@ -1467,6 +1467,16 @@ typedef struct AVFrame { · 1466 unmodified lines
14671467 * - decoding: Read by user.
14681468 */
14691469 int64_t channels;
1470+
1471+ /**
1472+ * size of the corresponding packet containing the compressed
1473+ * frame. It must be accessed using av_frame_get_pkt_size() and
1474+ * av_frame_set_pkt_size().
1475+ * It is set to a negative value if unknown.
1476+ * - encoding: unused
1477+ * - decoding: set by libavcodec, read by user.
1478+ */
1479+ int pkt_size;
14701480 } AVFrame;
14711481
14721482 /**
@@ -1490,6 +1500,8 @@ AVDictionary *av_frame_get_metadata (const AVFrame *frame); · 17 unmodified lines
14901500 void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);
14911501 int av_frame_get_decode_error_flags (const AVFrame *frame);
14921502 void av_frame_set_decode_error_flags (AVFrame *frame, int val);
1503+int av_frame_get_pkt_size(const AVFrame *frame);
1504+void av_frame_set_pkt_size(AVFrame *frame, int val);
14931505
14941506 struct AVCodecInternal;
14951507
libavcodec/options.c+1−0
@@ -248,6 +248,7 @@ const AVClass *avcodec_get_class(void) · 247 unmodified lines
248248 static const AVOption frame_options[]={
249249 {"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},
250250 {"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},
251+{"pkt_size", "", FOFFSET(pkt_size), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},
251252 {"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
252253 {"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
253254 {"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
libavcodec/utils.c+4−0
@@ -512,10 +512,12 @@ void ff_init_buffer_info(AVCodecContext *s, AVFrame *frame) · 511 unmodified lines
512512 frame->pkt_pts = s->pkt->pts;
513513 frame->pkt_pos = s->pkt->pos;
514514 frame->pkt_duration = s->pkt->duration;
515+ frame->pkt_size = s->pkt->size;
515516 } else {
516517 frame->pkt_pts = AV_NOPTS_VALUE;
517518 frame->pkt_pos = -1;
518519 frame->pkt_duration = 0;
520+ frame->pkt_size = -1;
519521 }
520522 frame->reordered_opaque = s->reordered_opaque;
521523
@@ -677,6 +679,7 @@ void avcodec_get_frame_defaults(AVFrame *frame) · 155 unmodified lines
677679 frame->best_effort_timestamp = AV_NOPTS_VALUE;
678680 frame->pkt_duration = 0;
679681 frame->pkt_pos = -1;
682+ frame->pkt_size = -1;
680683 frame->key_frame = 1;
681684 frame->sample_aspect_ratio = (AVRational) {0, 1 };
682685 frame->format = -1; /* unknown */
@@ -723,6 +726,7 @@ MAKE_ACCESSORS(AVFrame, frame, int, channels) · 40 unmodified lines
723726 MAKE_ACCESSORS(AVFrame, frame, int, sample_rate)
724727 MAKE_ACCESSORS(AVFrame, frame, AVDictionary *, metadata)
725728 MAKE_ACCESSORS(AVFrame, frame, int, decode_error_flags)
729+MAKE_ACCESSORS(AVFrame, frame, int, pkt_size)
726730
727731 MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
728732 MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor)
libavcodec/version.h+2−2
@@ -29,8 +29,8 @@ · 28 unmodified lines
2929 #include "libavutil/avutil.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 54
32−#define LIBAVCODEC_VERSION_MINOR 79
33−#define LIBAVCODEC_VERSION_MICRO 102
32+#define LIBAVCODEC_VERSION_MINOR 80
33+#define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
3636 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