From be4f2582062196dd6ecf393f55566367bc1dfa9f Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Thu, 1 Feb 2018 00:26:36 +0100 Subject: reorganized configs --- src/creator.c | 50 ++++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'src/creator.c') diff --git a/src/creator.c b/src/creator.c index d8bd008..85fd0b0 100644 --- a/src/creator.c +++ b/src/creator.c @@ -24,7 +24,7 @@ static void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt, av_packet_unref(pkt); } } -int generateVideo(filename, int width, int height, int fps, int bitRate) +int generateVideo(char *filename, int width, int height, int fps, int bitRate) { avcodec_register_all(); @@ -77,36 +77,38 @@ int generateVideo(filename, int width, int height, int fps, int bitRate) fprintf(stderr, "could not alloc the frame data\n"); exit(1); } + return TRUE; +} void addFrame(int *frame) { - fflush(stdout); - /* make sure the frame data is writable */ - ret = av_frame_make_writable(picture); - if (ret < 0) - exit(1); + fflush(stdout); + /* make sure the frame data is writable */ + ret = av_frame_make_writable(picture); + if (ret < 0) + exit(1); - picture->data[0] = frame; + picture->data[0] = frame; - /* prepare a dummy image */ - /* Y */ - /*for(y=0;yheight;y++) { - for(x=0;xwidth;x++) { - picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3; - } - } YCbCr colorCode - /* Cb and Cr * - for(y=0;yheight/2;y++) { - for(x=0;xwidth/2;x++) { - picture->data[1][y * picture->linesize[1] + x] = 128 + y + i * 2; - picture->data[2][y * picture->linesize[2] + x] = 64 + x + i * 5; - } - } */ + /* prepare a dummy image */ + /* Y */ + /*for(y=0;yheight;y++) { + for(x=0;xwidth;x++) { + picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3; + } + } YCbCr colorCode + /* Cb and Cr * + for(y=0;yheight/2;y++) { + for(x=0;xwidth/2;x++) { + picture->data[1][y * picture->linesize[1] + x] = 128 + y + i * 2; + picture->data[2][y * picture->linesize[2] + x] = 64 + x + i * 5; + } + } */ - picture->pts = i; - /* encode the image */ - encode(c, picture, pkt, f); + picture->pts = i; + /* encode the image */ + encode(c, picture, pkt, f); } void endFile(void){ -- cgit v1.2.1