Patch by Jean-Daniel Dupas, devlists shadowlab org
Originally committed as revision 22744 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -563,7 +563,7 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, AVCodecContext *avctx |
| 563 | 563 |
int a= av_bitstream_filter_filter(bsfc, avctx, NULL, |
| 564 | 564 |
&new_pkt.data, &new_pkt.size, |
| 565 | 565 |
pkt->data, pkt->size, |
| 566 |
- pkt->flags & PKT_FLAG_KEY); |
|
| 566 |
+ pkt->flags & AV_PKT_FLAG_KEY); |
|
| 567 | 567 |
if(a>0){
|
| 568 | 568 |
av_free_packet(pkt); |
| 569 | 569 |
new_pkt.destruct= av_destruct_packet; |
| ... | ... |
@@ -768,7 +768,7 @@ need_realloc: |
| 768 | 768 |
pkt.size= ret; |
| 769 | 769 |
if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE) |
| 770 | 770 |
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base); |
| 771 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 771 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 772 | 772 |
write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]); |
| 773 | 773 |
|
| 774 | 774 |
ost->sync_opts += enc->frame_size; |
| ... | ... |
@@ -803,7 +803,7 @@ need_realloc: |
| 803 | 803 |
pkt.size= ret; |
| 804 | 804 |
if(enc->coded_frame && enc->coded_frame->pts != AV_NOPTS_VALUE) |
| 805 | 805 |
pkt.pts= av_rescale_q(enc->coded_frame->pts, enc->time_base, ost->st->time_base); |
| 806 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 806 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 807 | 807 |
write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]); |
| 808 | 808 |
} |
| 809 | 809 |
} |
| ... | ... |
@@ -1077,7 +1077,7 @@ static void do_video_out(AVFormatContext *s, |
| 1077 | 1077 |
pkt.data= (uint8_t *)final_picture; |
| 1078 | 1078 |
pkt.size= sizeof(AVPicture); |
| 1079 | 1079 |
pkt.pts= av_rescale_q(ost->sync_opts, enc->time_base, ost->st->time_base); |
| 1080 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 1080 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 1081 | 1081 |
|
| 1082 | 1082 |
write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]); |
| 1083 | 1083 |
enc->coded_frame = old_frame; |
| ... | ... |
@@ -1125,7 +1125,7 @@ static void do_video_out(AVFormatContext *s, |
| 1125 | 1125 |
pkt.dts != AV_NOPTS_VALUE ? av_rescale(pkt.dts, enc->time_base.den, AV_TIME_BASE*(int64_t)enc->time_base.num) : -1);*/ |
| 1126 | 1126 |
|
| 1127 | 1127 |
if(enc->coded_frame->key_frame) |
| 1128 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 1128 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 1129 | 1129 |
write_frame(s, &pkt, ost->st->codec, bitstream_filters[ost->file_index][pkt.stream_index]); |
| 1130 | 1130 |
*frame_size = ret; |
| 1131 | 1131 |
video_size += ret; |
| ... | ... |
@@ -1507,7 +1507,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
| 1507 | 1507 |
|
| 1508 | 1508 |
av_init_packet(&opkt); |
| 1509 | 1509 |
|
| 1510 |
- if ((!ost->frame_number && !(pkt->flags & PKT_FLAG_KEY)) && !copy_initial_nonkeyframes) |
|
| 1510 |
+ if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) && !copy_initial_nonkeyframes) |
|
| 1511 | 1511 |
continue; |
| 1512 | 1512 |
|
| 1513 | 1513 |
/* no reencoding needed : output the packet directly */ |
| ... | ... |
@@ -1515,7 +1515,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
| 1515 | 1515 |
|
| 1516 | 1516 |
avcodec_get_frame_defaults(&avframe); |
| 1517 | 1517 |
ost->st->codec->coded_frame= &avframe; |
| 1518 |
- avframe.key_frame = pkt->flags & PKT_FLAG_KEY; |
|
| 1518 |
+ avframe.key_frame = pkt->flags & AV_PKT_FLAG_KEY; |
|
| 1519 | 1519 |
|
| 1520 | 1520 |
if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) |
| 1521 | 1521 |
audio_size += data_size; |
| ... | ... |
@@ -1544,7 +1544,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
| 1544 | 1544 |
&& ost->st->codec->codec_id != CODEC_ID_MPEG1VIDEO |
| 1545 | 1545 |
&& ost->st->codec->codec_id != CODEC_ID_MPEG2VIDEO |
| 1546 | 1546 |
) {
|
| 1547 |
- if(av_parser_change(ist->st->parser, ost->st->codec, &opkt.data, &opkt.size, data_buf, data_size, pkt->flags & PKT_FLAG_KEY)) |
|
| 1547 |
+ if(av_parser_change(ist->st->parser, ost->st->codec, &opkt.data, &opkt.size, data_buf, data_size, pkt->flags & AV_PKT_FLAG_KEY)) |
|
| 1548 | 1548 |
opkt.destruct= av_destruct_packet; |
| 1549 | 1549 |
} else {
|
| 1550 | 1550 |
opkt.data = data_buf; |
| ... | ... |
@@ -1627,7 +1627,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
| 1627 | 1627 |
av_exit(1); |
| 1628 | 1628 |
} |
| 1629 | 1629 |
audio_size += ret; |
| 1630 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 1630 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 1631 | 1631 |
break; |
| 1632 | 1632 |
case AVMEDIA_TYPE_VIDEO: |
| 1633 | 1633 |
ret = avcodec_encode_video(enc, bit_buffer, bit_buffer_size, NULL); |
| ... | ... |
@@ -1637,7 +1637,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
| 1637 | 1637 |
} |
| 1638 | 1638 |
video_size += ret; |
| 1639 | 1639 |
if(enc->coded_frame && enc->coded_frame->key_frame) |
| 1640 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 1640 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 1641 | 1641 |
if (ost->logfile && enc->stats_out) {
|
| 1642 | 1642 |
fprintf(ost->logfile, "%s", enc->stats_out); |
| 1643 | 1643 |
} |
| ... | ... |
@@ -2199,7 +2199,7 @@ static int http_prepare_data(HTTPContext *c) |
| 2199 | 2199 |
c->switch_pending = 0; |
| 2200 | 2200 |
for(i=0;i<c->stream->nb_streams;i++) {
|
| 2201 | 2201 |
if (c->switch_feed_streams[i] == pkt.stream_index) |
| 2202 |
- if (pkt.flags & PKT_FLAG_KEY) |
|
| 2202 |
+ if (pkt.flags & AV_PKT_FLAG_KEY) |
|
| 2203 | 2203 |
do_switch_stream(c, i); |
| 2204 | 2204 |
if (c->switch_feed_streams[i] >= 0) |
| 2205 | 2205 |
c->switch_pending = 1; |
| ... | ... |
@@ -2209,7 +2209,7 @@ static int http_prepare_data(HTTPContext *c) |
| 2209 | 2209 |
if (c->feed_streams[i] == pkt.stream_index) {
|
| 2210 | 2210 |
AVStream *st = c->fmt_in->streams[source_index]; |
| 2211 | 2211 |
pkt.stream_index = i; |
| 2212 |
- if (pkt.flags & PKT_FLAG_KEY && |
|
| 2212 |
+ if (pkt.flags & AV_PKT_FLAG_KEY && |
|
| 2213 | 2213 |
(st->codec->codec_type == AVMEDIA_TYPE_VIDEO || |
| 2214 | 2214 |
c->stream->nb_streams == 1)) |
| 2215 | 2215 |
c->got_key_frame = 1; |
| ... | ... |
@@ -3445,7 +3445,7 @@ attribute_deprecated int avcodec_decode_video(AVCodecContext *avctx, AVFrame *pi |
| 3445 | 3445 |
* @param[in] avpkt The input AVpacket containing the input buffer. |
| 3446 | 3446 |
* You can create such packet with av_init_packet() and by then setting |
| 3447 | 3447 |
* data and size, some decoders might in addition need other fields like |
| 3448 |
- * flags&PKT_FLAG_KEY. All decoders are designed to use the least |
|
| 3448 |
+ * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least |
|
| 3449 | 3449 |
* fields possible. |
| 3450 | 3450 |
* @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. |
| 3451 | 3451 |
* @return On error a negative value is returned, otherwise the number of bytes |
| ... | ... |
@@ -599,7 +599,7 @@ static int decode_frame(AVCodecContext *avctx, |
| 599 | 599 |
exit_loop: |
| 600 | 600 |
/* handle p-frames only if a predecessor frame is available */ |
| 601 | 601 |
if(s->last_picture->data[0] != NULL) {
|
| 602 |
- if(!(avpkt->flags & PKT_FLAG_KEY)) {
|
|
| 602 |
+ if(!(avpkt->flags & AV_PKT_FLAG_KEY)) {
|
|
| 603 | 603 |
int i, j; |
| 604 | 604 |
uint8_t *pd = s->current_picture->data[0]; |
| 605 | 605 |
uint8_t *pd_last = s->last_picture->data[0]; |
| ... | ... |
@@ -129,7 +129,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap, |
| 129 | 129 |
av_init_packet(&dc1394->packet); |
| 130 | 130 |
dc1394->packet.size = avpicture_get_size(fmt->pix_fmt, fmt->width, fmt->height); |
| 131 | 131 |
dc1394->packet.stream_index = vst->index; |
| 132 |
- dc1394->packet.flags |= PKT_FLAG_KEY; |
|
| 132 |
+ dc1394->packet.flags |= AV_PKT_FLAG_KEY; |
|
| 133 | 133 |
|
| 134 | 134 |
dc1394->current_frame = 0; |
| 135 | 135 |
dc1394->fps = fps->frame_rate; |
| ... | ... |
@@ -888,12 +888,12 @@ static int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket * |
| 888 | 888 |
asf_st->pkt.pos = |
| 889 | 889 |
asf_st->packet_pos= asf->packet_pos; |
| 890 | 890 |
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n",
|
| 891 |
-//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & PKT_FLAG_KEY, |
|
| 891 |
+//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & AV_PKT_FLAG_KEY, |
|
| 892 | 892 |
//s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, asf->packet_obj_size); |
| 893 | 893 |
if (s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO) |
| 894 | 894 |
asf->packet_key_frame = 1; |
| 895 | 895 |
if (asf->packet_key_frame) |
| 896 |
- asf_st->pkt.flags |= PKT_FLAG_KEY; |
|
| 896 |
+ asf_st->pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 897 | 897 |
} |
| 898 | 898 |
|
| 899 | 899 |
/* read data */ |
| ... | ... |
@@ -1068,7 +1068,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, |
| 1068 | 1068 |
pts= pkt->pts; |
| 1069 | 1069 |
|
| 1070 | 1070 |
av_free_packet(pkt); |
| 1071 |
- if(pkt->flags&PKT_FLAG_KEY){
|
|
| 1071 |
+ if(pkt->flags&AV_PKT_FLAG_KEY){
|
|
| 1072 | 1072 |
i= pkt->stream_index; |
| 1073 | 1073 |
|
| 1074 | 1074 |
asf_st= s->streams[i]->priv_data; |
| ... | ... |
@@ -668,7 +668,7 @@ static void put_payload_header( |
| 668 | 668 |
int val; |
| 669 | 669 |
|
| 670 | 670 |
val = stream->num; |
| 671 |
- if (flags & PKT_FLAG_KEY) |
|
| 671 |
+ if (flags & AV_PKT_FLAG_KEY) |
|
| 672 | 672 |
val |= ASF_PL_FLAG_KEY_FRAME; |
| 673 | 673 |
put_byte(pb, val); |
| 674 | 674 |
|
| ... | ... |
@@ -771,7 +771,7 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 771 | 771 |
stream = &asf->streams[pkt->stream_index]; |
| 772 | 772 |
|
| 773 | 773 |
if(codec->codec_type == AVMEDIA_TYPE_AUDIO) |
| 774 |
- flags &= ~PKT_FLAG_KEY; |
|
| 774 |
+ flags &= ~AV_PKT_FLAG_KEY; |
|
| 775 | 775 |
|
| 776 | 776 |
pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; |
| 777 | 777 |
assert(pts != AV_NOPTS_VALUE); |
| ... | ... |
@@ -782,7 +782,7 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 782 | 782 |
put_frame(s, stream, s->streams[pkt->stream_index], pkt->dts, pkt->data, pkt->size, flags); |
| 783 | 783 |
|
| 784 | 784 |
/* check index */ |
| 785 |
- if ((!asf->is_streamed) && (flags & PKT_FLAG_KEY)) {
|
|
| 785 |
+ if ((!asf->is_streamed) && (flags & AV_PKT_FLAG_KEY)) {
|
|
| 786 | 786 |
start_sec = (int)(duration / INT64_C(10000000)); |
| 787 | 787 |
if (start_sec != (int)(asf->last_indexed_pts / INT64_C(10000000))) {
|
| 788 | 788 |
for(i=asf->nb_index_count;i<start_sec;i++) {
|
| ... | ... |
@@ -165,7 +165,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
| 165 | 165 |
|
| 166 | 166 |
end= strchr(p, '\n'); |
| 167 | 167 |
av_new_packet(pkt, end ? end-p+1 : strlen(p)); |
| 168 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 168 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 169 | 169 |
pkt->pos= p - ass->event_buffer + s->streams[0]->codec->extradata_size; |
| 170 | 170 |
pkt->pts= pkt->dts= get_pts(p); |
| 171 | 171 |
memcpy(pkt->data, p, pkt->size); |
| ... | ... |
@@ -777,7 +777,7 @@ resync: |
| 777 | 777 |
size = dv_produce_packet(avi->dv_demux, pkt, |
| 778 | 778 |
pkt->data, pkt->size); |
| 779 | 779 |
pkt->destruct = dstr; |
| 780 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 780 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 781 | 781 |
} else {
|
| 782 | 782 |
/* XXX: How to handle B-frames in AVI? */ |
| 783 | 783 |
pkt->dts = ast->frame_offset; |
| ... | ... |
@@ -797,10 +797,10 @@ resync: |
| 797 | 797 |
|
| 798 | 798 |
if(index >= 0 && e->timestamp == ast->frame_offset){
|
| 799 | 799 |
if (e->flags & AVINDEX_KEYFRAME) |
| 800 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 800 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 801 | 801 |
} |
| 802 | 802 |
} else {
|
| 803 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 803 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 804 | 804 |
} |
| 805 | 805 |
if(ast->sample_size) |
| 806 | 806 |
ast->frame_offset += pkt->size; |
| ... | ... |
@@ -885,7 +885,7 @@ resync: |
| 885 | 885 |
|
| 886 | 886 |
|
| 887 | 887 |
if( (st->discard >= AVDISCARD_DEFAULT && size==0) |
| 888 |
- /*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & PKT_FLAG_KEY))*/ //FIXME needs a little reordering |
|
| 888 |
+ /*|| (st->discard >= AVDISCARD_NONKEY && !(pkt->flags & AV_PKT_FLAG_KEY))*/ //FIXME needs a little reordering |
|
| 889 | 889 |
|| st->discard >= AVDISCARD_ALL){
|
| 890 | 890 |
if(ast->sample_size) ast->frame_offset += pkt->size; |
| 891 | 891 |
else ast->frame_offset++; |
| ... | ... |
@@ -540,7 +540,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 540 | 540 |
} |
| 541 | 541 |
|
| 542 | 542 |
avi_stream2fourcc(&tag[0], stream_index, enc->codec_type); |
| 543 |
- if(pkt->flags&PKT_FLAG_KEY) |
|
| 543 |
+ if(pkt->flags&AV_PKT_FLAG_KEY) |
|
| 544 | 544 |
flags = 0x10; |
| 545 | 545 |
if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
|
| 546 | 546 |
avist->audio_strm_length += size; |
| ... | ... |
@@ -113,7 +113,7 @@ avs_read_video_packet(AVFormatContext * s, AVPacket * pkt, |
| 113 | 113 |
pkt->size = ret + palette_size; |
| 114 | 114 |
pkt->stream_index = avs->st_video->index; |
| 115 | 115 |
if (sub_type == 0) |
| 116 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 116 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 117 | 117 |
|
| 118 | 118 |
return 0; |
| 119 | 119 |
} |
| ... | ... |
@@ -134,7 +134,7 @@ static int avs_read_audio_packet(AVFormatContext * s, AVPacket * pkt) |
| 134 | 134 |
return ret; |
| 135 | 135 |
|
| 136 | 136 |
pkt->stream_index = avs->st_audio->index; |
| 137 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 137 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 138 | 138 |
|
| 139 | 139 |
return size; |
| 140 | 140 |
} |
| ... | ... |
@@ -233,7 +233,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
| 233 | 233 |
return ret; |
| 234 | 234 |
pkt->stream_index = 0; |
| 235 | 235 |
pkt->pts = bink->video_pts++; |
| 236 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 236 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 237 | 237 |
|
| 238 | 238 |
/* -1 instructs the next call to read_packet() to read the next frame */ |
| 239 | 239 |
bink->current_track = -1; |
| ... | ... |
@@ -126,7 +126,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
| 126 | 126 |
ret = voc_get_packet(s, pkt, c93->audio, datasize - 26); |
| 127 | 127 |
if (ret > 0) {
|
| 128 | 128 |
pkt->stream_index = 1; |
| 129 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 129 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 130 | 130 |
return ret; |
| 131 | 131 |
} |
| 132 | 132 |
} |
| ... | ... |
@@ -182,7 +182,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
| 182 | 182 |
|
| 183 | 183 |
/* only the first frame is guaranteed to not reference previous frames */ |
| 184 | 184 |
if (c93->current_block == 0 && c93->current_frame == 0) {
|
| 185 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 185 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 186 | 186 |
pkt->data[0] |= C93_FIRST_FRAME; |
| 187 | 187 |
} |
| 188 | 188 |
return 0; |
| ... | ... |
@@ -221,7 +221,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) |
| 221 | 221 |
c->audio_pkt[i].size = 0; |
| 222 | 222 |
c->audio_pkt[i].data = c->audio_buf[i]; |
| 223 | 223 |
c->audio_pkt[i].stream_index = c->ast[i]->index; |
| 224 |
- c->audio_pkt[i].flags |= PKT_FLAG_KEY; |
|
| 224 |
+ c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY; |
|
| 225 | 225 |
} |
| 226 | 226 |
c->ast[i]->codec->sample_rate = dv_audio_frequency[freq]; |
| 227 | 227 |
c->ast[i]->codec->channels = 2; |
| ... | ... |
@@ -355,7 +355,7 @@ int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, |
| 355 | 355 |
av_init_packet(pkt); |
| 356 | 356 |
pkt->data = buf; |
| 357 | 357 |
pkt->size = size; |
| 358 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 358 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 359 | 359 |
pkt->stream_index = c->vst->id; |
| 360 | 360 |
pkt->pts = c->frames; |
| 361 | 361 |
|
| ... | ... |
@@ -520,7 +520,7 @@ static int ea_read_packet(AVFormatContext *s, |
| 520 | 520 |
case pQGT_TAG: |
| 521 | 521 |
case TGQs_TAG: |
| 522 | 522 |
case MADk_TAG: |
| 523 |
- key = PKT_FLAG_KEY; |
|
| 523 |
+ key = AV_PKT_FLAG_KEY; |
|
| 524 | 524 |
case MVIf_TAG: |
| 525 | 525 |
case fVGT_TAG: |
| 526 | 526 |
case MADm_TAG: |
| ... | ... |
@@ -537,7 +537,7 @@ static int ea_read_packet(AVFormatContext *s, |
| 537 | 537 |
case MV0K_TAG: |
| 538 | 538 |
case MPCh_TAG: |
| 539 | 539 |
case pIQT_TAG: |
| 540 |
- key = PKT_FLAG_KEY; |
|
| 540 |
+ key = AV_PKT_FLAG_KEY; |
|
| 541 | 541 |
case MV0F_TAG: |
| 542 | 542 |
get_video_packet: |
| 543 | 543 |
ret = av_get_packet(pb, pkt, chunk_size); |
| ... | ... |
@@ -432,7 +432,7 @@ static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 432 | 432 |
} |
| 433 | 433 |
pkt->pos = url_ftell(s->pb); |
| 434 | 434 |
if (ffm->header[1] & FLAG_KEY_FRAME) |
| 435 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 435 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 436 | 436 |
|
| 437 | 437 |
ffm->read_state = READ_HEADER; |
| 438 | 438 |
if (ffm_read_data(s, pkt->data, size, 0) != size) {
|
| ... | ... |
@@ -210,7 +210,7 @@ static int ffm_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 210 | 210 |
/* packet size & key_frame */ |
| 211 | 211 |
header[0] = pkt->stream_index; |
| 212 | 212 |
header[1] = 0; |
| 213 |
- if (pkt->flags & PKT_FLAG_KEY) |
|
| 213 |
+ if (pkt->flags & AV_PKT_FLAG_KEY) |
|
| 214 | 214 |
header[1] |= FLAG_KEY_FRAME; |
| 215 | 215 |
AV_WB24(header+2, pkt->size); |
| 216 | 216 |
AV_WB24(header+5, pkt->duration); |
| ... | ... |
@@ -437,7 +437,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 437 | 437 |
pkt->stream_index = st->index; |
| 438 | 438 |
|
| 439 | 439 |
if (is_audio || ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY)) |
| 440 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 440 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 441 | 441 |
|
| 442 | 442 |
return ret; |
| 443 | 443 |
} |
| ... | ... |
@@ -351,7 +351,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 351 | 351 |
return -1; |
| 352 | 352 |
} |
| 353 | 353 |
|
| 354 |
- flags |= pkt->flags & PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER; |
|
| 354 |
+ flags |= pkt->flags & AV_PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER; |
|
| 355 | 355 |
} else {
|
| 356 | 356 |
assert(enc->codec_type == AVMEDIA_TYPE_AUDIO); |
| 357 | 357 |
flags = get_audio_flags(enc); |
| ... | ... |
@@ -263,7 +263,7 @@ static int iff_read_packet(AVFormatContext *s, |
| 263 | 263 |
} |
| 264 | 264 |
|
| 265 | 265 |
if(iff->sent_bytes == 0) |
| 266 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 266 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 267 | 267 |
|
| 268 | 268 |
if(s->streams[0]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
|
| 269 | 269 |
iff->sent_bytes += PACKET_SIZE; |
| ... | ... |
@@ -292,7 +292,7 @@ static int img_read_packet(AVFormatContext *s1, AVPacket *pkt) |
| 292 | 292 |
|
| 293 | 293 |
av_new_packet(pkt, size[0] + size[1] + size[2]); |
| 294 | 294 |
pkt->stream_index = 0; |
| 295 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 295 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 296 | 296 |
|
| 297 | 297 |
pkt->size= 0; |
| 298 | 298 |
for(i=0; i<3; i++){
|
| ... | ... |
@@ -128,7 +128,7 @@ static int nut_write_packet(AVFormatContext * avf, AVPacket * pkt) {
|
| 128 | 128 |
p.len = pkt->size; |
| 129 | 129 |
p.stream = pkt->stream_index; |
| 130 | 130 |
p.pts = pkt->pts; |
| 131 |
- p.flags = pkt->flags & PKT_FLAG_KEY ? NUT_FLAG_KEY : 0; |
|
| 131 |
+ p.flags = pkt->flags & AV_PKT_FLAG_KEY ? NUT_FLAG_KEY : 0; |
|
| 132 | 132 |
p.next_pts = 0; |
| 133 | 133 |
|
| 134 | 134 |
nut_write_frame_reorder(priv->nut, &p, pkt->data); |
| ... | ... |
@@ -269,7 +269,7 @@ static int nut_read_packet(AVFormatContext * avf, AVPacket * pkt) {
|
| 269 | 269 |
return -1; |
| 270 | 270 |
} |
| 271 | 271 |
|
| 272 |
- if (pd.flags & NUT_FLAG_KEY) pkt->flags |= PKT_FLAG_KEY; |
|
| 272 |
+ if (pd.flags & NUT_FLAG_KEY) pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 273 | 273 |
pkt->pts = pd.pts; |
| 274 | 274 |
pkt->stream_index = pd.stream; |
| 275 | 275 |
pkt->pos = url_ftell(avf->pb); |
| ... | ... |
@@ -104,7 +104,7 @@ static int lmlm4_read_packet(AVFormatContext *s, AVPacket *pkt) {
|
| 104 | 104 |
|
| 105 | 105 |
switch (frame_type) {
|
| 106 | 106 |
case LMLM4_I_FRAME: |
| 107 |
- pkt->flags = PKT_FLAG_KEY; |
|
| 107 |
+ pkt->flags = AV_PKT_FLAG_KEY; |
|
| 108 | 108 |
case LMLM4_P_FRAME: |
| 109 | 109 |
case LMLM4_B_FRAME: |
| 110 | 110 |
pkt->stream_index = 0; |
| ... | ... |
@@ -1547,7 +1547,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data, |
| 1547 | 1547 |
flags = *data++; |
| 1548 | 1548 |
size -= 3; |
| 1549 | 1549 |
if (is_keyframe == -1) |
| 1550 |
- is_keyframe = flags & 0x80 ? PKT_FLAG_KEY : 0; |
|
| 1550 |
+ is_keyframe = flags & 0x80 ? AV_PKT_FLAG_KEY : 0; |
|
| 1551 | 1551 |
|
| 1552 | 1552 |
if (cluster_time != (uint64_t)-1 |
| 1553 | 1553 |
&& (block_time >= 0 || cluster_time >= -block_time)) {
|
| ... | ... |
@@ -866,7 +866,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 866 | 866 |
MatroskaMuxContext *mkv = s->priv_data; |
| 867 | 867 |
ByteIOContext *pb = s->pb; |
| 868 | 868 |
AVCodecContext *codec = s->streams[pkt->stream_index]->codec; |
| 869 |
- int keyframe = !!(pkt->flags & PKT_FLAG_KEY); |
|
| 869 |
+ int keyframe = !!(pkt->flags & AV_PKT_FLAG_KEY); |
|
| 870 | 870 |
int duration = pkt->duration; |
| 871 | 871 |
int ret; |
| 872 | 872 |
int64_t ts = mkv->tracks[pkt->stream_index].write_dts ? pkt->dts : pkt->pts; |
| ... | ... |
@@ -2344,7 +2344,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 2344 | 2344 |
} |
| 2345 | 2345 |
if (st->discard == AVDISCARD_ALL) |
| 2346 | 2346 |
goto retry; |
| 2347 |
- pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? PKT_FLAG_KEY : 0; |
|
| 2347 |
+ pkt->flags |= sample->flags & AVINDEX_KEYFRAME ? AV_PKT_FLAG_KEY : 0; |
|
| 2348 | 2348 |
pkt->pos = sample->pos; |
| 2349 | 2349 |
dprintf(s, "stream %d, pts %"PRId64", dts %"PRId64", pos 0x%"PRIx64", duration %d\n", |
| 2350 | 2350 |
pkt->stream_index, pkt->pts, pkt->dts, pkt->pos, pkt->duration); |
| ... | ... |
@@ -1987,7 +1987,7 @@ static int mov_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 1987 | 1987 |
trk->flags |= MOV_TRACK_CTTS; |
| 1988 | 1988 |
trk->cluster[trk->entry].cts = pkt->pts - pkt->dts; |
| 1989 | 1989 |
trk->cluster[trk->entry].flags = 0; |
| 1990 |
- if (pkt->flags & PKT_FLAG_KEY) {
|
|
| 1990 |
+ if (pkt->flags & AV_PKT_FLAG_KEY) {
|
|
| 1991 | 1991 |
if (mov->mode == MODE_MOV && enc->codec_id == CODEC_ID_MPEG2VIDEO) {
|
| 1992 | 1992 |
mov_parse_mpeg2_frame(pkt, &trk->cluster[trk->entry].flags); |
| 1993 | 1993 |
if (trk->cluster[trk->entry].flags & MOV_PARTIAL_SYNC_SAMPLE) |
| ... | ... |
@@ -1156,7 +1156,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) |
| 1156 | 1156 |
int64_t pts, dts; |
| 1157 | 1157 |
PacketDesc *pkt_desc; |
| 1158 | 1158 |
const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE); |
| 1159 |
- const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & PKT_FLAG_KEY); |
|
| 1159 |
+ const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & AV_PKT_FLAG_KEY); |
|
| 1160 | 1160 |
|
| 1161 | 1161 |
pts= pkt->pts; |
| 1162 | 1162 |
dts= pkt->dts; |
| ... | ... |
@@ -125,7 +125,7 @@ static int msnwc_tcp_read_packet(AVFormatContext *ctx, AVPacket *pkt) |
| 125 | 125 |
/* Some aMsn generated videos (or was it Mercury Messenger?) don't set |
| 126 | 126 |
* this bit and rely on the codec to get keyframe information */ |
| 127 | 127 |
if(keyframe&1) |
| 128 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 128 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 129 | 129 |
|
| 130 | 130 |
return HEADER_SIZE + size; |
| 131 | 131 |
} |
| ... | ... |
@@ -620,7 +620,7 @@ null_chunk_retry: |
| 620 | 620 |
av_get_packet(pb, pkt, vsize); |
| 621 | 621 |
pkt->stream_index = st[NSV_ST_VIDEO]->index;//NSV_ST_VIDEO; |
| 622 | 622 |
pkt->dts = nst->frame_offset; |
| 623 |
- pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ |
|
| 623 |
+ pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ |
|
| 624 | 624 |
/* |
| 625 | 625 |
for (i = 0; i < MIN(8, vsize); i++) |
| 626 | 626 |
PRINT(("NSV video: [%d] = %02x\n", i, pkt->data[i]));
|
| ... | ... |
@@ -660,7 +660,7 @@ null_chunk_retry: |
| 660 | 660 |
} |
| 661 | 661 |
av_get_packet(pb, pkt, asize); |
| 662 | 662 |
pkt->stream_index = st[NSV_ST_AUDIO]->index;//NSV_ST_AUDIO; |
| 663 |
- pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ |
|
| 663 |
+ pkt->flags |= nsv->state == NSV_HAS_READ_NSVS ? AV_PKT_FLAG_KEY : 0; /* keyframe only likely on a sync frame */ |
|
| 664 | 664 |
if( nsv->state == NSV_HAS_READ_NSVS && st[NSV_ST_VIDEO] ) {
|
| 665 | 665 |
/* on a nsvs frame we have new information on a/v sync */ |
| 666 | 666 |
pkt->dts = (((NSVStream*)st[NSV_ST_VIDEO]->priv_data)->frame_offset-1); |
| ... | ... |
@@ -754,7 +754,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code){
|
| 754 | 754 |
|
| 755 | 755 |
pkt->stream_index = stream_id; |
| 756 | 756 |
if (stc->last_flags & FLAG_KEY) |
| 757 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 757 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 758 | 758 |
pkt->pts = pts; |
| 759 | 759 |
|
| 760 | 760 |
return 0; |
| ... | ... |
@@ -603,7 +603,7 @@ static int write_header(AVFormatContext *s){
|
| 603 | 603 |
static int get_needed_flags(NUTContext *nut, StreamContext *nus, FrameCode *fc, AVPacket *pkt){
|
| 604 | 604 |
int flags= 0; |
| 605 | 605 |
|
| 606 |
- if(pkt->flags & PKT_FLAG_KEY ) flags |= FLAG_KEY; |
|
| 606 |
+ if(pkt->flags & AV_PKT_FLAG_KEY ) flags |= FLAG_KEY; |
|
| 607 | 607 |
if(pkt->stream_index != fc->stream_id ) flags |= FLAG_STREAM_ID; |
| 608 | 608 |
if(pkt->size / fc->size_mul ) flags |= FLAG_SIZE_MSB; |
| 609 | 609 |
if(pkt->pts - nus->last_pts != fc->pts_delta) flags |= FLAG_CODED_PTS; |
| ... | ... |
@@ -644,7 +644,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt){
|
| 644 | 644 |
FrameCode *fc; |
| 645 | 645 |
int64_t coded_pts; |
| 646 | 646 |
int best_length, frame_code, flags, needed_flags, i, header_idx, best_header_idx; |
| 647 |
- int key_frame = !!(pkt->flags & PKT_FLAG_KEY); |
|
| 647 |
+ int key_frame = !!(pkt->flags & AV_PKT_FLAG_KEY); |
|
| 648 | 648 |
int store_sp=0; |
| 649 | 649 |
int ret; |
| 650 | 650 |
|
| ... | ... |
@@ -220,7 +220,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) {
|
| 220 | 220 |
return ret; |
| 221 | 221 |
// HACK: we have no idea if it is a keyframe, |
| 222 | 222 |
// but if we mark none seeking will not work at all. |
| 223 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 223 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 224 | 224 |
pkt->pos = pos; |
| 225 | 225 |
pkt->pts = AV_RL32(&hdr[4]); |
| 226 | 226 |
pkt->stream_index = ctx->v_id; |
| ... | ... |
@@ -240,7 +240,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt) {
|
| 240 | 240 |
break; |
| 241 | 241 |
} |
| 242 | 242 |
ret = av_get_packet(pb, pkt, size); |
| 243 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 243 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 244 | 244 |
pkt->pos = pos; |
| 245 | 245 |
pkt->pts = AV_RL32(&hdr[4]); |
| 246 | 246 |
pkt->stream_index = ctx->a_id; |
| ... | ... |
@@ -544,7 +544,7 @@ retry: |
| 544 | 544 |
// pflags might not be set until after this |
| 545 | 545 |
pts = ogg_calc_pts(s, idx, &dts); |
| 546 | 546 |
|
| 547 |
- if (os->keyframe_seek && !(os->pflags & PKT_FLAG_KEY)) |
|
| 547 |
+ if (os->keyframe_seek && !(os->pflags & AV_PKT_FLAG_KEY)) |
|
| 548 | 548 |
goto retry; |
| 549 | 549 |
os->keyframe_seek = 0; |
| 550 | 550 |
|
| ... | ... |
@@ -594,7 +594,7 @@ ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg, |
| 594 | 594 |
while (url_ftell(bc) < pos_limit && !ogg_packet(s, &i, NULL, NULL, pos_arg)) {
|
| 595 | 595 |
if (i == stream_index) {
|
| 596 | 596 |
pts = ogg_calc_pts(s, i, NULL); |
| 597 |
- if (os->keyframe_seek && !(os->pflags & PKT_FLAG_KEY)) |
|
| 597 |
+ if (os->keyframe_seek && !(os->pflags & AV_PKT_FLAG_KEY)) |
|
| 598 | 598 |
pts = AV_NOPTS_VALUE; |
| 599 | 599 |
} |
| 600 | 600 |
if (pts != AV_NOPTS_VALUE) |
| ... | ... |
@@ -256,7 +256,7 @@ static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 256 | 256 |
if (st->codec->codec_id == CODEC_ID_THEORA) {
|
| 257 | 257 |
int64_t pts = oggstream->vrev < 1 ? pkt->pts : pkt->pts + pkt->duration; |
| 258 | 258 |
int pframe_count; |
| 259 |
- if (pkt->flags & PKT_FLAG_KEY) |
|
| 259 |
+ if (pkt->flags & AV_PKT_FLAG_KEY) |
|
| 260 | 260 |
oggstream->last_kf_pts = pts; |
| 261 | 261 |
pframe_count = pts - oggstream->last_kf_pts; |
| 262 | 262 |
// prevent frame count from overflow if key frame flag is not set |
| ... | ... |
@@ -59,7 +59,7 @@ static uint64_t dirac_gptopts(AVFormatContext *s, int idx, uint64_t granule, |
| 59 | 59 |
int64_t pts = dts + ((gp >> 9) & 0x1fff); |
| 60 | 60 |
|
| 61 | 61 |
if (!dist) |
| 62 |
- os->pflags |= PKT_FLAG_KEY; |
|
| 62 |
+ os->pflags |= AV_PKT_FLAG_KEY; |
|
| 63 | 63 |
|
| 64 | 64 |
if (dts_out) |
| 65 | 65 |
*dts_out = dts; |
| ... | ... |
@@ -93,7 +93,7 @@ static uint64_t old_dirac_gptopts(AVFormatContext *s, int idx, uint64_t gp, |
| 93 | 93 |
uint64_t pframe = gp & 0x3fffffff; |
| 94 | 94 |
|
| 95 | 95 |
if (!pframe) |
| 96 |
- os->pflags |= PKT_FLAG_KEY; |
|
| 96 |
+ os->pflags |= AV_PKT_FLAG_KEY; |
|
| 97 | 97 |
|
| 98 | 98 |
return iframe + pframe; |
| 99 | 99 |
} |
| ... | ... |
@@ -159,7 +159,7 @@ static void write_audio_frame(AVFormatContext *oc, AVStream *st) |
| 159 | 159 |
|
| 160 | 160 |
if (c->coded_frame && c->coded_frame->pts != AV_NOPTS_VALUE) |
| 161 | 161 |
pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base); |
| 162 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 162 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 163 | 163 |
pkt.stream_index= st->index; |
| 164 | 164 |
pkt.data= audio_outbuf; |
| 165 | 165 |
|
| ... | ... |
@@ -368,7 +368,7 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st) |
| 368 | 368 |
AVPacket pkt; |
| 369 | 369 |
av_init_packet(&pkt); |
| 370 | 370 |
|
| 371 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 371 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 372 | 372 |
pkt.stream_index= st->index; |
| 373 | 373 |
pkt.data= (uint8_t *)picture; |
| 374 | 374 |
pkt.size= sizeof(AVPicture); |
| ... | ... |
@@ -385,7 +385,7 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st) |
| 385 | 385 |
if (c->coded_frame->pts != AV_NOPTS_VALUE) |
| 386 | 386 |
pkt.pts= av_rescale_q(c->coded_frame->pts, c->time_base, st->time_base); |
| 387 | 387 |
if(c->coded_frame->key_frame) |
| 388 |
- pkt.flags |= PKT_FLAG_KEY; |
|
| 388 |
+ pkt.flags |= AV_PKT_FLAG_KEY; |
|
| 389 | 389 |
pkt.stream_index= st->index; |
| 390 | 390 |
pkt.data= video_outbuf; |
| 391 | 391 |
pkt.size= out_size; |
| ... | ... |
@@ -804,7 +804,7 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, |
| 804 | 804 |
|
| 805 | 805 |
pkt->pts= timestamp; |
| 806 | 806 |
if (flags & 2) |
| 807 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 807 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 808 | 808 |
|
| 809 | 809 |
return st->codec->codec_type == AVMEDIA_TYPE_AUDIO ? rm->audio_pkt_cnt : 0; |
| 810 | 810 |
} |
| ... | ... |
@@ -828,7 +828,7 @@ ff_rm_retrieve_cache (AVFormatContext *s, ByteIOContext *pb, |
| 828 | 828 |
rm->audio_pkt_cnt--; |
| 829 | 829 |
if ((pkt->pts = ast->audiotimestamp) != AV_NOPTS_VALUE) {
|
| 830 | 830 |
ast->audiotimestamp = AV_NOPTS_VALUE; |
| 831 |
- pkt->flags = PKT_FLAG_KEY; |
|
| 831 |
+ pkt->flags = AV_PKT_FLAG_KEY; |
|
| 832 | 832 |
} else |
| 833 | 833 |
pkt->flags = 0; |
| 834 | 834 |
pkt->stream_index = st->index; |
| ... | ... |
@@ -346,7 +346,7 @@ static int rm_write_audio(AVFormatContext *s, const uint8_t *buf, int size, int |
| 346 | 346 |
/* XXX: suppress this malloc */ |
| 347 | 347 |
buf1= (uint8_t*) av_malloc( size * sizeof(uint8_t) ); |
| 348 | 348 |
|
| 349 |
- write_packet_header(s, stream, size, !!(flags & PKT_FLAG_KEY)); |
|
| 349 |
+ write_packet_header(s, stream, size, !!(flags & AV_PKT_FLAG_KEY)); |
|
| 350 | 350 |
|
| 351 | 351 |
/* for AC-3, the words seem to be reversed */ |
| 352 | 352 |
for(i=0;i<size;i+=2) {
|
| ... | ... |
@@ -365,7 +365,7 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int |
| 365 | 365 |
RMMuxContext *rm = s->priv_data; |
| 366 | 366 |
ByteIOContext *pb = s->pb; |
| 367 | 367 |
StreamInfo *stream = rm->video_stream; |
| 368 |
- int key_frame = !!(flags & PKT_FLAG_KEY); |
|
| 368 |
+ int key_frame = !!(flags & AV_PKT_FLAG_KEY); |
|
| 369 | 369 |
|
| 370 | 370 |
/* XXX: this is incorrect: should be a parameter */ |
| 371 | 371 |
|
| ... | ... |
@@ -344,7 +344,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 344 | 344 |
// None of the Escape formats have keyframes, and the ADPCM |
| 345 | 345 |
// format used doesn't have keyframes. |
| 346 | 346 |
if (rpl->chunk_number == 0 && rpl->frame_in_part == 0) |
| 347 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 347 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 348 | 348 |
|
| 349 | 349 |
return ret; |
| 350 | 350 |
} |
| ... | ... |
@@ -162,7 +162,7 @@ static void search_hi_lo_keyframes(AVFormatContext *s, |
| 162 | 162 |
|
| 163 | 163 |
// Evaluate key frames with known TS (or any frames, if AVSEEK_FLAG_ANY set). |
| 164 | 164 |
if (pts != AV_NOPTS_VALUE && |
| 165 |
- ((flg & PKT_FLAG_KEY) || (flags & AVSEEK_FLAG_ANY))) {
|
|
| 165 |
+ ((flg & AV_PKT_FLAG_KEY) || (flags & AVSEEK_FLAG_ANY))) {
|
|
| 166 | 166 |
if (flags & AVSEEK_FLAG_BYTE) {
|
| 167 | 167 |
// for byte seeking, use position as timestamp |
| 168 | 168 |
ts = pos; |
| ... | ... |
@@ -216,7 +216,7 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 216 | 216 |
c->curstrm = 0; |
| 217 | 217 |
} |
| 218 | 218 |
if(!c->cur_frame || c->curstrm) |
| 219 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 219 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 220 | 220 |
if (c->curstrm == -1) |
| 221 | 221 |
c->cur_frame++; |
| 222 | 222 |
}else{
|
| ... | ... |
@@ -986,14 +986,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, |
| 986 | 986 |
|
| 987 | 987 |
/* update flags */ |
| 988 | 988 |
if(is_intra_only(st->codec)) |
| 989 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 989 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 990 | 990 |
else if (pc) {
|
| 991 | 991 |
pkt->flags = 0; |
| 992 | 992 |
/* keyframe computation */ |
| 993 | 993 |
if (pc->key_frame == 1) |
| 994 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 994 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 995 | 995 |
else if (pc->key_frame == -1 && pc->pict_type == FF_I_TYPE) |
| 996 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 996 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 997 | 997 |
} |
| 998 | 998 |
if (pc) |
| 999 | 999 |
pkt->convergence_duration = pc->convergence_duration; |
| ... | ... |
@@ -1018,7 +1018,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) |
| 1018 | 1018 |
compute_pkt_fields(s, st, NULL, pkt); |
| 1019 | 1019 |
s->cur_st = NULL; |
| 1020 | 1020 |
if ((s->iformat->flags & AVFMT_GENERIC_INDEX) && |
| 1021 |
- (pkt->flags & PKT_FLAG_KEY) && pkt->dts != AV_NOPTS_VALUE) {
|
|
| 1021 |
+ (pkt->flags & AV_PKT_FLAG_KEY) && pkt->dts != AV_NOPTS_VALUE) {
|
|
| 1022 | 1022 |
ff_reduce_index(s, st->index); |
| 1023 | 1023 |
av_add_index_entry(st, pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME); |
| 1024 | 1024 |
} |
| ... | ... |
@@ -1045,7 +1045,7 @@ static int av_read_frame_internal(AVFormatContext *s, AVPacket *pkt) |
| 1045 | 1045 |
pkt->destruct = NULL; |
| 1046 | 1046 |
compute_pkt_fields(s, st, st->parser, pkt); |
| 1047 | 1047 |
|
| 1048 |
- if((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & PKT_FLAG_KEY){
|
|
| 1048 |
+ if((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & AV_PKT_FLAG_KEY){
|
|
| 1049 | 1049 |
ff_reduce_index(s, st->index); |
| 1050 | 1050 |
av_add_index_entry(st, st->parser->frame_offset, pkt->dts, |
| 1051 | 1051 |
0, 0, AVINDEX_KEYFRAME); |
| ... | ... |
@@ -1621,7 +1621,7 @@ static int av_seek_frame_generic(AVFormatContext *s, |
| 1621 | 1621 |
break; |
| 1622 | 1622 |
av_free_packet(&pkt); |
| 1623 | 1623 |
if(stream_index == pkt.stream_index){
|
| 1624 |
- if((pkt.flags & PKT_FLAG_KEY) && pkt.dts > timestamp) |
|
| 1624 |
+ if((pkt.flags & AV_PKT_FLAG_KEY) && pkt.dts > timestamp) |
|
| 1625 | 1625 |
break; |
| 1626 | 1626 |
} |
| 1627 | 1627 |
} |
| ... | ... |
@@ -3381,7 +3381,7 @@ static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int |
| 3381 | 3381 |
#undef fprintf |
| 3382 | 3382 |
#define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0)
|
| 3383 | 3383 |
PRINT("stream #%d:\n", pkt->stream_index);
|
| 3384 |
- PRINT(" keyframe=%d\n", ((pkt->flags & PKT_FLAG_KEY) != 0));
|
|
| 3384 |
+ PRINT(" keyframe=%d\n", ((pkt->flags & AV_PKT_FLAG_KEY) != 0));
|
|
| 3385 | 3385 |
PRINT(" duration=%0.3f\n", (double)pkt->duration / AV_TIME_BASE);
|
| 3386 | 3386 |
/* DTS is _always_ valid after av_read_frame() */ |
| 3387 | 3387 |
PRINT(" dts=");
|
| ... | ... |
@@ -103,7 +103,7 @@ static int vc1t_read_packet(AVFormatContext *s, |
| 103 | 103 |
return AVERROR(EIO); |
| 104 | 104 |
if(s->streams[0]->time_base.den == 1000) |
| 105 | 105 |
pkt->pts = pts; |
| 106 |
- pkt->flags |= keyframe ? PKT_FLAG_KEY : 0; |
|
| 106 |
+ pkt->flags |= keyframe ? AV_PKT_FLAG_KEY : 0; |
|
| 107 | 107 |
pkt->pos -= 8; |
| 108 | 108 |
|
| 109 | 109 |
return pkt->size; |
| ... | ... |
@@ -58,7 +58,7 @@ static int vc1test_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 58 | 58 |
|
| 59 | 59 |
if (!pkt->size) |
| 60 | 60 |
return 0; |
| 61 |
- put_le32(pb, pkt->size | ((pkt->flags & PKT_FLAG_KEY) ? 0x80000000 : 0)); |
|
| 61 |
+ put_le32(pb, pkt->size | ((pkt->flags & AV_PKT_FLAG_KEY) ? 0x80000000 : 0)); |
|
| 62 | 62 |
put_le32(pb, pkt->pts); |
| 63 | 63 |
put_buffer(pb, pkt->data, pkt->size); |
| 64 | 64 |
put_flush_packet(pb); |
| ... | ... |
@@ -127,7 +127,7 @@ static int yop_read_packet(AVFormatContext *s, AVPacket *pkt) |
| 127 | 127 |
yop->video_packet.data = NULL; |
| 128 | 128 |
yop->video_packet.size = 0; |
| 129 | 129 |
pkt->data[0] = yop->odd_frame; |
| 130 |
- pkt->flags |= PKT_FLAG_KEY; |
|
| 130 |
+ pkt->flags |= AV_PKT_FLAG_KEY; |
|
| 131 | 131 |
yop->odd_frame ^= 1; |
| 132 | 132 |
return pkt->size; |
| 133 | 133 |
} |
| ... | ... |
@@ -99,8 +99,8 @@ int main(int argc, char **argv) |
| 99 | 99 |
|
| 100 | 100 |
while ((err = av_read_frame(fctx, &pkt)) >= 0) {
|
| 101 | 101 |
int fd; |
| 102 |
- snprintf(pktfilename, PATH_MAX-1, fntemplate, pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & PKT_FLAG_KEY)?'K':'_'); |
|
| 103 |
- printf(PKTFILESUFF"\n", pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & PKT_FLAG_KEY)?'K':'_'); |
|
| 102 |
+ snprintf(pktfilename, PATH_MAX-1, fntemplate, pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & AV_PKT_FLAG_KEY)?'K':'_'); |
|
| 103 |
+ printf(PKTFILESUFF"\n", pktnum, pkt.stream_index, pkt.pts, pkt.size, (pkt.flags & AV_PKT_FLAG_KEY)?'K':'_'); |
|
| 104 | 104 |
//printf("open(\"%s\")\n", pktfilename);
|
| 105 | 105 |
if (!nowrite) {
|
| 106 | 106 |
fd = open(pktfilename, O_WRONLY|O_CREAT, 0644); |