Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c395d230
Commit
c395d230
authored
Mar 25, 2017
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice/decklink_enc: convert to std::atomic
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
7cfa98fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
decklink_enc.cpp
libavdevice/decklink_enc.cpp
+6
-4
No files found.
libavdevice/decklink_enc.cpp
View file @
c395d230
...
...
@@ -19,6 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <atomic>
using
std
::
atomic
;
#include <DeckLinkAPI.h>
#include <pthread.h>
...
...
@@ -28,7 +31,6 @@ extern "C" {
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/imgutils.h"
#include "libavutil/atomic.h"
}
#include "decklink_common.h"
...
...
@@ -60,10 +62,10 @@ public:
virtual
HRESULT
STDMETHODCALLTYPE
GetAncillaryData
(
IDeckLinkVideoFrameAncillary
**
ancillary
)
{
return
S_FALSE
;
}
virtual
HRESULT
STDMETHODCALLTYPE
QueryInterface
(
REFIID
iid
,
LPVOID
*
ppv
)
{
return
E_NOINTERFACE
;
}
virtual
ULONG
STDMETHODCALLTYPE
AddRef
(
void
)
{
return
avpriv_atomic_int_add_and_fetch
(
&
_refs
,
1
)
;
}
virtual
ULONG
STDMETHODCALLTYPE
AddRef
(
void
)
{
return
++
_refs
;
}
virtual
ULONG
STDMETHODCALLTYPE
Release
(
void
)
{
int
ret
=
avpriv_atomic_int_add_and_fetch
(
&
_refs
,
-
1
)
;
int
ret
=
--
_refs
;
if
(
!
ret
)
{
av_frame_free
(
&
_avframe
);
delete
this
;
...
...
@@ -75,7 +77,7 @@ public:
AVFrame
*
_avframe
;
private
:
volatile
int
_refs
;
std
::
atomic
<
int
>
_refs
;
};
class
decklink_output_callback
:
public
IDeckLinkVideoOutputCallback
...
...
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