diff --git a/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp b/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp index 803199056f..da1c30d568 100644 --- a/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp +++ b/src/add-ons/media/plugins/ffmpeg/AVCodecDecoder.cpp @@ -772,6 +772,10 @@ AVCodecDecoder::_DecodeNextAudioFrame() fContext->sample_fmt, 1); if (fDecodedDataBufferSize < 0) fDecodedDataBufferSize = 0; + +#ifdef DEBUG + dump_ffframe_audio(fDecodedDataBuffer, "ffaudio"); +#endif } fFrame += currentFrameCount; @@ -1083,9 +1087,9 @@ AVCodecDecoder::_HandleNewVideoFrameAndUpdateSystemState() ConvertAVCodecContextToVideoFrameRate(*fContext, fOutputFrameRate); #ifdef DEBUG - dump_ffframe(fRawDecodedPicture, "ffpict"); -// dump_ffframe(fPostProcessedDecodedPicture, "opict"); + dump_ffframe_video(fRawDecodedPicture, "ffpict"); #endif + fFrame++; } diff --git a/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp b/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp index 10b0f8bd36..d08f5a1324 100644 --- a/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp +++ b/src/add-ons/media/plugins/ffmpeg/gfx_util.cpp @@ -477,21 +477,28 @@ colorspace_to_pixfmt(color_space format) #define END_TAG "\033[0m" void -dump_ffframe(AVFrame* frame, const char* name) +dump_ffframe_audio(AVFrame* frame, const char* name) +{ + printf(BEGIN_TAG"AVFrame(%s) [ pkt_dts:%-10lld #samples:%-5d %s" + " ]\n"END_TAG, + name, + frame->pkt_dts, + frame->nb_samples, + av_get_sample_fmt_name(static_cast(frame->format))); +} + + +void +dump_ffframe_video(AVFrame* frame, const char* name) { const char* picttypes[] = {"no pict type", "intra", "predicted", "bidir pre", "s(gmc)-vop"}; - printf(BEGIN_TAG"AVFrame(%s) pts:%-10lld cnum:%-5d dnum:%-5d %s%s, " + printf(BEGIN_TAG"AVFrame(%s) [ pkt_dts:%-10lld cnum:%-5d dnum:%-5d %s%s" " ]\n"END_TAG, name, - frame->pts, + frame->pkt_dts, frame->coded_picture_number, frame->display_picture_number, -// frame->quality, frame->key_frame?"keyframe, ":"", picttypes[frame->pict_type]); -// printf(BEGIN_TAG"\t\tlinesize[] = {%ld, %ld, %ld, %ld}\n"END_TAG, -// frame->linesize[0], frame->linesize[1], frame->linesize[2], -// frame->linesize[3]); } - diff --git a/src/add-ons/media/plugins/ffmpeg/gfx_util.h b/src/add-ons/media/plugins/ffmpeg/gfx_util.h index 609cec51d2..7ed463aa0b 100644 --- a/src/add-ons/media/plugins/ffmpeg/gfx_util.h +++ b/src/add-ons/media/plugins/ffmpeg/gfx_util.h @@ -1,3 +1,9 @@ +/* + * Copyright (C) 2014 Colin Günther . + * + * All rights reserved. Distributed under the terms of the MIT License. + */ + /****************************************************************************** / / File: gfx_util.h @@ -39,6 +45,7 @@ const char *pixfmt_to_string(int format); color_space pixfmt_to_colorspace(int format); PixelFormat colorspace_to_pixfmt(color_space format); -void dump_ffframe(AVFrame *frame, const char *name); +void dump_ffframe_audio(AVFrame *frame, const char *name); +void dump_ffframe_video(AVFrame *frame, const char *name); #endif