Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
464aa5e5
Commit
464aa5e5
authored
Jul 15, 2016
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6803 from alalek:issue_6720
parents
bfb4ebfa
1f26e734
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
5 deletions
+43
-5
cap_ffmpeg.cpp
modules/videoio/src/cap_ffmpeg.cpp
+43
-5
No files found.
modules/videoio/src/cap_ffmpeg.cpp
View file @
464aa5e5
...
...
@@ -41,6 +41,8 @@
#include "precomp.hpp"
#include <string>
#if defined HAVE_FFMPEG && !defined WIN32
#include "cap_ffmpeg_impl.hpp"
#else
...
...
@@ -59,6 +61,17 @@ static CvWriteFrame_Plugin icvWriteFrame_FFMPEG_p = 0;
static
cv
::
Mutex
_icvInitFFMPEG_mutex
;
#if defined WIN32 || defined _WIN32
static
const
HMODULE
cv_GetCurrentModule
()
{
HMODULE
h
=
0
;
::
GetModuleHandleEx
(
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS
|
GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
,
reinterpret_cast
<
LPCTSTR
>
(
cv_GetCurrentModule
),
&
h
);
return
h
;
}
#endif
class
icvInitFFMPEG
{
public
:
...
...
@@ -95,14 +108,39 @@ private:
icvFFOpenCV
=
LoadPackagedLibrary
(
module_name
,
0
);
# else
const
char
*
module_name
=
"opencv_ffmpeg"
CVAUX_STR
(
CV_MAJOR_VERSION
)
CVAUX_STR
(
CV_MINOR_VERSION
)
CVAUX_STR
(
CV_SUBMINOR_VERSION
)
const
std
::
wstring
module_name
=
L
"opencv_ffmpeg"
CVAUX_STR
W
(
CV_MAJOR_VERSION
)
CVAUX_STRW
(
CV_MINOR_VERSION
)
CVAUX_STRW
(
CV_SUBMINOR_VERSION
)
#if (defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__)
"_64"
L
"_64"
#endif
".dll"
;
L".dll"
;
const
wchar_t
*
ffmpeg_env_path
=
_wgetenv
(
L"OPENCV_FFMPEG_DLL_DIR"
);
std
::
wstring
module_path
=
ffmpeg_env_path
?
((
std
::
wstring
(
ffmpeg_env_path
)
+
L"
\\
"
)
+
module_name
)
:
module_name
;
icvFFOpenCV
=
LoadLibrary
(
module_name
);
icvFFOpenCV
=
LoadLibraryW
(
module_path
.
c_str
());
if
(
!
icvFFOpenCV
&&
!
ffmpeg_env_path
)
{
HMODULE
m
=
cv_GetCurrentModule
();
if
(
m
)
{
wchar_t
path
[
MAX_PATH
];
size_t
sz
=
GetModuleFileNameW
(
m
,
path
,
sizeof
(
path
));
if
(
sz
>
0
&&
ERROR_SUCCESS
==
GetLastError
())
{
wchar_t
*
s
=
wcsrchr
(
path
,
L'\\'
);
if
(
s
)
{
s
[
0
]
=
0
;
module_path
=
(
std
::
wstring
(
path
)
+
L"
\\
"
)
+
module_name
;
icvFFOpenCV
=
LoadLibraryW
(
module_path
.
c_str
());
}
}
}
}
# endif
if
(
icvFFOpenCV
)
...
...
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