Skip to content

Commit e970bce

Browse files
simplify hello world output
1 parent 8950688 commit e970bce

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

0_hello_world.c

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ int main(int argc, const char *argv[])
169169
{
170170
// if it's the video stream
171171
if (pPacket->stream_index == video_stream_index) {
172-
logging("AVCodecContext->time_base %d/%d", pCodecContext->time_base.num, pCodecContext->time_base.den);
173172
logging("AVPacket->pts %" PRId64, pPacket->pts);
174-
logging("AVPacket->dts %" PRId64, pPacket->dts);
175173
response = decode_packet(pPacket, pCodecContext, pFrame);
176174
if (response < 0)
177175
break;
@@ -226,26 +224,18 @@ static int decode_packet(AVPacket *pPacket, AVCodecContext *pCodecContext, AVFra
226224
}
227225

228226
if (response >= 0) {
229-
logging("AVFrame->pts %" PRId64, pFrame->pts);
230-
logging("AVFrame->pkt_dts %" PRId64, pFrame->pkt_dts);
231-
232227
logging(
233-
"Frame %c (%d) pts %d dts %d key_frame %d [coded_picture_number %d, display_picture_number %d]",
234-
av_get_picture_type_char(pFrame->pict_type),
228+
"Frame %d (type=%c, size=%d bytes) pts %d key_frame %d [DTS %d]",
235229
pCodecContext->frame_number,
230+
av_get_picture_type_char(pFrame->pict_type),
231+
pFrame->pkt_size,
236232
pFrame->pts,
237-
pFrame->pkt_dts,
238233
pFrame->key_frame,
239-
pFrame->coded_picture_number,
240-
pFrame->display_picture_number
234+
pFrame->coded_picture_number
241235
);
242236

243237
char frame_filename[1024];
244238
snprintf(frame_filename, sizeof(frame_filename), "%s-%d.pgm", "frame", pCodecContext->frame_number);
245-
logging("Y(0, 112) = %d, Cb(0, 112) = %d, Cr(0, 112) = %d", pFrame->data[0][112], pFrame->data[1][112], pFrame->data[2][112]);
246-
logging("linesize Y %d", pFrame->linesize[0]);
247-
logging("linesize Cb %d", pFrame->linesize[1]);
248-
logging("linesize Cr %d", pFrame->linesize[2]);
249239
// save a grayscale frame into a .pgm file
250240
save_gray_frame(pFrame->data[0], pFrame->linesize[0], pFrame->width, pFrame->height, frame_filename);
251241

0 commit comments

Comments
 (0)