aboutsummaryrefslogtreecommitdiff
path: root/args.c
diff options
context:
space:
mode:
Diffstat (limited to 'args.c')
-rw-r--r--args.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/args.c b/args.c
index 689e705..9ec8bf3 100644
--- a/args.c
+++ b/args.c
@@ -28,21 +28,19 @@
#include <linux/videodev2.h>
#include "common.h"
-#include "parser.h"
-
void print_usage(char *name)
{
printf("Usage:\n");
printf("\t%s\n", name);
- printf("\t-c <codec> - The codec of the encoded stream\n");
+ printf("\t-c <codec> - The codec to be used for encoding\n");
printf("\t\t Available codecs: mpeg4, h264\n");
printf("\t-d use dmabuf instead of mmap\n");
- printf("\t-i <file> - Input file name\n");
- printf("\t-m <device> - video decoder device (e.g. /dev/video8)\n");
+ printf("\t-i <file> - Input file name in NV12\n");
+ printf("\t-m <device> - video encoder device (e.g. /dev/video33)\n");
printf("\t-w video width\n");
printf("\t-h video height\n");
- printf("\t-f save frames on disk\n");
+ printf("\t-f save encoded frames on disk\n");
printf("\n");
}
@@ -79,7 +77,7 @@ int parse_args(struct instance *i, int argc, char **argv)
while ((c = getopt(argc, argv, "w:h:c:di:m:f:")) != -1) {
switch (c) {
case 'c':
- i->parser.codec = get_codec(optarg);
+ i->codec = get_codec(optarg);
break;
case 'd':
i->use_dmabuf = 1;
@@ -111,26 +109,11 @@ int parse_args(struct instance *i, int argc, char **argv)
return -1;
}
- if (!i->parser.codec) {
+ if (!i->codec) {
err("Unknown or not set codec (-c)");
return -1;
}
- switch (i->parser.codec) {
- case V4L2_PIX_FMT_XVID:
- case V4L2_PIX_FMT_H263:
- case V4L2_PIX_FMT_MPEG4:
- i->parser.func = parse_mpeg4_stream;
- break;
- case V4L2_PIX_FMT_H264:
- i->parser.func = parse_h264_stream;
- break;
- case V4L2_PIX_FMT_MPEG1:
- case V4L2_PIX_FMT_MPEG2:
- i->parser.func = parse_mpeg2_stream;
- break;
- }
-
return 0;
}