12345678910111213141516171819202122232425 |
- #ifndef __UTILS_H__
- #define __UTILS_H__
- #include <stdbool.h>
- #include <libavcodec/avcodec.h>
- #include <libavformat/avformat.h>
- // Constrain the maximum stream descriptor size.
- #define FFS_MAX_TYPE_LEN 16 /* The actual longest should be "subtitle" */
- #define FFS_MAX_CODEC_LEN 32
- #define FFS_MAX_INT_LEN 16 /* Based on INT_MAX from <limits.h>, with some room to spare. */
- #define FFS_MAX_DESCRIPTOR_LEN (FFS_MAX_TYPE_LEN + FFS_MAX_CODEC_LEN + FFS_MAX_INT_LEN)
- size_t strlcpy(char *dest, const char *src, size_t maxlen);
- bool is_base10(const char* number_string);
- void itos10(char* dest, const int src);
- int get_path_stream_id(const char* path);
- void get_stream_codec_type(char* type_name, const int stream);
- void get_stream_codec_name(char* codec_name, const int stream);
- AVCodecParameters* get_stream_codec_parameters(const int stream);
- void build_stream_descriptor(char* codec, const int stream);
- bool valid_stream_descriptor(const char* path);
- bool valid_path(const char* path);
- #endif // __UTILS_H__
|