Preparing some tests

This commit is contained in:
Zoe Roux
2019-12-29 01:05:25 +01:00
parent 7cc0d167dd
commit d0c47e48a9
8 changed files with 64 additions and 11 deletions
+3 -1
View File
@@ -1,2 +1,4 @@
.idea/*
cmake-build-debug/*
cmake-build-debug/*
tests/*.o
tests/ts
+2 -1
View File
@@ -8,7 +8,8 @@ include_directories(include)
add_library(transcoder SHARED
src/helper.c
src/subtitles.c)
src/subtitles.c
src/info.c)
set_property(TARGET transcoder PROPERTY C_STANDARD 11)
target_link_libraries(transcoder
+1 -1
View File
@@ -1 +1 @@
./configure --pkg-config-flags=--static --disable-shared --enable-static --disable-zlib --disable-iconv
./configure --pkg-config-flags=--static --disable-shared --enable-static --disable-zlib --disable-iconv --disable-asm --disable-ffplay --disable-ffprobe
-6
View File
@@ -3,12 +3,6 @@
#include "helper.h"
#include "stream.h"
int init()
{
printf("Kyoo Transcoder INITIALIZED.\n");
return (42);
}
int open_input_context(AVFormatContext **in_ctx, const char *path)
{
if (avformat_open_input(in_ctx, path, NULL, NULL)) {
+10
View File
@@ -2,6 +2,16 @@
// Created by Anonymus Raccoon on 20/12/2019.
//
#include <stdio.h>
#include "stream.h"
#include "helper.h"
int init()
{
printf("Kyoo Transcoder INITIALIZED.\n");
return (42);
}
stream *get_track_info(const char *path, int *stream_count, int *track_count)
{
AVFormatContext *ctx = NULL;
+1 -2
View File
@@ -112,14 +112,13 @@ void finish_up(AVFormatContext *int_ctx, AVFormatContext **output_list, unsigned
stream *extract_subtitles(char *path, const char *out_path, unsigned *stream_count, unsigned *subtitle_count)
{
printf("EXTRACTING THINGS\n");
AVFormatContext *int_ctx = NULL;
AVFormatContext **output_list;
stream *streams;
char *folder_name = strchr(path, '/');
char *p;
if (!folder_name)
if (!folder_name && (folder_name = strdup(folder_name)))
return (NULL);
p = strchr(folder_name, '.');
if (p)
+30
View File
@@ -0,0 +1,30 @@
#
# Created by Anonymus Raccoon on 28/12/2019.
#
SRC = test_main.c
OBJ = $(SRC:%.c=%.o)
INCLUDE = -I ../include
CFLAGS = $(INCLUDE) -Wall -Wextra -Wshadow -g
LDFLAGS = -lm -lbz2 -lva -lva-drm -lva-x11 -lX11 -llzma -lvdpau -L ../cmake-build-debug -ltranscoder
NAME = ts
CC = gcc
all: build
build: $(OBJ)
$(CC) -o $(NAME) $(OBJ) $(LDFLAGS)
clean:
$(RM) $(OBJ)
fclean: clean
$(RM) $(NAME)
re: fclean all
+17
View File
@@ -0,0 +1,17 @@
//
// Created by anonymus-raccoon on 12/28/19.
//
#include <string.h>
#include "transcoder.h"
int main(int argc, char **argv)
{
unsigned stream_count = 0;
unsigned subtitle_count = 0;
if (argc == 3 && !strcmp(argv[1], "es"))
extract_subtitles(argv[2], "./", &stream_count, &subtitle_count);
return (0);
}