summaryrefslogtreecommitdiff
path: root/src/img_encoder.cc
diff options
context:
space:
mode:
authordeva <deva>2005-04-13 14:05:29 +0000
committerdeva <deva>2005-04-13 14:05:29 +0000
commit067f68c8c6118e9f9241e4f0eb872aad4888dba0 (patch)
treec5ba5a4f144e38157e045ed7a7d9b1febb664c6e /src/img_encoder.cc
parent8bb66b01594b5201af3e3afbe28238076e809b50 (diff)
decoder rewritten for input throgh raw1394 instead of dv1394 (kernel bug in 2.6.x)
Diffstat (limited to 'src/img_encoder.cc')
-rw-r--r--src/img_encoder.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/img_encoder.cc b/src/img_encoder.cc
index 75801c8..1a464f8 100644
--- a/src/img_encoder.cc
+++ b/src/img_encoder.cc
@@ -25,6 +25,8 @@
#include <stdio.h>
//#include <setjmp.h>
+#include "debug.h"
+
//av_alloc_format_context
//av_destruct_packet_nofree
@@ -43,7 +45,7 @@ ImgEncoder::ImgEncoder()
exit(1);
}
- dcc= avcodec_alloc_context();
+ dcc= avcodec_alloc_context(); ALLOC(dcc, "img_encoder, dcc");
// open it
if (avcodec_open(dcc, deccodec) < 0) {
@@ -62,7 +64,7 @@ void ImgEncoder::encode(DVFrame *dvframe,
int quality)
{
int ret;
- AVFrame *rawframe = avcodec_alloc_frame();
+ AVFrame *rawframe = avcodec_alloc_frame(); ALLOC(dcc, "img_encoder, rawframe");
///////////////////////// DECODE
uint8_t *ptr;
@@ -81,7 +83,7 @@ void ImgEncoder::encode(DVFrame *dvframe,
// TODO: Do image convertion here!
AVPicture pict;
- avpicture_alloc(&pict,PIX_FMT_RGB24, 720, 576);
+ avpicture_alloc(&pict,PIX_FMT_RGB24, 720, 576); ALLOC(dcc, "img_encoder, pict");
img_convert(&pict, PIX_FMT_RGB24, (AVPicture *)rawframe,
PIX_FMT_YUV420P, 720, 576);
@@ -89,8 +91,8 @@ void ImgEncoder::encode(DVFrame *dvframe,
writeJPEGFile(filename, quality, (JSAMPLE*)(pict.data[0]), 720, 576);
printf("written\n");
- avpicture_free(&pict);
- av_free(rawframe);
+ avpicture_free(&pict); FREE(&pict);
+ av_free(rawframe); FREE(rawframe);
}
///////////////////////////////////////////////////////////////////////////////////////////