Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
331299dc
Commit
331299dc
authored
Jan 02, 2014
by
Felix Abecassis
Committed by
Rémi Denis-Courmont
Jan 02, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the deprecated vlc_atomic_t type.
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
418241e3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
36 additions
and
108 deletions
+36
-108
include/vlc_atomic.h
include/vlc_atomic.h
+7
-55
modules/access/decklink.cpp
modules/access/decklink.cpp
+4
-4
modules/gui/qt4/dialogs/messages.cpp
modules/gui/qt4/dialogs/messages.cpp
+2
-2
modules/gui/qt4/dialogs/messages.hpp
modules/gui/qt4/dialogs/messages.hpp
+1
-1
modules/hw/vdpau/adjust.c
modules/hw/vdpau/adjust.c
+4
-28
modules/video_filter/atmo/atmo.cpp
modules/video_filter/atmo/atmo.cpp
+6
-6
src/android/thread.c
src/android/thread.c
+4
-4
src/audio_output/volume.c
src/audio_output/volume.c
+2
-2
src/misc/update.c
src/misc/update.c
+5
-5
src/misc/update.h
src/misc/update.h
+1
-1
No files found.
include/vlc_atomic.h
View file @
331299dc
...
...
@@ -387,65 +387,17 @@ typedef uintmax_t atomic_uintmax_t;
# endif
# endif
/**
* Memory storage space for an atom. Never access it directly.
*/
typedef
union
{
atomic_uintptr_t
u
;
}
vlc_atomic_t
;
/** Static initializer for \ref vlc_atomic_t */
# define VLC_ATOMIC_INIT(val) { (val) }
/* All functions return the atom value _after_ the operation. */
static
inline
uintptr_t
vlc_atomic_get
(
vlc_atomic_t
*
atom
)
{
return
atomic_load
(
&
atom
->
u
);
}
static
inline
uintptr_t
vlc_atomic_set
(
vlc_atomic_t
*
atom
,
uintptr_t
v
)
{
atomic_store
(
&
atom
->
u
,
v
);
return
v
;
}
static
inline
uintptr_t
vlc_atomic_add
(
vlc_atomic_t
*
atom
,
uintptr_t
v
)
{
return
atomic_fetch_add
(
&
atom
->
u
,
v
)
+
v
;
}
static
inline
uintptr_t
vlc_atomic_sub
(
vlc_atomic_t
*
atom
,
uintptr_t
v
)
{
return
atomic_fetch_sub
(
&
atom
->
u
,
v
)
-
v
;
}
static
inline
uintptr_t
vlc_atomic_inc
(
vlc_atomic_t
*
atom
)
{
return
vlc_atomic_add
(
atom
,
1
);
}
static
inline
uintptr_t
vlc_atomic_dec
(
vlc_atomic_t
*
atom
)
{
return
vlc_atomic_sub
(
atom
,
1
);
}
static
inline
uintptr_t
vlc_atomic_swap
(
vlc_atomic_t
*
atom
,
uintptr_t
v
)
{
return
atomic_exchange
(
&
atom
->
u
,
v
);
}
typedef
atomic_uint_least32_t
vlc_atomic_float
;
static
inline
uintptr_t
vlc_atomic_compare_swap
(
vlc_atomic_t
*
atom
,
uintptr_t
u
,
uintptr_t
v
)
static
inline
void
vlc_atomic_init_float
(
vlc_atomic_float
*
var
,
float
f
)
{
atomic_compare_exchange_strong
(
&
atom
->
u
,
&
u
,
v
);
return
u
;
union
{
float
f
;
uint32_t
i
;
}
u
;
u
.
f
=
f
;
atomic_init
(
var
,
u
.
i
);
}
typedef
atomic_uint_least32_t
vlc_atomic_float
;
/** Helper to retrieve a single precision from an atom. */
static
inline
float
vlc_atomic_load
f
(
vlc_atomic_float
*
atom
)
static
inline
float
vlc_atomic_load
_float
(
vlc_atomic_float
*
atom
)
{
union
{
float
f
;
uint32_t
i
;
}
u
;
u
.
i
=
atomic_load
(
atom
);
...
...
@@ -453,7 +405,7 @@ static inline float vlc_atomic_loadf(vlc_atomic_float *atom)
}
/** Helper to store a single precision into an atom. */
static
inline
void
vlc_atomic_store
f
(
vlc_atomic_float
*
atom
,
float
f
)
static
inline
void
vlc_atomic_store
_float
(
vlc_atomic_float
*
atom
,
float
f
)
{
union
{
float
f
;
uint32_t
i
;
}
u
;
u
.
f
=
f
;
...
...
modules/access/decklink.cpp
View file @
331299dc
...
...
@@ -154,19 +154,19 @@ class DeckLinkCaptureDelegate : public IDeckLinkInputCallback
public:
DeckLinkCaptureDelegate
(
demux_t
*
demux
)
:
demux_
(
demux
)
{
vlc_atomic_set
(
&
m_ref_
,
1
);
atomic_store
(
&
m_ref
,
1
);
}
virtual
HRESULT
STDMETHODCALLTYPE
QueryInterface
(
REFIID
,
LPVOID
*
)
{
return
E_NOINTERFACE
;
}
virtual
ULONG
STDMETHODCALLTYPE
AddRef
(
void
)
{
return
vlc_atomic_inc
(
&
m_ref_
);
return
atomic_fetch_add
(
&
m_ref
,
1
);
}
virtual
ULONG
STDMETHODCALLTYPE
Release
(
void
)
{
uintptr_t
new_ref
=
vlc_atomic_dec
(
&
m_ref_
);
uintptr_t
new_ref
=
atomic_fetch_sub
(
&
m_ref_
,
1
);
if
(
new_ref
==
0
)
delete
this
;
return
new_ref
;
...
...
@@ -181,7 +181,7 @@ public:
virtual
HRESULT
STDMETHODCALLTYPE
VideoInputFrameArrived
(
IDeckLinkVideoInputFrame
*
,
IDeckLinkAudioInputPacket
*
);
private:
vlc_atomic_
t
m_ref_
;
atomic_uin
t
m_ref_
;
demux_t
*
demux_
;
};
...
...
modules/gui/qt4/dialogs/messages.cpp
View file @
331299dc
...
...
@@ -143,7 +143,7 @@ MessagesDialog::~MessagesDialog()
void
MessagesDialog
::
changeVerbosity
(
int
i_verbosity
)
{
vlc_atomic_set
(
&
this
->
verbosity
,
i_verbosity
);
atomic_store
(
&
this
->
verbosity
,
i_verbosity
);
}
void
MessagesDialog
::
updateConfig
()
...
...
@@ -337,7 +337,7 @@ void MessagesDialog::MsgCallback( void *self, int type, const vlc_log_t *item,
{
MessagesDialog
*
dialog
=
(
MessagesDialog
*
)
self
;
char
*
str
;
int
verbosity
=
vlc_atomic_get
(
&
dialog
->
verbosity
);
int
verbosity
=
atomic_load
(
&
dialog
->
verbosity
);
if
(
verbosity
<
0
||
verbosity
<
(
type
-
VLC_MSG_ERR
)
||
unlikely
(
vasprintf
(
&
str
,
format
,
ap
)
==
-
1
)
)
...
...
modules/gui/qt4/dialogs/messages.hpp
View file @
331299dc
...
...
@@ -55,7 +55,7 @@ private:
void
sinkMessage
(
const
MsgEvent
*
);
bool
matchFilter
(
const
QString
&
);
vlc_atomic_
t
verbosity
;
atomic_uin
t
verbosity
;
static
void
MsgCallback
(
void
*
,
int
,
const
vlc_log_t
*
,
const
char
*
,
va_list
);
...
...
modules/hw/vdpau/adjust.c
View file @
331299dc
...
...
@@ -33,36 +33,12 @@
struct
filter_sys_t
{
atomic_uint_fast32_
t
brightness
;
atomic_uint_fast32_
t
contrast
;
atomic_uint_fast32_
t
saturation
;
atomic_uint_fast32_
t
hue
;
vlc_atomic_floa
t
brightness
;
vlc_atomic_floa
t
contrast
;
vlc_atomic_floa
t
saturation
;
vlc_atomic_floa
t
hue
;
};
static
inline
void
vlc_atomic_init_float
(
atomic_uint_fast32_t
*
var
,
float
val
)
{
union
{
uint32_t
u
;
float
f
;
}
u
;
u
.
f
=
val
;
atomic_init
(
var
,
u
.
u
);
}
static
inline
void
vlc_atomic_store_float
(
atomic_uint_fast32_t
*
var
,
float
val
)
{
union
{
uint32_t
u
;
float
f
;
}
u
;
u
.
f
=
val
;
atomic_store
(
var
,
u
.
u
);
}
static
inline
float
vlc_atomic_load_float
(
atomic_uint_fast32_t
*
var
)
{
union
{
uint32_t
u
;
float
f
;
}
u
;
u
.
u
=
atomic_load
(
var
);
return
u
.
f
;
}
static
float
vlc_to_vdp_brightness
(
float
brightness
)
{
brightness
-=
1
.
f
;
...
...
modules/video_filter/atmo/atmo.cpp
View file @
331299dc
...
...
@@ -703,7 +703,7 @@ typedef struct
{
filter_t
*
p_filter
;
vlc_thread_t
thread
;
vlc_atomic_t
abort
;
atomic_bool
abort
;
/* tell the thread which color should be the target of fading */
uint8_t
ui_red
;
...
...
@@ -1120,7 +1120,7 @@ static void Atmo_Shutdown(filter_t *p_filter)
p_sys
->
p_fadethread
->
i_steps
=
1
;
else
p_sys
->
p_fadethread
->
i_steps
=
p_sys
->
i_endfadesteps
;
vlc_atomic_set
(
&
p_sys
->
p_fadethread
->
abort
,
0
);
atomic_store
(
&
p_sys
->
p_fadethread
->
abort
,
false
);
if
(
vlc_clone
(
&
p_sys
->
p_fadethread
->
thread
,
FadeToColorThread
,
...
...
@@ -2390,7 +2390,7 @@ static void *FadeToColorThread(void *obj)
/* send the same pixel data again... to unlock the buffer! */
AtmoSendPixelData
(
p_fadethread
->
p_filter
);
while
(
(
!
vlc_atomic_get
(
&
p_fadethread
->
abort
))
&&
while
(
(
!
atomic_load
(
&
p_fadethread
->
abort
))
&&
(
i_steps_done
<
p_fadethread
->
i_steps
))
{
p_transfer
=
AtmoLockTransferBuffer
(
p_fadethread
->
p_filter
);
...
...
@@ -2403,7 +2403,7 @@ static void *FadeToColorThread(void *obj)
thread improvements wellcome!
*/
for
(
i_index
=
0
;
(
i_index
<
i_size
)
&&
(
!
vlc_atomic_get
(
&
p_fadethread
->
abort
));
(
i_index
<
i_size
)
&&
(
!
atomic_load
(
&
p_fadethread
->
abort
));
i_index
+=
4
)
{
i_src_blue
=
p_source
[
i_index
+
0
];
...
...
@@ -2459,7 +2459,7 @@ static void CheckAndStopFadeThread(filter_t *p_filter)
{
msg_Dbg
(
p_filter
,
"kill still running fadeing thread..."
);
vlc_atomic_set
(
&
p_sys
->
p_fadethread
->
abort
,
1
);
atomic_store
(
&
p_sys
->
p_fadethread
->
abort
,
true
);
vlc_join
(
p_sys
->
p_fadethread
->
thread
,
NULL
);
free
(
p_sys
->
p_fadethread
);
...
...
@@ -2507,7 +2507,7 @@ static int StateCallback( vlc_object_t *, char const *,
p_sys
->
p_fadethread
->
ui_green
=
p_sys
->
ui_pausecolor_green
;
p_sys
->
p_fadethread
->
ui_blue
=
p_sys
->
ui_pausecolor_blue
;
p_sys
->
p_fadethread
->
i_steps
=
p_sys
->
i_fadesteps
;
vlc_atomic_set
(
&
p_sys
->
p_fadethread
->
abort
,
0
);
atomic_store
(
&
p_sys
->
p_fadethread
->
abort
,
false
);
if
(
vlc_clone
(
&
p_sys
->
p_fadethread
->
thread
,
FadeToColorThread
,
...
...
src/android/thread.c
View file @
331299dc
...
...
@@ -170,7 +170,7 @@ struct vlc_thread
void
*
(
*
entry
)(
void
*
);
void
*
data
;
vlc_atomic_t
killed
;
atomic_bool
killed
;
bool
killable
;
};
...
...
@@ -374,7 +374,7 @@ static int vlc_clone_attr (vlc_thread_t *th, void *(*entry) (void *),
vlc_sem_init
(
&
thread
->
finished
,
0
);
vlc_atomic_set
(
&
thread
->
killed
,
false
);
atomic_store
(
&
thread
->
killed
,
false
);
thread
->
killable
=
true
;
thread
->
cond
=
NULL
;
thread
->
entry
=
entry
;
...
...
@@ -434,7 +434,7 @@ void vlc_cancel (vlc_thread_t thread_id)
{
pthread_cond_t
*
cond
;
vlc_atomic_set
(
&
thread_id
->
killed
,
true
);
atomic_store
(
&
thread_id
->
killed
,
true
);
vlc_mutex_lock
(
&
thread_id
->
lock
);
cond
=
thread_id
->
cond
;
...
...
@@ -467,7 +467,7 @@ void vlc_testcancel (void)
return
;
if
(
!
thread
->
killable
)
return
;
if
(
!
vlc_atomic_get
(
&
thread
->
killed
))
if
(
!
atomic_load
(
&
thread
->
killed
))
return
;
pthread_exit
(
NULL
);
...
...
src/audio_output/volume.c
View file @
331299dc
...
...
@@ -135,7 +135,7 @@ int aout_volume_Amplify(aout_volume_t *vol, block_t *block)
return
-
1
;
float
amp
=
vol
->
output_factor
*
vlc_atomic_load
f
(
&
vol
->
gain_factor
);
*
vlc_atomic_load
_float
(
&
vol
->
gain_factor
);
vol
->
object
.
amplify
(
&
vol
->
object
,
block
,
amp
);
return
0
;
...
...
@@ -197,7 +197,7 @@ static int ReplayGainCallback (vlc_object_t *obj, char const *var,
aout_volume_t
*
vol
=
data
;
float
multiplier
=
aout_ReplayGainSelect
(
obj
,
val
.
psz_string
,
&
vol
->
replay_gain
);
vlc_atomic_store
f
(
&
vol
->
gain_factor
,
multiplier
);
vlc_atomic_store
_float
(
&
vol
->
gain_factor
,
multiplier
);
VLC_UNUSED
(
var
);
VLC_UNUSED
(
oldval
);
return
VLC_SUCCESS
;
}
src/misc/update.c
View file @
331299dc
...
...
@@ -141,7 +141,7 @@ void update_Delete( update_t *p_update )
if
(
p_update
->
p_download
)
{
vlc_atomic_set
(
&
p_update
->
p_download
->
aborted
,
1
);
atomic_store
(
&
p_update
->
p_download
->
aborted
,
true
);
vlc_join
(
p_update
->
p_download
->
thread
,
NULL
);
vlc_object_release
(
p_update
->
p_download
);
}
...
...
@@ -494,7 +494,7 @@ void update_Download( update_t *p_update, const char *psz_destdir )
// If the object already exist, destroy it
if
(
p_update
->
p_download
)
{
vlc_atomic_set
(
&
p_update
->
p_download
->
aborted
,
1
);
atomic_store
(
&
p_update
->
p_download
->
aborted
,
true
);
vlc_join
(
p_update
->
p_download
->
thread
,
NULL
);
vlc_object_release
(
p_update
->
p_download
);
}
...
...
@@ -509,7 +509,7 @@ void update_Download( update_t *p_update, const char *psz_destdir )
p_update
->
p_download
=
p_udt
;
p_udt
->
psz_destdir
=
psz_destdir
?
strdup
(
psz_destdir
)
:
NULL
;
vlc_atomic_set
(
&
p_udt
->
aborted
,
0
);
atomic_store
(
&
p_udt
->
aborted
,
false
);
vlc_clone
(
&
p_udt
->
thread
,
update_DownloadReal
,
p_udt
,
VLC_THREAD_PRIORITY_LOW
);
}
...
...
@@ -590,7 +590,7 @@ static void* update_DownloadReal( void *obj )
if
(
p_progress
==
NULL
)
goto
end
;
while
(
!
vlc_atomic_get
(
&
p_udt
->
aborted
)
&&
while
(
!
atomic_load
(
&
p_udt
->
aborted
)
&&
(
i_read
=
stream_Read
(
p_stream
,
p_buffer
,
1
<<
10
)
)
&&
!
dialog_ProgressCancelled
(
p_progress
)
)
{
...
...
@@ -618,7 +618,7 @@ static void* update_DownloadReal( void *obj )
fclose
(
p_file
);
p_file
=
NULL
;
if
(
!
vlc_atomic_get
(
&
p_udt
->
aborted
)
&&
if
(
!
atomic_load
(
&
p_udt
->
aborted
)
&&
!
dialog_ProgressCancelled
(
p_progress
)
)
{
dialog_ProgressDestroy
(
p_progress
);
...
...
src/misc/update.h
View file @
331299dc
...
...
@@ -153,7 +153,7 @@ typedef struct
VLC_COMMON_MEMBERS
vlc_thread_t
thread
;
vlc_atomic_t
aborted
;
atomic_bool
aborted
;
update_t
*
p_update
;
char
*
psz_destdir
;
}
update_download_thread_t
;
...
...
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