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
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182012-12-15 - xxxxxxx - lavc 54.80.100 - avcodec.h
19 Add pkt_size field to AVFrame.
20
182012-11-25 - xxxxxxx - lavu 52.9.100 - opt.h212012-11-25 - xxxxxxx - lavu 52.9.100 - opt.h
19 Add the following convenience functions to opt.h:22 Add the following convenience functions to opt.h:
20 av_opt_get_image_size23 av_opt_get_image_size
libavcodec/avcodec.h+12−0
@@ -1467,6 +1467,16 @@ typedef struct AVFrame { · 1466 unmodified lines
1467 * - decoding: Read by user.1467 * - decoding: Read by user.
1468 */1468 */
1469 int64_t channels;1469 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;
1470} AVFrame;1480} AVFrame;
1471 1481
1472/**1482/**
@@ -1490,6 +1500,8 @@ AVDictionary *av_frame_get_metadata (const AVFrame *frame); · 17 unmodified lines
1490void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);1500void av_frame_set_metadata (AVFrame *frame, AVDictionary *val);
1491int av_frame_get_decode_error_flags (const AVFrame *frame);1501int av_frame_get_decode_error_flags (const AVFrame *frame);
1492void av_frame_set_decode_error_flags (AVFrame *frame, int val);1502void av_frame_set_decode_error_flags (AVFrame *frame, int val);
1503int av_frame_get_pkt_size(const AVFrame *frame);
1504void av_frame_set_pkt_size(AVFrame *frame, int val);
1493 1505
1494struct AVCodecInternal;1506struct AVCodecInternal;
1495 1507
libavcodec/options.c+1−0
@@ -248,6 +248,7 @@ const AVClass *avcodec_get_class(void) · 247 unmodified lines
248static const AVOption frame_options[]={248static const AVOption frame_options[]={
249{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},249{"best_effort_timestamp", "", FOFFSET(best_effort_timestamp), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, 0},
250{"pkt_pos", "", FOFFSET(pkt_pos), AV_OPT_TYPE_INT64, {.i64 = -1 }, INT64_MIN, INT64_MAX, 0},250{"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},
251{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},252{"sample_aspect_ratio", "", FOFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0},
252{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},253{"width", "", FOFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},
253{"height", "", FOFFSET(height), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, 0},254{"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
512 frame->pkt_pts = s->pkt->pts;512 frame->pkt_pts = s->pkt->pts;
513 frame->pkt_pos = s->pkt->pos;513 frame->pkt_pos = s->pkt->pos;
514 frame->pkt_duration = s->pkt->duration;514 frame->pkt_duration = s->pkt->duration;
515 frame->pkt_size = s->pkt->size;
515 } else {516 } else {
516 frame->pkt_pts = AV_NOPTS_VALUE;517 frame->pkt_pts = AV_NOPTS_VALUE;
517 frame->pkt_pos = -1;518 frame->pkt_pos = -1;
518 frame->pkt_duration = 0;519 frame->pkt_duration = 0;
520 frame->pkt_size = -1;
519 }521 }
520 frame->reordered_opaque = s->reordered_opaque;522 frame->reordered_opaque = s->reordered_opaque;
521 523
@@ -677,6 +679,7 @@ void avcodec_get_frame_defaults(AVFrame *frame) · 155 unmodified lines
677 frame->best_effort_timestamp = AV_NOPTS_VALUE;679 frame->best_effort_timestamp = AV_NOPTS_VALUE;
678 frame->pkt_duration = 0;680 frame->pkt_duration = 0;
679 frame->pkt_pos = -1;681 frame->pkt_pos = -1;
682 frame->pkt_size = -1;
680 frame->key_frame = 1;683 frame->key_frame = 1;
681 frame->sample_aspect_ratio = (AVRational) {0, 1 };684 frame->sample_aspect_ratio = (AVRational) {0, 1 };
682 frame->format = -1; /* unknown */685 frame->format = -1; /* unknown */
@@ -723,6 +726,7 @@ MAKE_ACCESSORS(AVFrame, frame, int, channels) · 40 unmodified lines
723MAKE_ACCESSORS(AVFrame, frame, int, sample_rate)726MAKE_ACCESSORS(AVFrame, frame, int, sample_rate)
724MAKE_ACCESSORS(AVFrame, frame, AVDictionary *, metadata)727MAKE_ACCESSORS(AVFrame, frame, AVDictionary *, metadata)
725MAKE_ACCESSORS(AVFrame, frame, int, decode_error_flags)728MAKE_ACCESSORS(AVFrame, frame, int, decode_error_flags)
729MAKE_ACCESSORS(AVFrame, frame, int, pkt_size)
726 730
727MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)731MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
728MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor)732MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, codec_descriptor)
libavcodec/version.h+2−2
@@ -29,8 +29,8 @@ · 28 unmodified lines
29#include "libavutil/avutil.h"29#include "libavutil/avutil.h"
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5431#define LIBAVCODEC_VERSION_MAJOR 54
32#define LIBAVCODEC_VERSION_MINOR 7932#define LIBAVCODEC_VERSION_MINOR 80
33#define LIBAVCODEC_VERSION_MICRO 10233#define LIBAVCODEC_VERSION_MICRO 100
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36 LIBAVCODEC_VERSION_MINOR, \36 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