_init_vaapi_context_debug (void)
{
#ifndef GST_DISABLE_GST_DEBUG
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_INIT (gst_debug_vaapi_context, "vaapicontext", 0,
struct _GstVaapiContext
{
/*< private >*/
- volatile gint ref_count;
+ gint ref_count;
GstVaapiDisplay *display;
GstVaapiID object_id;
GType
gst_vaapi_encoder_tune_get_type (void)
{
- static volatile gsize g_type = 0;
+ static gsize g_type = 0;
static const GEnumValue encoder_tune_values[] = {
/* *INDENT-OFF* */
GType
gst_vaapi_encoder_mbbrc_get_type (void)
{
- static volatile gsize g_type = 0;
+ static gsize g_type = 0;
if (g_once_init_enter (&g_type)) {
static const GEnumValue encoder_mbbrc_values[] = {
{
GstVaapiFilterOp op;
GParamSpec *pspec;
- volatile gint ref_count;
+ gint ref_count;
guint va_type;
guint va_subtype;
gpointer va_caps;
op_data->op = op;
op_data->pspec = pspec;
- op_data->ref_count = 1;
+ g_atomic_int_set (&op_data->ref_count, 1);
op_data->va_buffer = VA_INVALID_ID;
switch (op) {
return NULL;
object->object_class = object_class;
- object->ref_count = 1;
+ g_atomic_int_set (&object->ref_count, 1);
object->flags = 0;
return object;
}
{
/*< private >*/
gconstpointer object_class;
- volatile gint ref_count;
+ gint ref_count;
guint flags;
};
gl_get_curent_api_once ()
{
static GstVaapiGLApi cur_api = GST_VAAPI_GL_API_NONE;
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
cur_api = gl_get_current_api (NULL, NULL);
g_cond_broadcast (&display->gl_thread_ready);
g_mutex_unlock (&display->mutex);
- while (!display->gl_thread_cancel) {
+ while (!g_atomic_int_get (&display->gl_thread_cancel)) {
EglMessage *const msg =
g_async_queue_timeout_pop (display->gl_queue, 100000);
static void
egl_display_finalize (EglDisplay * display)
{
- display->gl_thread_cancel = TRUE;
+ g_atomic_int_set (&display->gl_thread_cancel, TRUE);
g_thread_join (display->gl_thread);
g_cond_clear (&display->gl_thread_ready);
g_mutex_clear (&display->mutex);
GMutex mutex;
GThread *gl_thread;
GCond gl_thread_ready;
- volatile gboolean gl_thread_cancel;
+ gboolean gl_thread_cancel;
GAsyncQueue *gl_queue;
gboolean created;
};
GType
gst_vaapi_point_get_type (void)
{
- static volatile gsize g_type = 0;
+ static gsize g_type = 0;
if (g_once_init_enter (&g_type)) {
GType type =
GType
gst_vaapi_rectangle_get_type (void)
{
- static volatile gsize g_type = 0;
+ static gsize g_type = 0;
if (g_once_init_enter (&g_type)) {
GType type =
GType
gst_vaapi_render_mode_get_type (void)
{
- static volatile gsize g_type = 0;
+ static gsize g_type = 0;
static const GEnumValue render_modes[] = {
{GST_VAAPI_RENDER_MODE_OVERLAY,
GType
gst_vaapi_rotation_get_type (void)
{
- static volatile gsize g_type = 0;
+ static gsize g_type = 0;
static const GEnumValue rotation_values[] = {
{GST_VAAPI_ROTATION_0,
GType
gst_vaapi_rate_control_get_type (void)
{
- static volatile gsize g_type = 0;
+ static gsize g_type = 0;
static const GEnumValue rate_control_values[] = {
{GST_VAAPI_RATECONTROL_NONE,
guint is_shown:1;
guint fullscreen_on_show:1;
guint sync_failed:1;
- volatile guint num_frames_pending;
+ guint num_frames_pending;
gint configure_pending;
gboolean need_vpp;
gboolean dmabuf_broken;
_init_performance_debug (void)
{
#ifndef GST_DISABLE_GST_DEBUG
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_GET (CAT_PERFORMANCE, "GST_PERFORMANCE");
gst_vaapisink_event_thread (GstVaapiSink * sink)
{
GST_OBJECT_LOCK (sink);
- while (!sink->event_thread_cancel) {
+ while (!g_atomic_int_get (&sink->event_thread_cancel)) {
GST_OBJECT_UNLOCK (sink);
sink->backend->handle_events (sink);
g_usleep (G_USEC_PER_SEC / 20);
if (sink->backend->pre_start_event_thread)
sink->backend->pre_start_event_thread (sink);
- sink->event_thread_cancel = FALSE;
+ g_atomic_int_set (&sink->event_thread_cancel, FALSE);
sink->event_thread = g_thread_try_new ("vaapisink-events",
(GThreadFunc) gst_vaapisink_event_thread, sink, NULL);
} else if (!handle_events && sink->event_thread) {
/* Grab thread and mark it as NULL */
thread = sink->event_thread;
sink->event_thread = NULL;
- sink->event_thread_cancel = TRUE;
+ g_atomic_int_set (&sink->event_thread_cancel, TRUE);
}
GST_OBJECT_UNLOCK (sink);
guint color_standard;
gint32 view_id;
GThread *event_thread;
- volatile gboolean event_thread_cancel;
+ gboolean event_thread_cancel;
/* Color balance values */
guint cb_changed;
_init_context_debug (void)
{
#ifndef GST_DISABLE_GST_DEBUG
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
_init_performance_debug (void)
{
#ifndef GST_DISABLE_GST_DEBUG
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_GET (CAT_PERFORMANCE, "GST_PERFORMANCE");
_init_vaapi_video_memory_debug (void)
{
#ifndef GST_DISABLE_GST_DEBUG
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_INIT (gst_debug_vaapivideomemory, "vaapivideomemory", 0,
GstVaapiDisplay *display;
GstVaapiDecoder *decoder;
GThread *decoder_thread;
- volatile gboolean decoder_thread_cancel;
+ gboolean decoder_thread_cancel;
GAsyncQueue *decoder_queue;
GstVaapiCodec codec;
guint fps_n;
guint window_width;
guint window_height;
GThread *render_thread;
- volatile gboolean render_thread_cancel;
+ gboolean render_thread_cancel;
GCond render_ready;
RenderFrame *last_frame;
GError *error;
pts = g_get_monotonic_time ();
ofs = 0;
- while (!app->decoder_thread_cancel) {
+ while (!g_atomic_int_get (&app->decoder_thread_cancel)) {
if (G_UNLIKELY (ofs == app->file_size))
buffer = NULL;
else {
{
g_timer_stop (app->timer);
- app->decoder_thread_cancel = TRUE;
+ g_atomic_int_set (&app->decoder_thread_cancel, TRUE);
g_thread_join (app->decoder_thread);
g_print ("Decoder thread stopped\n");
return TRUE;
g_print ("Render thread started\n");
- while (!app->render_thread_cancel) {
+ while (!g_atomic_int_get (&app->render_thread_cancel)) {
rfp = g_async_queue_timeout_pop (app->decoder_queue, 1000000);
if (rfp && !renderer_process (app, rfp))
break;
static gboolean
stop_renderer (App * app)
{
- app->render_thread_cancel = TRUE;
+ g_atomic_int_set (&app->render_thread_cancel, TRUE);
g_thread_join (app->render_thread);
g_print ("Render thread stopped\n");