Lines Matching refs:priv

52 #define CHECK_INIT(mix, priv) \  argument
60 priv = MIX_VIDEO_PRIVATE(mix); \
61 if (!priv->initialized) { \
66 #define CHECK_INIT_CONFIG(mix, priv) \ argument
67 CHECK_INIT(mix, priv); \
68 if (!priv->configured) { \
132 MixVideoPrivate *priv = MIX_VIDEO_GET_PRIVATE(self); in mix_video_init() local
135 self->context = priv; in mix_video_init()
142 mix_video_private_initialize(priv); in mix_video_init()
195 void mix_video_private_initialize(MixVideoPrivate* priv) { in mix_video_private_initialize() argument
196 priv->objlock = NULL; in mix_video_private_initialize()
197 priv->initialized = FALSE; in mix_video_private_initialize()
198 priv->configured = FALSE; in mix_video_private_initialize()
201 priv->va_display = NULL; in mix_video_private_initialize()
202 priv->va_major_version = -1; in mix_video_private_initialize()
203 priv->va_major_version = -1; in mix_video_private_initialize()
206 priv->frame_manager = NULL; in mix_video_private_initialize()
207 priv->video_format = NULL; in mix_video_private_initialize()
208 priv->video_format_enc = NULL; //for encoding in mix_video_private_initialize()
209 priv->surface_pool = NULL; in mix_video_private_initialize()
210 priv->buffer_pool = NULL; in mix_video_private_initialize()
212 priv->codec_mode = MIX_CODEC_MODE_DECODE; in mix_video_private_initialize()
213 priv->init_params = NULL; in mix_video_private_initialize()
214 priv->drm_params = NULL; in mix_video_private_initialize()
215 priv->config_params = NULL; in mix_video_private_initialize()
218 void mix_video_private_cleanup(MixVideoPrivate* priv) { in mix_video_private_cleanup() argument
222 if (!priv) { in mix_video_private_cleanup()
226 if (priv->video_format_enc) { in mix_video_private_cleanup()
227 mix_videofmtenc_deinitialize(priv->video_format_enc); in mix_video_private_cleanup()
230 MIXUNREF(priv->frame_manager, mix_framemanager_unref) in mix_video_private_cleanup()
231 MIXUNREF(priv->video_format, mix_videoformat_unref) in mix_video_private_cleanup()
232 MIXUNREF(priv->video_format_enc, mix_videoformatenc_unref) in mix_video_private_cleanup()
234 MIXUNREF(priv->buffer_pool, mix_bufferpool_unref) in mix_video_private_cleanup()
235 MIXUNREF(priv->surface_pool, mix_surfacepool_unref) in mix_video_private_cleanup()
237 MIXUNREF(priv->drm_params, mix_drmparams_unref) in mix_video_private_cleanup()
238 MIXUNREF(priv->config_params, mix_videoconfigparams_unref) in mix_video_private_cleanup()
241 if (priv->va_display) { in mix_video_private_cleanup()
242 va_status = vaTerminate(priv->va_display); in mix_video_private_cleanup()
247 priv->va_display = NULL; in mix_video_private_cleanup()
251 MIXUNREF(priv->init_params, mix_videoinitparams_unref) in mix_video_private_cleanup()
253 priv->va_major_version = -1; in mix_video_private_cleanup()
254 priv->va_major_version = -1; in mix_video_private_cleanup()
256 if (priv->objlock) { in mix_video_private_cleanup()
257 g_mutex_free(priv->objlock); in mix_video_private_cleanup()
258 priv->objlock = NULL; in mix_video_private_cleanup()
261 priv->codec_mode = MIX_CODEC_MODE_DECODE; in mix_video_private_cleanup()
262 priv->initialized = FALSE; in mix_video_private_cleanup()
263 priv->configured = FALSE; in mix_video_private_cleanup()
288 MixVideoPrivate *priv = NULL; in mix_video_initialize_default() local
321 priv = MIX_VIDEO_PRIVATE(mix); in mix_video_initialize_default()
323 if (priv->initialized) { in mix_video_initialize_default()
339 priv->objlock = g_mutex_new(); in mix_video_initialize_default()
340 if (!priv->objlock) { in mix_video_initialize_default()
347 priv->codec_mode = mode; in mix_video_initialize_default()
350 priv->init_params = (MixVideoInitParams *) mix_params_ref(MIX_PARAMS( in mix_video_initialize_default()
352 if (!priv->init_params) { in mix_video_initialize_default()
365 ret = mix_videoinitparams_get_display(priv->init_params, &mix_display); in mix_video_initialize_default()
387 priv->va_display = vaGetDisplay(display); in mix_video_initialize_default()
390 if (!priv->va_display) { in mix_video_initialize_default()
397 va_status = vaInitialize(priv->va_display, &priv->va_major_version, in mix_video_initialize_default()
398 &priv->va_minor_version); in mix_video_initialize_default()
409 priv->initialized = TRUE; in mix_video_initialize_default()
416 mix_video_private_cleanup(priv); in mix_video_initialize_default()
428 MixVideoPrivate *priv = NULL; in mix_video_deinitialize_default() local
432 CHECK_INIT(mix, priv); in mix_video_deinitialize_default()
434 mix_video_private_cleanup(priv); in mix_video_deinitialize_default()
444 MixVideoPrivate *priv = NULL; in mix_video_configure_decode() local
455 CHECK_INIT(mix, priv); in mix_video_configure_decode()
468 g_mutex_lock(priv->objlock); in mix_video_configure_decode()
476 if (priv->configured) { in mix_video_configure_decode()
483 priv->config_params = (MixVideoConfigParams *) mix_params_dup(MIX_PARAMS( in mix_video_configure_decode()
485 if (!priv->config_params) { in mix_video_configure_decode()
491 priv_config_params_dec = (MixVideoConfigParamsDec *)priv->config_params; in mix_video_configure_decode()
542 priv->frame_manager = mix_framemanager_new(); in mix_video_configure_decode()
543 if (!priv->frame_manager) { in mix_video_configure_decode()
553 ret = mix_framemanager_initialize(priv->frame_manager, in mix_video_configure_decode()
556 ret = mix_framemanager_initialize(priv->frame_manager, in mix_video_configure_decode()
566 priv->buffer_pool = mix_bufferpool_new(); in mix_video_configure_decode()
567 if (!priv->buffer_pool) { in mix_video_configure_decode()
573 ret = mix_bufferpool_initialize(priv->buffer_pool, bufpoolsize); in mix_video_configure_decode()
594 priv->video_format = MIX_VIDEOFORMAT(video_format); in mix_video_configure_decode()
608 priv->video_format = MIX_VIDEOFORMAT(video_format); in mix_video_configure_decode()
671 priv->video_format = MIX_VIDEOFORMAT(video_format); in mix_video_configure_decode()
683 ret = mix_videofmt_initialize(priv->video_format, priv_config_params_dec, in mix_video_configure_decode()
684 priv->frame_manager, priv->buffer_pool, &priv->surface_pool, in mix_video_configure_decode()
685 priv->va_display); in mix_video_configure_decode()
692 mix_surfacepool_ref(priv->surface_pool); in mix_video_configure_decode()
696 priv->configured = TRUE; in mix_video_configure_decode()
702 MIXUNREF(priv->config_params, mix_videoconfigparams_unref); in mix_video_configure_decode()
703 MIXUNREF(priv->frame_manager, mix_framemanager_unref); in mix_video_configure_decode()
704 MIXUNREF(priv->buffer_pool, mix_bufferpool_unref); in mix_video_configure_decode()
705 MIXUNREF(priv->video_format, mix_videoformat_unref); in mix_video_configure_decode()
712 g_mutex_unlock(priv->objlock); in mix_video_configure_decode()
725 MixVideoPrivate *priv = NULL; in mix_video_configure_encode() local
738 CHECK_INIT(mix, priv); in mix_video_configure_encode()
750 g_mutex_lock(priv->objlock); in mix_video_configure_encode()
758 if (priv->configured) { in mix_video_configure_encode()
765 priv->config_params = (MixVideoConfigParams *) mix_params_dup( in mix_video_configure_encode()
767 if (!priv->config_params) { in mix_video_configure_encode()
773 priv_config_params_enc = (MixVideoConfigParamsEnc *)priv->config_params; in mix_video_configure_encode()
803 priv->frame_manager = mix_framemanager_new(); in mix_video_configure_encode()
804 if (!priv->frame_manager) { in mix_video_configure_encode()
812 ret = mix_framemanager_initialize(priv->frame_manager, frame_order_mode, in mix_video_configure_encode()
821 priv->buffer_pool = mix_bufferpool_new(); in mix_video_configure_encode()
822 if (!priv->buffer_pool) { in mix_video_configure_encode()
828 ret = mix_bufferpool_initialize(priv->buffer_pool, bufpoolsize); in mix_video_configure_encode()
850 priv->video_format_enc = MIX_VIDEOFORMATENC(video_format_enc); in mix_video_configure_encode()
865 priv->video_format_enc = MIX_VIDEOFORMATENC(video_format_enc); in mix_video_configure_encode()
878 priv->video_format_enc = MIX_VIDEOFORMATENC(video_format_enc); in mix_video_configure_encode()
890 ret = mix_videofmtenc_initialize(priv->video_format_enc, in mix_video_configure_encode()
891 priv_config_params_enc, priv->frame_manager, NULL, &priv->surface_pool, in mix_video_configure_encode()
892 priv->va_display); in mix_video_configure_encode()
899 mix_surfacepool_ref(priv->surface_pool); in mix_video_configure_encode()
901 priv->configured = TRUE; in mix_video_configure_encode()
907 MIXUNREF(priv->frame_manager, mix_framemanager_unref); in mix_video_configure_encode()
908 MIXUNREF(priv->config_params, mix_videoconfigparams_unref); in mix_video_configure_encode()
909 MIXUNREF(priv->buffer_pool, mix_bufferpool_unref); in mix_video_configure_encode()
910 MIXUNREF(priv->video_format_enc, mix_videoformatenc_unref); in mix_video_configure_encode()
917 g_mutex_unlock(priv->objlock); in mix_video_configure_encode()
930 MixVideoPrivate *priv = NULL; in mix_video_configure_default() local
934 CHECK_INIT(mix, priv); in mix_video_configure_default()
941 if (priv->codec_mode == MIX_CODEC_MODE_DECODE && MIX_IS_VIDEOCONFIGPARAMSDEC(config_params)) { in mix_video_configure_default()
943 …} else if (priv->codec_mode == MIX_CODEC_MODE_ENCODE && MIX_IS_VIDEOCONFIGPARAMSENC(config_params)… in mix_video_configure_default()
958 MixVideoPrivate *priv = NULL; in mix_video_get_config_default() local
960 CHECK_INIT_CONFIG(mix, priv); in mix_video_get_config_default()
968 g_mutex_lock(priv->objlock); in mix_video_get_config_default()
970 *config_params = MIX_VIDEOCONFIGPARAMS(mix_params_dup(MIX_PARAMS(priv->config_params))); in mix_video_get_config_default()
980 g_mutex_unlock(priv->objlock); in mix_video_get_config_default()
992 MixVideoPrivate *priv = NULL; in mix_video_decode_default() local
996 CHECK_INIT_CONFIG(mix, priv); in mix_video_decode_default()
1003 ret = mix_surfacepool_check_available(priv->surface_pool); in mix_video_decode_default()
1010 g_mutex_lock(priv->objlock); in mix_video_decode_default()
1012 ret = mix_videofmt_decode(priv->video_format, bufin, bufincnt, decode_params); in mix_video_decode_default()
1014 g_mutex_unlock(priv->objlock); in mix_video_decode_default()
1026 MixVideoPrivate *priv = NULL; in mix_video_get_frame_default() local
1028 CHECK_INIT_CONFIG(mix, priv); in mix_video_get_frame_default()
1036 g_mutex_lock(priv->objlock); in mix_video_get_frame_default()
1040 ret = mix_framemanager_dequeue(priv->frame_manager, frame); in mix_video_get_frame_default()
1043 g_mutex_unlock(priv->objlock); in mix_video_get_frame_default()
1056 MixVideoPrivate *priv = NULL; in mix_video_release_frame_default() local
1058 CHECK_INIT_CONFIG(mix, priv); in mix_video_release_frame_default()
1071 g_mutex_lock(priv->objlock); in mix_video_release_frame_default()
1081 g_mutex_unlock(priv->objlock); in mix_video_release_frame_default()
1096 MixVideoPrivate *priv = NULL; in mix_video_render_default() local
1113 CHECK_INIT_CONFIG(mix, priv); in mix_video_render_default()
1134 g_mutex_lock(priv->objlock); in mix_video_render_default()
1205 va_status = vaPutSurface(priv->va_display, (VASurfaceID) va_surface_id, in mix_video_render_default()
1228 g_mutex_unlock(priv->objlock); in mix_video_render_default()
1242 MixVideoPrivate *priv = NULL; in mix_video_encode_default() local
1246 CHECK_INIT_CONFIG(mix, priv); in mix_video_encode_default()
1252 g_mutex_lock(priv->objlock); in mix_video_encode_default()
1254 ret = mix_videofmtenc_encode(priv->video_format_enc, bufin, bufincnt, in mix_video_encode_default()
1257 g_mutex_unlock(priv->objlock); in mix_video_encode_default()
1266 MixVideoPrivate *priv = NULL; in mix_video_flush_default() local
1270 CHECK_INIT_CONFIG(mix, priv); in mix_video_flush_default()
1273 g_mutex_lock(priv->objlock); in mix_video_flush_default()
1275 if (priv->codec_mode == MIX_CODEC_MODE_DECODE && priv->video_format != NULL) { in mix_video_flush_default()
1276 ret = mix_videofmt_flush(priv->video_format); in mix_video_flush_default()
1278 ret = mix_framemanager_flush(priv->frame_manager); in mix_video_flush_default()
1279 } else if (priv->codec_mode == MIX_CODEC_MODE_ENCODE in mix_video_flush_default()
1280 && priv->video_format_enc != NULL) { in mix_video_flush_default()
1282 ret = mix_videofmtenc_flush(priv->video_format_enc); in mix_video_flush_default()
1284 g_mutex_unlock(priv->objlock); in mix_video_flush_default()
1290 g_mutex_unlock(priv->objlock); in mix_video_flush_default()
1301 MixVideoPrivate *priv = NULL; in mix_video_eos_default() local
1305 CHECK_INIT_CONFIG(mix, priv); in mix_video_eos_default()
1308 g_mutex_lock(priv->objlock); in mix_video_eos_default()
1310 if (priv->codec_mode == MIX_CODEC_MODE_DECODE && priv->video_format != NULL) { in mix_video_eos_default()
1311 ret = mix_videofmt_eos(priv->video_format); in mix_video_eos_default()
1314 ret = mix_framemanager_eos(priv->frame_manager); in mix_video_eos_default()
1315 } else if (priv->codec_mode == MIX_CODEC_MODE_ENCODE in mix_video_eos_default()
1316 && priv->video_format_enc != NULL) { in mix_video_eos_default()
1318 ret = mix_videofmtenc_eos(priv->video_format_enc); in mix_video_eos_default()
1320 g_mutex_unlock(priv->objlock); in mix_video_eos_default()
1326 g_mutex_unlock(priv->objlock); in mix_video_eos_default()
1335 MixVideoPrivate *priv = NULL; in mix_video_get_state_default() local
1339 CHECK_INIT_CONFIG(mix, priv); in mix_video_get_state_default()
1356 MixVideoPrivate *priv = NULL; in mix_video_get_mixbuffer_default() local
1360 CHECK_INIT_CONFIG(mix, priv); in mix_video_get_mixbuffer_default()
1368 g_mutex_lock(priv->objlock); in mix_video_get_mixbuffer_default()
1370 ret = mix_bufferpool_get(priv->buffer_pool, buf); in mix_video_get_mixbuffer_default()
1373 g_mutex_unlock(priv->objlock); in mix_video_get_mixbuffer_default()
1384 MixVideoPrivate *priv = NULL; in mix_video_release_mixbuffer_default() local
1388 CHECK_INIT_CONFIG(mix, priv); in mix_video_release_mixbuffer_default()
1396 g_mutex_lock(priv->objlock); in mix_video_release_mixbuffer_default()
1401 g_mutex_unlock(priv->objlock); in mix_video_release_mixbuffer_default()
1411 MixVideoPrivate *priv = NULL; in mix_video_get_max_coded_buffer_size_default() local
1421 CHECK_INIT_CONFIG(mix, priv); in mix_video_get_max_coded_buffer_size_default()
1423 g_mutex_lock(priv->objlock); in mix_video_get_max_coded_buffer_size_default()
1425 ret = mix_videofmtenc_get_max_coded_buffer_size(priv->video_format_enc, max_size); in mix_video_get_max_coded_buffer_size_default()
1427 g_mutex_unlock(priv->objlock); in mix_video_get_max_coded_buffer_size_default()