/* define debug channel */
DECLARE_DEBUG_CHANNEL(brillcodec);
-// device memory
-#define CODEC_META_DATA_SIZE (256)
+#ifdef DUMP_DECODE_FRAME
+/* You can check whether decoded frames are valid or not via PYUV program */
+FILE *dump_file = NULL;
+const char *dump_image = "dump_decode.raw";
+#endif
// libav
#define GEN_MASK(x) ((1 << (x)) - 1)
}
avpicture_layout((AVPicture *)frame, pix_fmt,
frame->width, frame->height, dst, pict_size);
+
+#ifdef DUMP_DECODE_FRAME
+ if (dump_file) {
+ LOG_TRACE("dump decoded frame. picture size %d\n", pict_size);
+ fwrite(dst, 1, pict_size, dump_file);
+ }
+#endif
}
// video decode data handler
+ sizeof(int);
CONTEXT(s, ctx_id)->opened_context = true;
- CONTEXT(s, ctx_id)->parser_ctx =
- maru_brill_codec_parser_init(avctx);
+ CONTEXT(s, ctx_id)->parser_ctx = maru_brill_codec_parser_init(avctx);
+#ifdef DUMP_DECODE_FRAME
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ dump_file = fopen(dump_image, "wb");
+ if (!dump_file) {
+ LOG_INFO("failed to open a file\n");
+ }
+ }
+#endif
} else {
LOG_SEVERE("failed to find codec. ctx_id: %d\n", ctx_id);
ret = -1;
}
LOG_INFO("close avcontext of %d\n", ctx_id);
+#ifdef DUMP_DECODE_FRAME
+ if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
+ if (dump_file) {
+ fclose(dump_file);
+ dump_file = NULL;
+ }
+ }
+#endif
+
avcodec_close(avctx);
if (CONTEXT(s, ctx_id)->is_hwaccel) {