summaryrefslogtreecommitdiff
path: root/src/mov_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/mov_encoder.cc
parent8bb66b01594b5201af3e3afbe28238076e809b50 (diff)
decoder rewritten for input throgh raw1394 instead of dv1394 (kernel bug in 2.6.x)
Diffstat (limited to 'src/mov_encoder.cc')
-rw-r--r--src/mov_encoder.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mov_encoder.cc b/src/mov_encoder.cc
index 92b2657..ece1cff 100644
--- a/src/mov_encoder.cc
+++ b/src/mov_encoder.cc
@@ -23,6 +23,7 @@
#include "mov_encoder.h"
+#include "debug.h"
//av_alloc_format_context
//av_destruct_packet_nofree
@@ -38,7 +39,8 @@ MovEncoder::MovEncoder(const char *filename)
if(!(efc = av_alloc_format_context())) {
fprintf(stderr, "Could not alloc output format context\n");
exit(1);
- }
+ }
+ ALLOC(dcc, "mov_encoder, efc");
efc->oformat = guess_format("mpeg", NULL, NULL);
//efc->oformat = guess_format(NULL, filename, NULL);
@@ -129,7 +131,7 @@ MovEncoder::MovEncoder(const char *filename)
exit(1);
}
- video_buffer = (unsigned char *)av_malloc(VIDEO_BUFFER_SIZE);
+ video_buffer = (unsigned char *)av_malloc(VIDEO_BUFFER_SIZE); ALLOC(dcc, "mov_encoder, video_buffer");
av_init_packet(&epkt);
@@ -149,7 +151,7 @@ MovEncoder::MovEncoder(const char *filename)
exit(1);
}
- dcc= avcodec_alloc_context();
+ dcc= avcodec_alloc_context(); ALLOC(dcc, "mov_encoder, dcc");
/* open it */
if (avcodec_open(dcc, deccodec) < 0) {
@@ -160,14 +162,14 @@ MovEncoder::MovEncoder(const char *filename)
MovEncoder::~MovEncoder()
{
- av_free(video_buffer);
+ av_free(video_buffer); FREE(video_buffer);
url_fclose(&efc->pb);
}
void MovEncoder::encode(DVFrame *dvframe)
{
int ret;
- AVFrame *rawframe = avcodec_alloc_frame();
+ AVFrame *rawframe = avcodec_alloc_frame();ALLOC(dcc, "mov_encoder, rawframe");
///////////////////////// DECODE
uint8_t *ptr;
@@ -203,5 +205,5 @@ void MovEncoder::encode(DVFrame *dvframe)
av_write_frame(efc, &epkt);
- av_free(rawframe);
+ av_free(rawframe); FREE(rawframe);
}