Examples of Transcoder


Examples of org.azeckoski.reflectutils.transcoders.Transcoder

            XMLTranscoder xt = new XMLTranscoder(true, true, false, false);
            transcoders.put(xt.getHandledFormat(), xt);
            HTMLTranscoder ht = new HTMLTranscoder();
            transcoders.put(ht.getHandledFormat(), ht);
        }
        Transcoder transcoder = transcoders.get(format);
        if (transcoder == null) {
            throw new IllegalArgumentException("Failed to find a transcoder for format, none exists, cannot encode or decode data for format: " + format);
        }
        return transcoder;
    }
View Full Code Here

Examples of org.azeckoski.reflectutils.transcoders.Transcoder

        if (format == null) {
            format = Formats.XML;
        }
        String encoded = "";
        if (data != null) {
            Transcoder transcoder = getTranscoder(format);
            try {
                encoded = transcoder.encode(data, name, properties);
            } catch (RuntimeException e) {
                // convert failure to UOE
                throw new UnsupportedOperationException("Failure encoding data ("+data+") of type ("+data.getClass()+"): " + e.getMessage(), e);
            }
        }
View Full Code Here

Examples of org.azeckoski.reflectutils.transcoders.Transcoder

            format = Formats.XML;
        }
        Map<String, Object> decoded = new ArrayOrderedMap<String, Object>();
        if (data != null && ! "".equals(data)) {
            Object decode = null;
            Transcoder transcoder = getTranscoder(format);
            try {
                decode = transcoder.decode(data);
                if (decode instanceof Map) {
                    decoded = (Map<String, Object>) decode;
                } else {
                    decoded.put(DATA_KEY, decode);
                }
View Full Code Here

Examples of org.jcodings.transcode.Transcoder

        Ruby runtime = context.runtime;

        RubyArray result = runtime.newArray();

        for (int i = 0; i < ec.numTranscoders; i++) {
            Transcoder tr = ec.elements[i].transcoding.transcoder;
            IRubyObject v;
            if (EncodingUtils.DECORATOR_P(tr.getSource(), tr.getDestination())) {
                v = RubyString.newString(runtime, tr.getDestination());
            } else {
                v = runtime.newArray(
                        runtime.getEncodingService().convertEncodingToRubyEncoding(runtime.getEncodingService().findEncodingOrAliasEntry(tr.getSource()).getEncoding()),
                        runtime.getEncodingService().convertEncodingToRubyEncoding(runtime.getEncodingService().findEncodingOrAliasEntry(tr.getDestination()).getEncoding()));
            }
            result.push(v);
        }

        return result;
View Full Code Here

Examples of org.jcodings.transcode.Transcoder

            Object[] result = new Object[ec.numTranscoders];
            int r = 0;

            for (int i = 0; i < ec.numTranscoders; i++) {
                Transcoder tr = ec.elements[i].transcoding.transcoder;
                Object v;
                if (EncodingUtils.DECORATOR_P(tr.getSource(), tr.getDestination())) {
                    v = new RubyString(getContext().getCoreLibrary().getStringClass(), new ByteList(tr.getDestination()));
                } else {
                    Encoding source = runtime.getEncodingService().findEncodingOrAliasEntry(tr.getSource()).getEncoding();
                    Encoding destination = runtime.getEncodingService().findEncodingOrAliasEntry(tr.getDestination()).getEncoding();

                    v = new RubyArray(getContext().getCoreLibrary().getArrayClass(),
                            new Object[]{
                                RubyEncoding.getEncoding(getContext(), source),
                                RubyEncoding.getEncoding(getContext(), destination)
View Full Code Here

Examples of org.jcodings.transcode.Transcoder

            IRubyObject pair = ((RubyArray)convpath).eltOk(n - 1);
            if (pair instanceof RubyArray) {
                byte[] sname = runtime.getEncodingService().getEncodingFromObject(((RubyArray)pair).eltOk(0)).getName();
                byte[] dname = runtime.getEncodingService().getEncodingFromObject(((RubyArray)pair).eltOk(1)).getName();
                TranscoderDB.Entry entry = TranscoderDB.getEntry(sname, dname);
                Transcoder tr = entry.getTranscoder();
                if (tr == null)
                    return -1;
                if (!DECORATOR_P(tr.getSource(), tr.getDestination()) &&
                        tr.compatibility.isEncoder()) {
                    n--;
                    ((RubyArray)convpath).store(len + num_decorators - 1, pair);
                }
            } else {
View Full Code Here

Examples of org.red5.app.sip.trancoders.Transcoder

      throw new Exception("Exception while initializing CallStream");
    }    
       
    listenStream = new ListenStream(scopeProvider.getScope());
   
    Transcoder rtmpToRtpTranscoder, rtpToRtmpTranscoder;
    if (sipCodec.getCodecId() == SpeexCodec.codecId) {
      rtmpToRtpTranscoder = new SpeexToSpeexTranscoder(sipCodec);
      rtpToRtmpTranscoder = new SpeexToSpeexTranscoder(sipCodec, listenStream);
    } else {
      rtmpToRtpTranscoder = new NellyToPcmTranscoder(sipCodec);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.