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
b7eff941
Commit
b7eff941
authored
Sep 06, 2013
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed compilation issues with new Ptr
parent
f88d8b95
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
24 deletions
+20
-24
opengl.cpp
modules/core/src/opengl.cpp
+10
-14
video_reader.cpp
modules/gpucodec/src/video_reader.cpp
+7
-7
video_source.cpp
modules/gpucodec/src/video_source.cpp
+1
-1
video_writer.cpp
modules/gpucodec/src/video_writer.cpp
+2
-2
No files found.
modules/core/src/opengl.cpp
View file @
b7eff941
...
...
@@ -484,7 +484,7 @@ cv::ogl::Buffer::Buffer(int arows, int acols, int atype, unsigned int abufId, bo
(
void
)
autoRelease
;
throw_no_ogl
();
#else
impl_
=
new
Impl
(
abufId
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
abufId
,
autoRelease
)
);
rows_
=
arows
;
cols_
=
acols
;
type_
=
atype
;
...
...
@@ -500,7 +500,7 @@ cv::ogl::Buffer::Buffer(Size asize, int atype, unsigned int abufId, bool autoRel
(
void
)
autoRelease
;
throw_no_ogl
();
#else
impl_
=
new
Impl
(
abufId
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
abufId
,
autoRelease
)
);
rows_
=
asize
.
height
;
cols_
=
asize
.
width
;
type_
=
atype
;
...
...
@@ -529,7 +529,7 @@ cv::ogl::Buffer::Buffer(InputArray arr, Target target, bool autoRelease) : rows_
Mat
mat
=
arr
.
getMat
();
CV_Assert
(
mat
.
isContinuous
()
);
const
GLsizeiptr
asize
=
mat
.
rows
*
mat
.
cols
*
mat
.
elemSize
();
impl_
=
new
Impl
(
asize
,
mat
.
data
,
target
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
asize
,
mat
.
data
,
target
,
autoRelease
)
);
rows_
=
mat
.
rows
;
cols_
=
mat
.
cols
;
type_
=
mat
.
type
();
...
...
@@ -552,7 +552,7 @@ void cv::ogl::Buffer::create(int arows, int acols, int atype, Target target, boo
if
(
rows_
!=
arows
||
cols_
!=
acols
||
type_
!=
atype
)
{
const
GLsizeiptr
asize
=
arows
*
acols
*
CV_ELEM_SIZE
(
atype
);
impl_
=
new
Impl
(
asize
,
0
,
target
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
asize
,
0
,
target
,
autoRelease
)
);
rows_
=
arows
;
cols_
=
acols
;
type_
=
atype
;
...
...
@@ -563,8 +563,6 @@ void cv::ogl::Buffer::create(int arows, int acols, int atype, Target target, boo
void
cv
::
ogl
::
Buffer
::
release
()
{
#ifdef HAVE_OPENGL
if
(
*
impl_
.
refcount
==
1
)
impl_
->
setAutoRelease
(
true
);
impl_
=
Impl
::
empty
();
rows_
=
0
;
cols_
=
0
;
...
...
@@ -968,7 +966,7 @@ cv::ogl::Texture2D::Texture2D(int arows, int acols, Format aformat, unsigned int
(
void
)
autoRelease
;
throw_no_ogl
();
#else
impl_
=
new
Impl
(
atexId
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
atexId
,
autoRelease
)
);
rows_
=
arows
;
cols_
=
acols
;
format_
=
aformat
;
...
...
@@ -984,7 +982,7 @@ cv::ogl::Texture2D::Texture2D(Size asize, Format aformat, unsigned int atexId, b
(
void
)
autoRelease
;
throw_no_ogl
();
#else
impl_
=
new
Impl
(
atexId
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
atexId
,
autoRelease
)
);
rows_
=
asize
.
height
;
cols_
=
asize
.
width
;
format_
=
aformat
;
...
...
@@ -1024,7 +1022,7 @@ cv::ogl::Texture2D::Texture2D(InputArray arr, bool autoRelease) : rows_(0), cols
{
ogl
::
Buffer
buf
=
arr
.
getOGlBuffer
();
buf
.
bind
(
ogl
::
Buffer
::
PIXEL_UNPACK_BUFFER
);
impl_
=
new
Impl
(
internalFormats
[
cn
],
asize
.
width
,
asize
.
height
,
srcFormats
[
cn
],
gl_types
[
depth
],
0
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
internalFormats
[
cn
],
asize
.
width
,
asize
.
height
,
srcFormats
[
cn
],
gl_types
[
depth
],
0
,
autoRelease
)
);
ogl
::
Buffer
::
unbind
(
ogl
::
Buffer
::
PIXEL_UNPACK_BUFFER
);
break
;
}
...
...
@@ -1037,7 +1035,7 @@ cv::ogl::Texture2D::Texture2D(InputArray arr, bool autoRelease) : rows_(0), cols
GpuMat
dmat
=
arr
.
getGpuMat
();
ogl
::
Buffer
buf
(
dmat
,
ogl
::
Buffer
::
PIXEL_UNPACK_BUFFER
);
buf
.
bind
(
ogl
::
Buffer
::
PIXEL_UNPACK_BUFFER
);
impl_
=
new
Impl
(
internalFormats
[
cn
],
asize
.
width
,
asize
.
height
,
srcFormats
[
cn
],
gl_types
[
depth
],
0
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
internalFormats
[
cn
],
asize
.
width
,
asize
.
height
,
srcFormats
[
cn
],
gl_types
[
depth
],
0
,
autoRelease
)
);
ogl
::
Buffer
::
unbind
(
ogl
::
Buffer
::
PIXEL_UNPACK_BUFFER
);
#endif
...
...
@@ -1049,7 +1047,7 @@ cv::ogl::Texture2D::Texture2D(InputArray arr, bool autoRelease) : rows_(0), cols
Mat
mat
=
arr
.
getMat
();
CV_Assert
(
mat
.
isContinuous
()
);
ogl
::
Buffer
::
unbind
(
ogl
::
Buffer
::
PIXEL_UNPACK_BUFFER
);
impl_
=
new
Impl
(
internalFormats
[
cn
],
asize
.
width
,
asize
.
height
,
srcFormats
[
cn
],
gl_types
[
depth
],
mat
.
data
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
internalFormats
[
cn
],
asize
.
width
,
asize
.
height
,
srcFormats
[
cn
],
gl_types
[
depth
],
mat
.
data
,
autoRelease
)
);
break
;
}
}
...
...
@@ -1072,7 +1070,7 @@ void cv::ogl::Texture2D::create(int arows, int acols, Format aformat, bool autoR
if
(
rows_
!=
arows
||
cols_
!=
acols
||
format_
!=
aformat
)
{
ogl
::
Buffer
::
unbind
(
ogl
::
Buffer
::
PIXEL_UNPACK_BUFFER
);
impl_
=
new
Impl
(
aformat
,
acols
,
arows
,
aformat
,
gl
::
FLOAT
,
0
,
autoRelease
);
impl_
.
reset
(
new
Impl
(
aformat
,
acols
,
arows
,
aformat
,
gl
::
FLOAT
,
0
,
autoRelease
)
);
rows_
=
arows
;
cols_
=
acols
;
format_
=
aformat
;
...
...
@@ -1083,8 +1081,6 @@ void cv::ogl::Texture2D::create(int arows, int acols, Format aformat, bool autoR
void
cv
::
ogl
::
Texture2D
::
release
()
{
#ifdef HAVE_OPENGL
if
(
*
impl_
.
refcount
==
1
)
impl_
->
setAutoRelease
(
true
);
impl_
=
Impl
::
empty
();
rows_
=
0
;
cols_
=
0
;
...
...
modules/gpucodec/src/video_reader.cpp
View file @
b7eff941
...
...
@@ -99,9 +99,9 @@ namespace
cuSafeCall
(
cuCtxGetCurrent
(
&
ctx
)
);
cuSafeCall
(
cuvidCtxLockCreate
(
&
lock_
,
ctx
)
);
frameQueue_
=
new
detail
::
FrameQueue
;
videoDecoder_
=
new
detail
::
VideoDecoder
(
videoSource_
->
format
(),
lock_
);
videoParser_
=
new
detail
::
VideoParser
(
videoDecoder_
,
frameQueue_
);
frameQueue_
.
reset
(
new
FrameQueue
)
;
videoDecoder_
.
reset
(
new
VideoDecoder
(
videoSource_
->
format
(),
lock_
)
);
videoParser_
.
reset
(
new
VideoParser
(
videoDecoder_
,
frameQueue_
)
);
videoSource_
->
setVideoParser
(
videoParser_
);
videoSource_
->
start
();
...
...
@@ -216,21 +216,21 @@ Ptr<VideoReader> cv::gpucodec::createVideoReader(const String& filename)
try
{
videoSource
=
new
detail
::
CuvidVideoSource
(
filename
);
videoSource
.
reset
(
new
CuvidVideoSource
(
filename
)
);
}
catch
(...)
{
Ptr
<
RawVideoSource
>
source
(
new
detail
::
FFmpegVideoSource
(
filename
));
videoSource
=
new
detail
::
RawVideoSourceWrapper
(
source
);
videoSource
.
reset
(
new
RawVideoSourceWrapper
(
source
)
);
}
return
new
VideoReaderImpl
(
videoSource
);
return
makePtr
<
VideoReaderImpl
>
(
videoSource
);
}
Ptr
<
VideoReader
>
cv
::
gpucodec
::
createVideoReader
(
const
Ptr
<
RawVideoSource
>&
source
)
{
Ptr
<
detail
::
VideoSource
>
videoSource
(
new
detail
::
RawVideoSourceWrapper
(
source
));
return
new
VideoReaderImpl
(
videoSource
);
return
makePtr
<
VideoReaderImpl
>
(
videoSource
);
}
#endif // HAVE_NVCUVID
modules/gpucodec/src/video_source.cpp
View file @
b7eff941
...
...
@@ -69,7 +69,7 @@ void cv::gpucodec::detail::RawVideoSourceWrapper::start()
{
stop_
=
false
;
hasError_
=
false
;
thread_
=
new
Thread
(
readLoop
,
this
);
thread_
.
reset
(
new
Thread
(
readLoop
,
this
)
);
}
void
cv
::
gpucodec
::
detail
::
RawVideoSourceWrapper
::
stop
()
...
...
modules/gpucodec/src/video_writer.cpp
View file @
b7eff941
...
...
@@ -908,12 +908,12 @@ Ptr<VideoWriter> cv::gpucodec::createVideoWriter(const String& fileName, Size fr
Ptr
<
VideoWriter
>
cv
::
gpucodec
::
createVideoWriter
(
const
Ptr
<
EncoderCallBack
>&
encoderCallback
,
Size
frameSize
,
double
fps
,
SurfaceFormat
format
)
{
return
new
VideoWriterImpl
(
encoderCallback
,
frameSize
,
fps
,
format
);
return
makePtr
<
VideoWriterImpl
>
(
encoderCallback
,
frameSize
,
fps
,
format
);
}
Ptr
<
VideoWriter
>
cv
::
gpucodec
::
createVideoWriter
(
const
Ptr
<
EncoderCallBack
>&
encoderCallback
,
Size
frameSize
,
double
fps
,
const
EncoderParams
&
params
,
SurfaceFormat
format
)
{
return
new
VideoWriterImpl
(
encoderCallback
,
frameSize
,
fps
,
params
,
format
);
return
makePtr
<
VideoWriterImpl
>
(
encoderCallback
,
frameSize
,
fps
,
params
,
format
);
}
#endif // !defined HAVE_CUDA || !defined WIN32
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