Looks for keywords in the codec name to identify its nature ({@link CodecType}).

@param codecInfo the currently inspected codec
@return type of the codec or null if it could bot be guessed
483093
@Nullable
    @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    private CodecType identifyCodecType(@NonNull MediaCodecInfo codecInfo) {

        final String name = codecInfo.getName();
        for (String token : AVC_TYPES) {
            if (name.contains(token)) {
                return CodecType.AVC;
            }
        }
        for (String token : H263_TYPES) {
            if (name.contains(token)) {
                return CodecType.H263;
            }
        }
        for (String token : MPEG4_TYPES) {
            if (name.contains(token)) {
                return CodecType.MPEG4;
            }
        }
        for (String token : AAC_TYPES) {
            if (name.contains(token)) {
                return CodecType.AAC;
            }
        }

        return null;
    }
352335
private static <DeclaredT, RuntimeT> TypeCodec<DeclaredT> uncheckedCast(
      TypeCodec<RuntimeT> codec) {
    @SuppressWarnings("unchecked")
    TypeCodec<DeclaredT> result = (TypeCodec<DeclaredT>) codec;
    return result;
  }
1298223
public Kind getKind() {
        Opcode opcode = getOpcode();
        return (opcode != null ? opcode.kind : Kind.UNKNOWN);
    }
753026
public PolicyInfo determinePolicy(Codec codec) {
    for (PolicyInfo info : configMgr.getAllPolicies()) {
      if (!info.getShouldRaid()) {
        continue;
      }
      
      if (info.getCodecId().equals(codec.id)) {
        return info;
      }
    }
    
    return null;
  }
487104
private static EncodingInfo[] loadEncodingInfo()
    {
        try
        {
            InputStream is; 
                
            SecuritySupport ss = SecuritySupport.getInstance();
            is = ss.getResourceAsStream(ObjectFactory.findClassLoader(),
                                            ENCODINGS_FILE);
            
            // j2objc: if resource wasn't found, load defaults from string.
            if (is == null) {
                is = new ByteArrayInputStream(
                    ENCODINGS_FILE_STR.getBytes(StandardCharsets.UTF_8));
            }

            Properties props = new Properties();
            if (is != null) {
                props.load(is);
                is.close();
            } else {
                // Seems to be no real need to force failure here, let the
                // system do its best... The issue is not really very critical,
                // and the output will be in any case _correct_ though maybe not
                // always human-friendly... :)
                // But maybe report/log the resource problem?
                // Any standard ways to report/log errors (in static context)?
            }

            int totalEntries = props.size();

            List encodingInfo_list = new ArrayList();
            Enumeration keys = props.keys();
            for (int i = 0; i < totalEntries; ++i)
            {
                String javaName = (String) keys.nextElement();
                String val = props.getProperty(javaName);
                int len = lengthOfMimeNames(val);

                String mimeName;
                char highChar;
                if (len == 0)
                {
                    // There is no property value, only the javaName, so try and recover
                    mimeName = javaName;
                    highChar = '\u0000'; // don't know the high code point, will need to test every character
                }
                else
                {
                    try {
                        // Get the substring after the Mime names
                        final String highVal = val.substring(len).trim();
                        highChar = (char) Integer.decode(highVal).intValue();
                    }
                    catch( NumberFormatException e) {
                        highChar = 0;
                    }
                    String mimeNames = val.substring(0, len);
                    StringTokenizer st =
                        new StringTokenizer(mimeNames, ",");
                    for (boolean first = true;
                        st.hasMoreTokens();
                        first = false)
                    {
                        mimeName = st.nextToken();
                        EncodingInfo ei = new EncodingInfo(mimeName, javaName, highChar);
                        encodingInfo_list.add(ei);
                        _encodingTableKeyMime.put(mimeName.toUpperCase(), ei);
                        if (first)
                            _encodingTableKeyJava.put(javaName.toUpperCase(), ei);
                    }
                }
            }
            // Convert the Vector of EncodingInfo objects into an array of them,
            // as that is the kind of thing this method returns.
            EncodingInfo[] ret_ei = new EncodingInfo[encodingInfo_list.size()];
            encodingInfo_list.toArray(ret_ei);
            return ret_ei;
        }
        catch (java.net.MalformedURLException mue)
        {
            throw new org.apache.xml.serializer.utils.WrappedRuntimeException(mue);
        }
        catch (java.io.IOException ioe)
        {
            throw new org.apache.xml.serializer.utils.WrappedRuntimeException(ioe);
        }
    }
667983
public static Encoder lookupEncoder(GrailsApplication grailsApplication, String codecName) {
        ApplicationContext ctx = grailsApplication != null ? grailsApplication.getMainContext() : null;
        if(ctx != null) {
            try {
                CodecLookup codecLookup = ctx.getBean("codecLookup", CodecLookup.class);
                return codecLookup.lookupEncoder(codecName);
            } catch (NoSuchBeanDefinitionException e) {
                // ignore missing codecLookup bean in tests
                log.debug("codecLookup bean is missing from test context.", e);
            }
        }
        return null;
    }
221405
public void writeIncludes(CodeType codeType)
    {
        ClassInfo recClassInfo2 = null;
        ClassFields recClassFields = null;
        try   {
        	ClassInfo recClassInfo = (ClassInfo)this.getMainRecord();
        	String classType = recClassInfo.getField(ClassInfo.CLASS_TYPE).toString();
            String strPackage = this.getPackage(codeType);
            m_StreamOut.writeit("package " + strPackage + ";\n\n");
            m_IncludeNameList.addName(strPackage);     // Don't include this!!!
            if ("interface".equalsIgnoreCase(classType))
                codeType = CodeType.INTERFACE;

            if (codeType == CodeType.THICK)
            {
                //m_StreamOut.writeit("import java.awt.*;\n"); //j Temp
                m_StreamOut.writeit("import java.util.*;\n\n");    //j Temp

                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.db");        // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "thin.base.util");   // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "thin.base.db");   // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.db.event");      // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.db.filter");     // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.field");     // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.field.convert");     // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.field.event");   // Don't include this!!!
                if (("Screen".equalsIgnoreCase(classType)) || ("Report".equalsIgnoreCase(classType)))
                {
                    m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.screen.model");      // Don't include this!!!
                    m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.screen.model.util");     // Don't include this!!!
                }
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.model");      // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "base.util");      // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "model");      // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "model.db");      // Don't include this!!!
                m_IncludeNameList.addPackage(DBConstants.ROOT_PACKAGE + "model.screen");      // Don't include this!!!
            }            
        // Now write the include files for any base classes not in this file or fields with class defs not in file
            recClassInfo2 = new ClassInfo(this);

            recClassFields = new ClassFields(this);
            recClassFields.setKeyArea(ClassFields.CLASS_INFO_CLASS_NAME_KEY);
            SubFileFilter fileBehavior2 = new SubFileFilter(recClassInfo2.getField(ClassInfo.CLASS_NAME), ClassFields.CLASS_INFO_CLASS_NAME, null, null, null, null);
            recClassFields.addListener(fileBehavior2);   // Only read through the class fields

            String strFileName = recClassInfo.getField(ClassInfo.CLASS_SOURCE_FILE).toString();
            
            recClassInfo2.setKeyArea(ClassInfo.CLASS_SOURCE_FILE_KEY);
            StringSubFileFilter fileBehavior = new StringSubFileFilter(strFileName, ClassInfo.CLASS_SOURCE_FILE, null, null, null, null);
            recClassInfo2.addListener(fileBehavior);  // Only select records which match m_strFileName

            recClassInfo2.setKeyArea(ClassInfo.CLASS_SOURCE_FILE_KEY);
            recClassInfo2.close();
            while (recClassInfo2.hasNext())
            {
                recClassInfo2.next();
                if ((codeType == CodeType.THIN) && (!recClassInfo2.isARecord(false)))
                    continue;
                //if ((codeType == CodeType.INTERFACE) && (!recClassInfo2.isARecord(false)))
                //    continue;

                String strBaseRecordClass = recClassInfo2.getField(ClassInfo.BASE_CLASS_NAME).getString();
                if (codeType == CodeType.THICK)
                    m_IncludeNameList.addInclude(strBaseRecordClass, null);  // Include the base class if it isn't in this file
                recClassFields.close();
                while (recClassFields.hasNext())
                {
                    recClassFields.next();
                    
                    if (!((IncludeScopeField)recClassFields.getField(ClassFields.INCLUDE_SCOPE)).includeThis(codeType, false))
                        continue;

                    String strFieldName = recClassFields.getField(ClassFields.CLASS_FIELD_NAME).getString();
                    String strFieldClass = recClassFields.getField(ClassFields.CLASS_FIELD_CLASS).getString();
                    String strReference = "";
                    String strClassFieldType = recClassFields.getField(ClassFields.CLASS_FIELDS_TYPE).toString();
                    if (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_PACKAGE))
                    {
                        if (strFieldClass.length() > 0) if (strFieldClass.charAt(0) == '.')
                        {
                        	ClassProject classProject = (ClassProject)((ReferenceField)recClassInfo2.getField(ClassInfo.CLASS_PROJECT_ID)).getReference();
                        	if ((classProject != null)
                        			&& ((classProject.getEditMode() == DBConstants.EDIT_CURRENT) || (classProject.getEditMode() == DBConstants.EDIT_IN_PROGRESS)))
                        	{
                        		CodeType codeType2 = CodeType.THICK;
                        		if (strFieldClass.startsWith(".thin"))
                        				codeType2 = CodeType.THIN;
                        		if (strFieldClass.startsWith(".res"))
                    				codeType2 = CodeType.RESOURCE_CODE;
                        		strFieldClass = classProject.getFullPackage(CodeType.THICK, strFieldClass);
                        		if (codeType2 != CodeType.THICK)
                        		{
                        			int end = strFieldClass.indexOf(codeType2 == CodeType.THIN ? ".thin" : ".res");
                        			int start = strFieldClass.indexOf('.');
                        			if (start != -1)
                        				start = strFieldClass.indexOf('.', start + 1);
                        			if (start != -1)
                        				strFieldClass = strFieldClass.substring(0, start) + strFieldClass.substring(end);
                        		}
                        	}
                        	else
                        		strFieldClass = DBConstants.ROOT_PACKAGE + strFieldClass.substring(1);
                        }
                        m_IncludeNameList.addPackage(strFieldClass);
                    }
                    else if ((strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_CLASS_PACKAGE))
                        || (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_MODEL_PACKAGE))   // For now
                        || (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_RES_PACKAGE))   // For now
                        || (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_THIN_PACKAGE))   // For now
                        || (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.CLASS_FIELD))   // For now
                        || (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_CLASS)))
                    {
                        CodeType codeType3 = CodeType.THICK;
                        if (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_MODEL_PACKAGE))
                            codeType3 = CodeType.INTERFACE;
                        if (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_RES_PACKAGE))   // For now
                            codeType3 = CodeType.RESOURCE_CODE;
                        if (strClassFieldType.equalsIgnoreCase(ClassFieldsTypeField.INCLUDE_THIN_PACKAGE))   // For now
                            codeType3 = CodeType.THIN;
                        m_IncludeNameList.addInclude(strFieldClass, codeType3);
                        strReference = "Y";
                    }
                    if (recClassFields.getField(ClassFields.CLASS_FIELD_PROTECT).getString().equalsIgnoreCase("S")) // Static, initialize now
                    {
                        if (strReference.length() == 0)
                            strReference = "0";
                        if (strReference.charAt(0) == 'Y')
                            strReference = "null";
                        else
                        {
                            strReference = recClassFields.getField(ClassFields.CLASS_FIELD_INITIAL).getString();
                            if (strReference.length() == 0)
                                strReference = "0";
                        }
                        if (!strReference.equals("(none)"))
                            m_StreamOut.writeit(strFieldClass + " " + strFieldName + " = " + strReference + ";\n");
                    }
                }
                recClassFields.close();
            } // End of write record method(s) loop
            recClassInfo2.removeListener(fileBehavior, true);
            recClassInfo2.close();
        } catch (DBException ex)   {
            ex.printStackTrace();
        } finally   {
            if (recClassInfo2 != null)
                recClassInfo2.free();
            if (recClassFields != null)
                recClassFields.free();
        }
    }
112610
protected <JavaTypeT> TypeCodec<JavaTypeT> codecFor(
      DataType cqlType, GenericType<JavaTypeT> javaType, boolean isJavaCovariant) {
    LOG.trace("[{}] Looking up codec for {} <-> {}", logPrefix, cqlType, javaType);
    TypeCodec<?> primitiveCodec = primitiveCodecsByCode.get(cqlType.getProtocolCode());
    if (primitiveCodec != null && matches(primitiveCodec, javaType, isJavaCovariant)) {
      LOG.trace("[{}] Found matching primitive codec {}", logPrefix, primitiveCodec);
      return uncheckedCast(primitiveCodec);
    }
    for (TypeCodec<?> userCodec : userCodecs) {
      if (userCodec.accepts(cqlType) && matches(userCodec, javaType, isJavaCovariant)) {
        LOG.trace("[{}] Found matching user codec {}", logPrefix, userCodec);
        return uncheckedCast(userCodec);
      }
    }
    return uncheckedCast(getCachedCodec(cqlType, javaType, isJavaCovariant));
  }
1347031
@Inject
    public void setCodecConfiguration(@Nullable Configuration.CodecConfiguration codecConfiguration) {
        if (codecConfiguration != null) {
            configuration.withCodec(codecConfiguration);
        }
    }
629232
public CompressionCodec getCodecByClassName(String classname) {
    if (codecsByClassName == null) {
      return null;
    }
    return codecsByClassName.get(classname);
  }
310630
private String getNameForType( Class<?> type )
    {
        if ( _typeToStringMap.containsKey( type ) )
        {
            return _typeToStringMap.get( type );
        }

        for ( Entry<String, Class<?>> entry : _typeMappings.entrySet() )
        {
            if ( entry.getValue().isAssignableFrom( type ) )
            {
                return entry.getKey();
            }
        }
        return null;
    }
102620
public static Codec getDecoderByName(String avCodecName) throws JavaAVException {
		if (avCodecName == null || avCodecName.isEmpty())
			throw new NullPointerException("Codec name is null or empty.");

		AVCodec avCodec = avcodec_find_decoder_by_name(avCodecName);

		if (avCodec == null || avCodec.isNull())
			throw new JavaAVException("Decoder not found: " + avCodecName);

		Codec codec = new Codec();
		codec.avCodec = avCodec;

		return codec;
	}
111617
def search_function(cls, encoding):
        """"""
        if encoding == cls._codec_name:
            return codecs.CodecInfo(
                name=cls._codec_name,
                encode=cls.encode,
                decode=cls.decode,
            )
        return None
1189100
public CodedValueType getAuditSourceTypeCode() {
        if (EventUtils.isEmptyOrNull(auditSourceTypeCode)) {
            return null;
        }
        AuditSourceType auditSourceType = auditSourceTypeCode.get(0);
        CodedValueType codedValueType = new CodedValueType();
        codedValueType.setCode(auditSourceType.getCode());
        codedValueType.setCodeSystem(auditSourceType.getCodeSystem());
        codedValueType.setCodeSystemName(auditSourceType.getCodeSystemName());
        codedValueType.setOriginalText(auditSourceType.getOriginalText());
        return codedValueType;
    }
934734
public static <T> Codec<T> create(Class<T> cls, Compiler compiler, ICodeGenerator codeGenerator) {
        return create(cls, isDebugEnabled(), null, compiler, getCodeGenerator(cls));
    }
215545
public TypeSignature getTypeDescriptor() {
        if (typeDescriptorStr == null) {
            return null;
        }
        if (typeDescriptor == null) {
            try {
                typeDescriptor = TypeSignature.parse(typeDescriptorStr, declaringClassName);
                typeDescriptor.setScanResult(scanResult);
            } catch (final ParseException e) {
                throw new IllegalArgumentException(e);
            }
        }
        return typeDescriptor;
    }
752022
public static Class<?> getEncoderType(Class<? extends Encoder> clazz) {
        Method[] methods = clazz.getMethods();
        for (Method m : methods) {
            if ("encode".equals(m.getName()) && !m.isBridge()) {
                return m.getParameterTypes()[0];
            }
        }
        throw JsrWebSocketMessages.MESSAGES.unknownEncoderType(clazz);
    }