Path: blob/21.2-virgl/src/gallium/frontends/omx/bellagio/entrypoint.c
4565 views
/**************************************************************************1*2* Copyright 2013 Advanced Micro Devices, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627/*28* Authors:29* Christian König <[email protected]>30*31*/3233#include "entrypoint.h"34#include "vid_dec.h"35#include "vid_enc.h"3637int omx_component_library_Setup(stLoaderComponentType **stComponents)38{39OMX_ERRORTYPE r;4041if (stComponents == NULL)42return 2;4344/* component 0 - video decoder */45r = vid_dec_LoaderComponent(stComponents[0]);46if (r != OMX_ErrorNone)47return OMX_ErrorInsufficientResources;4849/* component 1 - video encoder */50r = vid_enc_LoaderComponent(stComponents[1]);51if (r != OMX_ErrorNone)52return OMX_ErrorInsufficientResources;5354return 2;55}5657OMX_ERRORTYPE omx_workaround_Destructor(OMX_COMPONENTTYPE *comp)58{59omx_base_component_PrivateType* priv = (omx_base_component_PrivateType*)comp->pComponentPrivate;6061priv->state = OMX_StateInvalid;62tsem_up(priv->messageSem);6364/* wait for thread to exit */65pthread_join(priv->messageHandlerThread, NULL);6667return omx_base_component_Destructor(comp);68}697071