VCamera v2.0.3版本的 MD5 值为:0c69d90ea31aeb3cb9d1431fccc77864

以下内容为反编译后的 OooO00o.java 源代码,内容仅作参考


package com.googlecode.mp4parser.authoring.tracks.ttml;

import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.source.rtsp.SessionDescription;
import com.google.android.exoplayer2.text.ttml.TtmlNode;
import com.googlecode.mp4parser.authoring.C0480OooO0Oo;
import com.googlecode.mp4parser.authoring.builder.C0484OooO0Oo;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.StringWriter;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.namespace.NamespaceContext;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class OooO00o {
    public static final String f730OooO0O0 = "http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt";
    public static final String f731OooO0OO = "http://www.w3.org/ns/ttml";
    static byte[] f729OooO00o = "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n    <xsl:output method=\"text\"/>\n    <xsl:key name=\"kElemByNSURI\"\n             match=\"*[namespace::*[not(. = ../../namespace::*)]]\"\n              use=\"namespace::*[not(. = ../../namespace::*)]\"/>\n    <xsl:template match=\"/\">\n        <xsl:for-each select=\n            \"//namespace::*[not(. = ../../namespace::*)]\n                           [count(..|key('kElemByNSURI',.)[1])=1]\">\n            <xsl:value-of select=\"concat(.,'&#xA;')\"/>\n        </xsl:for-each>\n    </xsl:template>\n</xsl:stylesheet>".getBytes();
    public static final NamespaceContext f732OooO0Oo = new OooO0O0(null);

    private static class OooO0O0 implements NamespaceContext {
        private OooO0O0() {
        }

        OooO0O0(OooO0O0 oooO0O0) {
            this();
        }

        @Override
        public String getNamespaceURI(String str) {
            if (str.equals("ttml")) {
                return OooO00o.f731OooO0OO;
            }
            if (str.equals("smpte")) {
                return OooO00o.f730OooO0O0;
            }
            return null;
        }

        @Override
        public String getPrefix(String str) {
            if (str.equals(OooO00o.f731OooO0OO)) {
                return "ttml";
            }
            if (str.equals(OooO00o.f730OooO0O0)) {
                return "smpte";
            }
            return null;
        }

        @Override
        public Iterator getPrefixes(String str) {
            return Arrays.asList("ttml", "smpte").iterator();
        }
    }

    public static String OooO(long j) {
        return OooOO0(j, -1);
    }

    private static long OooO00o(InputStream inputStream, File file) throws IOException {
        byte[] bArr = new byte[16384];
        file.getParentFile().mkdirs();
        FileOutputStream fileOutputStream = new FileOutputStream(file);
        long j = 0;
        while (true) {
            try {
                int read = inputStream.read(bArr);
                if (-1 == read) {
                    return j;
                }
                fileOutputStream.write(bArr, 0, read);
                j += read;
            } finally {
                fileOutputStream.close();
            }
        }
    }

    public static void OooO0O0(Document document, File file) throws IOException {
        try {
            NodeList nodeList = (NodeList) XPathFactory.newInstance().newXPath().compile("//*/@backgroundImage").evaluate(document, XPathConstants.NODESET);
            for (int i = 0; i < nodeList.getLength(); i++) {
                URI create = URI.create(nodeList.item(i).getNodeValue());
                if (!create.isAbsolute()) {
                    OooO00o(new URI(document.getDocumentURI()).resolve(create).toURL().openStream(), new File(file.toURI().resolve(create).toURL().getFile()));
                }
            }
            OooO00o(new URI(document.getDocumentURI()).toURL().openStream(), file);
        } catch (URISyntaxException e) {
            throw new IOException(e);
        } catch (XPathExpressionException e2) {
            throw new IOException(e2);
        }
    }

    public static String[] OooO0OO(Document document) {
        try {
            Transformer newTransformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new ByteArrayInputStream(f729OooO00o)));
            StringWriter stringWriter = new StringWriter();
            newTransformer.transform(new DOMSource(document), new StreamResult(stringWriter));
            ArrayList arrayList = new ArrayList(new LinkedHashSet(Arrays.asList(stringWriter.getBuffer().toString().split("\n"))));
            return (String[]) arrayList.toArray(new String[arrayList.size()]);
        } catch (TransformerConfigurationException e) {
            throw new RuntimeException(e);
        } catch (TransformerException e2) {
            throw new RuntimeException(e2);
        }
    }

    public static long OooO0Oo(Node node) {
        long j = 0;
        Node node2 = node;
        while (true) {
            node2 = node2.getParentNode();
            if (node2 == null) {
                break;
            } else if (node2.getAttributes() != null && node2.getAttributes().getNamedItem("begin") != null) {
                j += OooO0oo(node2.getAttributes().getNamedItem("begin").getNodeValue());
            }
        }
        return (node.getAttributes() == null || node.getAttributes().getNamedItem(TtmlNode.END) == null) ? j : OooO0oo(node.getAttributes().getNamedItem(TtmlNode.END).getNodeValue()) + j;
    }

    public static void OooO0o(String[] strArr) throws URISyntaxException, ParserConfigurationException, IOException, SAXException, XPathExpressionException, TransformerException {
        DocumentBuilderFactory newInstance = DocumentBuilderFactory.newInstance();
        newInstance.setNamespaceAware(true);
        OooO0OO oooO0OO = new OooO0OO("a.xml", com.googlecode.mp4parser.authoring.tracks.ttml.OooO0O0.OooO0o0(newInstance.newDocumentBuilder().parse("C:\\dev\\mp4parser\\a.xml"), 60));
        C0480OooO0Oo c0480OooO0Oo = new C0480OooO0Oo();
        c0480OooO0Oo.OooO00o(oooO0OO);
        new C0484OooO0Oo().OooO00o(c0480OooO0Oo).OooOo0O(new FileOutputStream("output.mp4").getChannel());
    }

    public static long OooO0o0(Node node) {
        long j = 0;
        Node node2 = node;
        while (true) {
            node2 = node2.getParentNode();
            if (node2 == null) {
                break;
            } else if (node2.getAttributes() != null && node2.getAttributes().getNamedItem("begin") != null) {
                j += OooO0oo(node2.getAttributes().getNamedItem("begin").getNodeValue());
            }
        }
        return (node.getAttributes() == null || node.getAttributes().getNamedItem("begin") == null) ? j : OooO0oo(node.getAttributes().getNamedItem("begin").getNodeValue()) + j;
    }

    public static void OooO0oO(Document document, OutputStream outputStream, int i) throws IOException {
        try {
            Transformer newTransformer = TransformerFactory.newInstance().newTransformer();
            newTransformer.setOutputProperty("encoding", C.UTF8_NAME);
            if (i > 0) {
                newTransformer.setOutputProperty("indent", "yes");
                newTransformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", Integer.toString(i));
            }
            try {
                newTransformer.transform(new DOMSource(document), new StreamResult(outputStream));
            } catch (TransformerException e) {
                throw new IOException(e);
            }
        } catch (TransformerConfigurationException e2) {
            throw new RuntimeException(e2);
        }
    }

    public static long OooO0oo(String str) {
        long parseDouble;
        Matcher matcher = Pattern.compile("(-?)([0-9][0-9]):([0-9][0-9]):([0-9][0-9])([\\.:][0-9][0-9]?[0-9]?)?").matcher(str);
        if (!matcher.matches()) {
            throw new RuntimeException("Cannot match '" + str + "' to time expression");
        }
        String group = matcher.group(1);
        String group2 = matcher.group(2);
        String group3 = matcher.group(3);
        String group4 = matcher.group(4);
        String group5 = matcher.group(5);
        if (group5 == null) {
            group5 = ".000";
        }
        String replace = group5.replace(":", ".");
        long parseLong = (Long.parseLong(group4) * 1000) + (Long.parseLong(group3) * 60 * 1000) + (Long.parseLong(group2) * 60 * 60 * 1000);
        if (replace.contains(":")) {
            parseDouble = (long) ((Double.parseDouble(SessionDescription.SUPPORTED_SDP_VERSION + replace.replace(":", ".")) * 40.0d * 1000.0d) + parseLong);
        } else {
            parseDouble = (long) ((Double.parseDouble(SessionDescription.SUPPORTED_SDP_VERSION + replace) * 1000.0d) + parseLong);
        }
        return parseDouble * ("-".equals(group) ? -1 : 1);
    }

    public static String OooOO0(long j, int i) {
        String str = j >= 0 ? "" : "-";
        long abs = Math.abs(j);
        long j2 = ((abs / 1000) / 60) / 60;
        long j3 = abs - (((j2 * 1000) * 60) * 60);
        long j4 = (j3 / 1000) / 60;
        long j5 = j3 - ((j4 * 1000) * 60);
        long j6 = j5 / 1000;
        return i >= 0 ? String.format("%s%02d:%02d:%02d:%d", str, Long.valueOf(j2), Long.valueOf(j4), Long.valueOf(j6), Integer.valueOf(i)) : String.format("%s%02d:%02d:%02d.%03d", str, Long.valueOf(j2), Long.valueOf(j4), Long.valueOf(j6), Long.valueOf(j5 - (1000 * j6)));
    }
}