Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
5c550e8b
Commit
5c550e8b
authored
Aug 14, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/crypto/MD5: add option to use libavutil instead of libgcrypt
parent
433e18b2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
2 deletions
+29
-2
MD5.cxx
src/lib/crypto/MD5.cxx
+19
-1
meson.build
src/lib/crypto/meson.build
+2
-1
meson.build
src/lib/ffmpeg/meson.build
+1
-0
meson.build
src/lib/gcrypt/meson.build
+7
-0
No files found.
src/lib/crypto/MD5.cxx
View file @
5c550e8b
...
@@ -28,20 +28,38 @@
...
@@ -28,20 +28,38 @@
*/
*/
#include "MD5.hxx"
#include "MD5.hxx"
#include "util/HexFormat.hxx"
#include "config.h"
#ifdef HAVE_LIBAVUTIL
extern
"C"
{
#include <libavutil/md5.h>
}
#else
#include "lib/gcrypt/MD5.hxx"
#include "lib/gcrypt/MD5.hxx"
#include "lib/gcrypt/Init.hxx"
#include "lib/gcrypt/Init.hxx"
#
include "util/HexFormat.hxx"
#
endif
void
void
GlobalInitMD5
()
noexcept
GlobalInitMD5
()
noexcept
{
{
#ifdef HAVE_LIBAVUTIL
/* no initialization necessary */
#else
Gcrypt
::
Init
();
Gcrypt
::
Init
();
#endif
}
}
std
::
array
<
uint8_t
,
16
>
std
::
array
<
uint8_t
,
16
>
MD5
(
ConstBuffer
<
void
>
input
)
noexcept
MD5
(
ConstBuffer
<
void
>
input
)
noexcept
{
{
#ifdef HAVE_LIBAVUTIL
std
::
array
<
uint8_t
,
16
>
result
;
av_md5_sum
(
&
result
.
front
(),
(
const
uint8_t
*
)
input
.
data
,
input
.
size
);
return
result
;
#else
return
Gcrypt
::
MD5
(
input
);
return
Gcrypt
::
MD5
(
input
);
#endif
}
}
StringBuffer
<
33
>
StringBuffer
<
33
>
...
...
src/lib/crypto/meson.build
View file @
5c550e8b
if gcrypt_dep.found()
if
libavutil_dep.found() or
gcrypt_dep.found()
crypto_md5 = static_library(
crypto_md5 = static_library(
'crypto_md5',
'crypto_md5',
'MD5.cxx',
'MD5.cxx',
include_directories: inc,
include_directories: inc,
dependencies: [
dependencies: [
libavutil_dep,
gcrypt_dep,
gcrypt_dep,
],
],
)
)
...
...
src/lib/ffmpeg/meson.build
View file @
5c550e8b
libavformat_dep = dependency('libavformat', version: '>= 57.40', required: get_option('ffmpeg'))
libavformat_dep = dependency('libavformat', version: '>= 57.40', required: get_option('ffmpeg'))
libavcodec_dep = dependency('libavcodec', version: '>= 57.48', required: get_option('ffmpeg'))
libavcodec_dep = dependency('libavcodec', version: '>= 57.48', required: get_option('ffmpeg'))
libavutil_dep = dependency('libavutil', version: '>= 55.27', required: get_option('ffmpeg'))
libavutil_dep = dependency('libavutil', version: '>= 55.27', required: get_option('ffmpeg'))
conf.set('HAVE_LIBAVUTIL', libavutil_dep.found())
enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()
enable_ffmpeg = libavformat_dep.found() and libavcodec_dep.found() and libavutil_dep.found()
conf.set('ENABLE_FFMPEG', enable_ffmpeg)
conf.set('ENABLE_FFMPEG', enable_ffmpeg)
...
...
src/lib/gcrypt/meson.build
View file @
5c550e8b
if libavutil_dep.found()
# if we have FFmpeg, we can use its MD5 implementation and we don't
# need libgcrypt
gcrypt_dep = dependency('', required: false)
subdir_done()
endif
# Since version 0.49.0 Meson has native libgcrypt dependency support, which has
# Since version 0.49.0 Meson has native libgcrypt dependency support, which has
# the advantage over find_library() as it uses libgcrypt-config to query the
# the advantage over find_library() as it uses libgcrypt-config to query the
# required linker flags.
# required linker flags.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment