mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 11:54:01 +00:00
Removed the stuff from librmff that mkvtoolnix does not need.
This commit is contained in:
parent
0154696753
commit
83937d6979
@ -1,46 +0,0 @@
|
||||
# User settings
|
||||
CC = gcc
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
INSTALL = install
|
||||
CFLAGS = -Wall -Wshadow -g
|
||||
INCLUDES = -I.
|
||||
|
||||
# Used for 'make install'. Change/overwrite as needed.
|
||||
prefix = /usr/local
|
||||
libdir = $(prefix)/lib
|
||||
includedir = $(prefix)/include
|
||||
|
||||
# Don't change these settings
|
||||
SOURCES = rmff.c mb_file_io.c
|
||||
HEADERS = librmff.h mb_file_io.h
|
||||
OBJECTS := $(patsubst %.c,%.o,$(SOURCES))
|
||||
|
||||
CFLAGS += -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
|
||||
all: librmff.a
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) librmff.a
|
||||
|
||||
%.o: %.c librmff.h
|
||||
$(CC) -c -o $@ $(CFLAGS) $(INCLUDES) $<
|
||||
|
||||
librmff.a: $(OBJECTS)
|
||||
$(AR) rcvu $@ $?
|
||||
$(RANLIB) $@
|
||||
|
||||
install: all
|
||||
@if ! test -d $(includedir); then \
|
||||
echo $(INSTALL) -d $(includedir); \
|
||||
$(INSTALL) -d $(includedir); \
|
||||
fi
|
||||
@for i in $(HEADERS); do \
|
||||
echo $(INSTALL) $$i $(includedir); \
|
||||
$(INSTALL) $$i $(includedir); \
|
||||
done
|
||||
@if ! test -d $(libdir); then \
|
||||
echo $(INSTALL) -d $(libdir); \
|
||||
$(INSTALL) -d $(libdir); \
|
||||
fi
|
||||
$(INSTALL) librmff.a $(libdir)
|
@ -1,2 +0,0 @@
|
||||
/* big endian system */
|
||||
/* #undef WORDS_BIGENDIAN */
|
80
librmff/os.h
80
librmff/os.h
@ -1,80 +0,0 @@
|
||||
#ifndef __OS_H
|
||||
#define __OS_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
|
||||
# define SYS_WINDOWS
|
||||
# if defined __MINGW32__
|
||||
# define COMP_MINGW
|
||||
# elif defined __CYGWIN__
|
||||
# define COMP_CYGWIN
|
||||
# else
|
||||
# define COMP_MSC
|
||||
# endif
|
||||
#elif defined(__APPLE__)
|
||||
# define SYS_APPLE
|
||||
#else
|
||||
# define COMP_GCC
|
||||
# define SYS_UNIX
|
||||
# if defined(__bsdi__) || defined(__FreeBSD__)
|
||||
# define SYS_BSD
|
||||
# else
|
||||
# define SYS_LINUX
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(COMP_MSC)
|
||||
# define PACKAGE "mkvtoolnix"
|
||||
# define VERSION "0.8.6"
|
||||
|
||||
# define strncasecmp _strnicmp
|
||||
# define strcasecmp _stricmp
|
||||
# define nice(a)
|
||||
# define vsnprintf _vsnprintf
|
||||
# define vfprintf _vfprintf
|
||||
#endif // COMP_MSC
|
||||
|
||||
#if defined(COMP_MINGW) || defined(COMP_MSC)
|
||||
|
||||
// For DLL stuff...
|
||||
# if defined(MTX_DLL)
|
||||
# if defined(MTX_DLL_EXPORT)
|
||||
# define MTX_DLL_API __declspec(dllexport)
|
||||
# else // MTX_DLL_EXPORT
|
||||
# define MTX_DLL_API __declspec(dllimport)
|
||||
# endif
|
||||
# else // MTX_DLL
|
||||
# define MTX_DLL_API
|
||||
# endif
|
||||
|
||||
# define LLD "%I64d"
|
||||
# define LLU "%I64u"
|
||||
|
||||
#else // COMP_MINGW || COMP_MSC
|
||||
|
||||
# define MTX_DLL_API
|
||||
# define LLD "%lld"
|
||||
# define LLU "%llu"
|
||||
#endif // COMP_MINGW || COMP_MSC
|
||||
|
||||
#if defined(HAVE_STDINT_H)
|
||||
#include <stdint.h>
|
||||
#endif // HAVE_STDINT_H
|
||||
#if defined(HAVE_INTTYPES_H)
|
||||
#include <inttypes.h>
|
||||
#endif // HAVE_INTTYPES_H
|
||||
|
||||
#if defined(SYS_WINDOWS)
|
||||
# define PATHSEP '\\'
|
||||
#else
|
||||
# define PATHSEP '/'
|
||||
#endif
|
||||
|
||||
#if defined(WORDS_BIGENDIAN) && (WORDS_BIGENDIAN == 1)
|
||||
# define ARCH_BIGENDIAN
|
||||
#else
|
||||
# define ARCH_LITTLEENDIAN
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,32 +0,0 @@
|
||||
# User settings
|
||||
CC = gcc
|
||||
AR = ar
|
||||
RANLIB = ranlib
|
||||
INSTALL = install
|
||||
CFLAGS = -Wall -Wshadow -g
|
||||
INCLUDES = -I..
|
||||
LDFLAGS = -L..
|
||||
|
||||
# Used for 'make install'. Change/overwrite as needed.
|
||||
prefix = /usr/local
|
||||
libdir = $(prefix)/lib
|
||||
includedir = $(prefix)/include
|
||||
|
||||
# Don't change these settings
|
||||
SOURCES = testrmff.c
|
||||
OBJECTS := $(patsubst %.c,%.o,$(SOURCES))
|
||||
|
||||
CFLAGS += -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
|
||||
|
||||
all:
|
||||
make -C .. all
|
||||
make testrmff
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) testrmff
|
||||
|
||||
%.o: %.c ../librmff.h
|
||||
$(CC) -c -o $@ $(CFLAGS) $(INCLUDES) $<
|
||||
|
||||
testrmff: $(OBJECTS) ../librmff.a
|
||||
$(CC) -o $@ $(LDFLAGS) $(OBJECTS) -lrmff
|
@ -1,53 +0,0 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "librmff.h"
|
||||
|
||||
char buffer[128000];
|
||||
|
||||
void
|
||||
test_reading(const char *file_name) {
|
||||
rmff_file_t *file;
|
||||
rmff_frame_t *frame;
|
||||
int frame_no;
|
||||
|
||||
file = rmff_open_file(file_name, MB_OPEN_MODE_READING);
|
||||
if (file == NULL) {
|
||||
printf("Could not open %s\n", file_name);
|
||||
return;
|
||||
}
|
||||
printf("Opened %s, reading headers... ", file_name);
|
||||
if (rmff_read_headers(file) != RMFF_ERR_OK) {
|
||||
printf("failed. Error code: %d, error message: %s\n",
|
||||
rmff_last_error, rmff_last_error_msg);
|
||||
return;
|
||||
}
|
||||
printf("done.\nNumber of tracks: %u, number of packets: %u\nNow reading "
|
||||
"all frames.\n", file->num_tracks, file->num_packets_in_chunk);
|
||||
frame_no = 0;
|
||||
do {
|
||||
printf("frame %d expected size: %d", frame_no,
|
||||
rmff_get_next_frame_size(file));
|
||||
if ((frame = rmff_read_next_frame(file, buffer)) != NULL) {
|
||||
printf(", read ok with size %d", frame->size);
|
||||
rmff_release_frame(frame);
|
||||
}
|
||||
printf("\n");
|
||||
frame_no++;
|
||||
} while (frame != NULL);
|
||||
rmff_close_file(file);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc,
|
||||
char *argv[]) {
|
||||
int i;
|
||||
|
||||
if (argc < 2)
|
||||
test_reading("readtestvideo.rm");
|
||||
else
|
||||
for (i = 1; i < argc; i++)
|
||||
test_reading(argv[i]);
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user