add initial files
This commit is contained in:
commit
dff2195f0d
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/hello
|
9
Makefile
Normal file
9
Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
TARGET := hello
|
||||||
|
OBJS := hello.o
|
||||||
|
CFLAGS := $$(pkg-config --cflags libavformat) -Wall
|
||||||
|
LDFLAGS := $$(pkg-config --libs libavformat)
|
||||||
|
|
||||||
|
all: $(TARGET)
|
||||||
|
|
||||||
|
$(TARGET): $(OBJS)
|
||||||
|
$(CC) -o $@ $^ $(LDFLAGS)
|
23
hello.c
Normal file
23
hello.c
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <libavformat/avformat.h>
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
if (argc < 2)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
AVFormatContext * context = NULL;
|
||||||
|
av_register_all();
|
||||||
|
if (avformat_open_input(&context, argv[1], NULL, NULL) != 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Error opening input stream %s\n", argv[1]);
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
avformat_close_input(&context);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user