1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include "config.h"
24
25 /**
26 * @file
27 * various utility functions
28 */
29
30 #include "libavutil/ffversion.h"
32
34 {
35 return FFMPEG_VERSION;
36 }
37
39 {
45
46 av_assert0(((
size_t)-1) > 0);
// C guarantees this but if false on a platform we care about revert at least b284e1ffe343d6697fb950d1ee517bafda8a9844
47
49 av_log(
NULL,
AV_LOG_FATAL,
"Libavutil has been built with a broken binutils, please upgrade binutils and rebuild\n");
50 abort();
51 }
52
53 if (
llrint(1LL<<60) != 1LL<<60) {
55 }
56
58 }
59
61 {
62 return FFMPEG_CONFIGURATION;
63 }
64
66 {
67 #define LICENSE_PREFIX "libavutil license: "
69 }
70
72 {
73 switch (media_type) {
80 }
81 }
82
84 {
93 default: return '?';
94 }
95 }
96
98 const void *
list, uint64_t term)
99 {
101
103 return 0;
104 #define LIST_LENGTH(type) \
105 { type t = term, *l = (type *)list; for (i = 0; l[i] != t; i++); }
106 switch (elsize) {
112 }
114 }
115
117 {
119 char *orig_buf = buf;
121
122 for (
i = 0;
i < 4;
i++) {
124 const int print_chr = (
c >=
'0' &&
c <=
'9') ||
125 (
c >=
'a' &&
c <=
'z') ||
126 (
c >=
'A' &&
c <=
'Z') ||
127 (
c && strchr(
". -_",
c));
128 const int len =
snprintf(buf, buf_size, print_chr ?
"%c" :
"[%d]",
c);
130 break;
132 buf_size = buf_size >
len ? buf_size -
len : 0;
134 }
135
136 return orig_buf;
137 }
138
140 {
142 }
143
145 #if HAVE_MMX_INLINE
148 "fstenv %0 \n\t"
150 :
151 : "memory"
152 );
154 #endif
155 }