|
|
|
@ -3494,26 +3494,25 @@ void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size) |
|
|
|
|
hex_dump_internal(avcl, NULL, level, buf, size); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//FIXME needs to know the time_base
|
|
|
|
|
static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int dump_payload) |
|
|
|
|
static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int dump_payload, AVRational time_base) |
|
|
|
|
{ |
|
|
|
|
#undef fprintf |
|
|
|
|
#define PRINT(...) do { if (!f) av_log(avcl, level, __VA_ARGS__); else fprintf(f, __VA_ARGS__); } while(0) |
|
|
|
|
PRINT("stream #%d:\n", pkt->stream_index); |
|
|
|
|
PRINT(" keyframe=%d\n", ((pkt->flags & AV_PKT_FLAG_KEY) != 0)); |
|
|
|
|
PRINT(" duration=%0.3f\n", (double)pkt->duration / AV_TIME_BASE); |
|
|
|
|
PRINT(" duration=%0.3f\n", pkt->duration * av_q2d(time_base)); |
|
|
|
|
/* DTS is _always_ valid after av_read_frame() */ |
|
|
|
|
PRINT(" dts="); |
|
|
|
|
if (pkt->dts == AV_NOPTS_VALUE) |
|
|
|
|
PRINT("N/A"); |
|
|
|
|
else |
|
|
|
|
PRINT("%0.3f", (double)pkt->dts / AV_TIME_BASE); |
|
|
|
|
PRINT("%0.3f", pkt->dts * av_q2d(time_base)); |
|
|
|
|
/* PTS may not be known if B-frames are present. */ |
|
|
|
|
PRINT(" pts="); |
|
|
|
|
if (pkt->pts == AV_NOPTS_VALUE) |
|
|
|
|
PRINT("N/A"); |
|
|
|
|
else |
|
|
|
|
PRINT("%0.3f", (double)pkt->pts / AV_TIME_BASE); |
|
|
|
|
PRINT("%0.3f", pkt->pts * av_q2d(time_base)); |
|
|
|
|
PRINT("\n"); |
|
|
|
|
PRINT(" size=%d\n", pkt->size); |
|
|
|
|
#undef PRINT |
|
|
|
@ -3523,12 +3522,25 @@ static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int |
|
|
|
|
|
|
|
|
|
void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload) |
|
|
|
|
{ |
|
|
|
|
pkt_dump_internal(NULL, f, 0, pkt, dump_payload); |
|
|
|
|
AVRational tb = { 1, AV_TIME_BASE }; |
|
|
|
|
pkt_dump_internal(NULL, f, 0, pkt, dump_payload, tb); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st) |
|
|
|
|
{ |
|
|
|
|
pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload) |
|
|
|
|
{ |
|
|
|
|
pkt_dump_internal(avcl, NULL, level, pkt, dump_payload); |
|
|
|
|
AVRational tb = { 1, AV_TIME_BASE }; |
|
|
|
|
pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, tb); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, |
|
|
|
|
AVStream *st) |
|
|
|
|
{ |
|
|
|
|
pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, st->time_base); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if FF_API_URL_SPLIT |
|
|
|
|