FFMPEG Plugin: Print debug output for audio frames, too
- Also change what is printed for video frames. Currently both debug_fframe_[audio|video] are used in AVCodecDecoder only and thus are streamlined for their usage there. For example we print the AVFrame.pkt_dts field instead of the AVFrame.pkt field because the later one is never touched by AVCodecDecoders usage of the FFMPEG library. Note: AVFrame.pkt being never touched means that it always contains the value AV_NOPTS_VALUE making it less useful for debug purposes.
This commit is contained in:
@@ -772,6 +772,10 @@ AVCodecDecoder::_DecodeNextAudioFrame()
|
|||||||
fContext->sample_fmt, 1);
|
fContext->sample_fmt, 1);
|
||||||
if (fDecodedDataBufferSize < 0)
|
if (fDecodedDataBufferSize < 0)
|
||||||
fDecodedDataBufferSize = 0;
|
fDecodedDataBufferSize = 0;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
dump_ffframe_audio(fDecodedDataBuffer, "ffaudio");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
fFrame += currentFrameCount;
|
fFrame += currentFrameCount;
|
||||||
@@ -1083,9 +1087,9 @@ AVCodecDecoder::_HandleNewVideoFrameAndUpdateSystemState()
|
|||||||
ConvertAVCodecContextToVideoFrameRate(*fContext, fOutputFrameRate);
|
ConvertAVCodecContextToVideoFrameRate(*fContext, fOutputFrameRate);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
dump_ffframe(fRawDecodedPicture, "ffpict");
|
dump_ffframe_video(fRawDecodedPicture, "ffpict");
|
||||||
// dump_ffframe(fPostProcessedDecodedPicture, "opict");
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
fFrame++;
|
fFrame++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -477,21 +477,28 @@ colorspace_to_pixfmt(color_space format)
|
|||||||
#define END_TAG "\033[0m"
|
#define END_TAG "\033[0m"
|
||||||
|
|
||||||
void
|
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<AVSampleFormat>(frame->format)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
dump_ffframe_video(AVFrame* frame, const char* name)
|
||||||
{
|
{
|
||||||
const char* picttypes[] = {"no pict type", "intra", "predicted",
|
const char* picttypes[] = {"no pict type", "intra", "predicted",
|
||||||
"bidir pre", "s(gmc)-vop"};
|
"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,
|
" ]\n"END_TAG,
|
||||||
name,
|
name,
|
||||||
frame->pts,
|
frame->pkt_dts,
|
||||||
frame->coded_picture_number,
|
frame->coded_picture_number,
|
||||||
frame->display_picture_number,
|
frame->display_picture_number,
|
||||||
// frame->quality,
|
|
||||||
frame->key_frame?"keyframe, ":"",
|
frame->key_frame?"keyframe, ":"",
|
||||||
picttypes[frame->pict_type]);
|
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]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2014 Colin Günther <[email protected]>.
|
||||||
|
*
|
||||||
|
* All rights reserved. Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
/
|
/
|
||||||
/ File: gfx_util.h
|
/ File: gfx_util.h
|
||||||
@@ -39,6 +45,7 @@ const char *pixfmt_to_string(int format);
|
|||||||
color_space pixfmt_to_colorspace(int format);
|
color_space pixfmt_to_colorspace(int format);
|
||||||
PixelFormat colorspace_to_pixfmt(color_space 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
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user