main.c
authoryu.dongliang <18588496441@163.com>
Sat, 8 Apr 2023 15:00:47 +0000 (23:00 +0800)
committeryu.dongliang <18588496441@163.com>
Sat, 8 Apr 2023 15:00:47 +0000 (23:00 +0800)
Makefile [new file with mode: 0644]
main.c [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..68f7255
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+CFILES += main.c
+CFILES += simp.c
+CFILES += simp_ffmpeg_input.c
+CFILES += simp_ffmpeg_output.c
+CFILES += simp_filter.c
+
+CFLAGS += -g -O3
+#CFLAGS += -Wall 
+CFLAGS += -I./
+CFLAGS += `pkg-config --cflags gtk+-3.0`
+
+LDFLAGS += -lavformat -lavcodec -lavfilter -lavutil
+LDFLAGS += -lGL
+LDFLAGS += `pkg-config --libs gtk+-3.0`
+
+all:
+       gcc $(CFLAGS) $(CFILES) $(LDFLAGS)
+
diff --git a/main.c b/main.c
new file mode 100644 (file)
index 0000000..fcc04e2
--- /dev/null
+++ b/main.c
@@ -0,0 +1,42 @@
+#include"simp.h"
+
+void usage()
+{
+       printf("./simp input output\n");
+}
+
+int main(int argc, char* argv[])
+{
+       if (argc < 3) {
+               usage();
+               return -1;
+       }
+
+       simp_filter_t* f   = NULL;
+       simp_avio_t*   in  = NULL;
+       simp_avio_t*   out = NULL;
+
+       if (simp_avio_open(&in, "ffmpeg_input", argv[1]) < 0) {
+               scf_loge("\n");
+               return -1;
+       }
+
+       if (simp_filter_open(&f) < 0) {
+               scf_loge("\n");
+               return -1;
+       }
+
+       simp_filter_add_input(f, in);
+
+       if (simp_filter_run(f) < 0) {
+               scf_loge("\n");
+               return -1;
+       }
+
+       if (simp_avio_run(in) < 0) {
+               scf_loge("\n");
+               return -1;
+       }
+
+       return 0;
+}