package com.tencent.mm.plugin.story.model.g;

import a.l;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.g.b.a.ak;
import com.tencent.mm.loader.g.c;
import com.tencent.mm.plugin.story.g.h;
import com.tencent.mm.plugin.story.h.j;
import com.tencent.mm.plugin.story.model.g;
import com.tencent.mm.plugin.story.model.g.a;

@l(dWo = {1, 1, 13}, dWp = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u0000 \u00122\u00020\u0001:\u0001\u0012B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\b\u001a\u00020\tH\u0016J\u001a\u0010\n\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\r2\u0006\u0010\u000e\u001a\u00020\u000fH\u0002J\u0010\u0010\u0010\u001a\u00020\u000b2\u0006\u0010\u000e\u001a\u00020\u000fH\u0002J\b\u0010\u0011\u001a\u00020\rH\u0016R\u001a\u0010\u0002\u001a\u00020\u0003X\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\u0004¨\u0006\u0013"}, dWq = {"Lcom/tencent/mm/plugin/story/model/upload/UploadTask;", "Lcom/tencent/mm/loader/loader/IWorkTask;", "storyInfo", "Lcom/tencent/mm/plugin/story/storage/StoryInfo;", "(Lcom/tencent/mm/plugin/story/storage/StoryInfo;)V", "getStoryInfo", "()Lcom/tencent/mm/plugin/story/storage/StoryInfo;", "setStoryInfo", "call", "", "checkRemuxVideo", "", "filePath", "", "postInfo", "Lcom/tencent/mm/protocal/protobuf/StoryMediaPostInfo;", "doUploadStory", "uniqueId", "Companion", "plugin-story_release"})
public final class e extends c {
    private static final String TAG = TAG;
    public static final a rXU = new a((byte) 0);
    private j rXz;

    @l(dWo = {1, 1, 13}, dWp = {"\u0000#\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J \u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\tH\u0016¨\u0006\n"}, dWq = {"com/tencent/mm/plugin/story/model/upload/UploadTask$doUploadStory$sightUpload$1", "Lcom/tencent/mm/plugin/story/model/StoryCdnUpload$ISightCdnUploadCallback;", "onSightUpLoadEnd", "", "errorCode", "", "isOk", "", "upload", "Lcom/tencent/mm/plugin/story/model/StoryCdnUpload;", "plugin-story_release"})
    public static final class d implements a {
        final /* synthetic */ e rXX;

        d(e eVar) {
            this.rXX = eVar;
        }

        public final void a(int i, boolean z, g gVar) {
            AppMethodBeat.i(109478);
            a.f.b.j.p(gVar, "upload");
            h hVar = h.scu;
            h.cAC().aW((long) i);
            hVar = h.scu;
            ak cAC = h.cAC();
            long currentTimeMillis = System.currentTimeMillis();
            h hVar2 = h.scu;
            cAC.aV(currentTimeMillis - h.cAC().Fu());
            hVar = h.scu;
            h.cAD();
            if (z) {
                this.rXX.a(com.tencent.mm.loader.g.h.eRj);
                AppMethodBeat.o(109478);
                return;
            }
            this.rXX.a(com.tencent.mm.loader.g.h.eRk);
            AppMethodBeat.o(109478);
        }
    }

    public e(j jVar) {
        a.f.b.j.p(jVar, "storyInfo");
        AppMethodBeat.i(109481);
        this.rXz = jVar;
        AppMethodBeat.o(109481);
    }

    static {
        AppMethodBeat.i(109482);
        AppMethodBeat.o(109482);
    }

    /* JADX WARNING: Removed duplicated region for block: B:23:0x0198  */
    public final void Pa() {
        /*
        r20 = this;
        r2 = 109479; // 0x1aba7 float:1.53413E-40 double:5.409E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r2);
        r0 = r20;
        r2 = r0.rXz;
        r15 = r2.cBU();
        r0 = r20;
        r2 = r0.rXz;
        r2 = r2.cBR();
        r2 = r2.xeA;
        r2 = r2.wbK;
        r3 = 0;
        r2 = r2.get(r3);
        r2 = (com.tencent.mm.protocal.protobuf.cek) r2;
        r3 = com.tencent.mm.plugin.story.model.l.rTg;
        r3 = r2.Id;
        r16 = com.tencent.mm.plugin.story.model.l.aat(r3);
        r3 = com.tencent.mm.plugin.story.model.l.rTg;
        r3 = r2.Id;
        r17 = com.tencent.mm.plugin.story.model.l.aas(r3);
        r3 = r15.wFD;
        r4 = com.tencent.mm.plugin.story.h.a.e.sdz;
        r4 = com.tencent.mm.plugin.story.h.a.e.cBz();
        if (r3 != r4) goto L_0x0049;
    L_0x003b:
        r2 = com.tencent.mm.loader.g.h.eRj;
        r0 = r20;
        r0.a(r2);
        r2 = 109479; // 0x1aba7 float:1.53413E-40 double:5.409E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);
    L_0x0048:
        return;
    L_0x0049:
        r3 = r15.eRu;
        r4 = 5;
        if (r3 <= r4) goto L_0x006d;
    L_0x004e:
        r2 = com.tencent.mm.plugin.story.model.g.f.rXY;
        r0 = r20;
        r3 = r0.rXz;
        r4 = -1;
        r5 = "";
        r2 = com.tencent.mm.plugin.story.model.g.e.b.rXV;
        r2 = (a.f.a.a) r2;
        com.tencent.mm.plugin.story.model.g.f.a(r3, r4, r5, r2);
        r2 = com.tencent.mm.loader.g.h.eRk;
        r0 = r20;
        r0.a(r2);
        r2 = 109479; // 0x1aba7 float:1.53413E-40 double:5.409E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);
        goto L_0x0048;
    L_0x006d:
        r4 = com.tencent.mm.vfs.e.asZ(r16);
        r6 = 0;
        r3 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1));
        if (r3 >= 0) goto L_0x0096;
    L_0x0077:
        r2 = com.tencent.mm.plugin.story.model.g.f.rXY;
        r0 = r20;
        r3 = r0.rXz;
        r4 = -1;
        r5 = "";
        r2 = com.tencent.mm.plugin.story.model.g.e.c.rXW;
        r2 = (a.f.a.a) r2;
        com.tencent.mm.plugin.story.model.g.f.a(r3, r4, r5, r2);
        r2 = com.tencent.mm.loader.g.h.eRk;
        r0 = r20;
        r0.a(r2);
        r2 = 109479; // 0x1aba7 float:1.53413E-40 double:5.409E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);
        goto L_0x0048;
    L_0x0096:
        r3 = com.tencent.mm.plugin.story.h.a.e.sdz;
        r3 = com.tencent.mm.plugin.story.h.a.e.cBB();
        r15.wFD = r3;
        r0 = r20;
        r3 = r0.rXz;
        r4 = r15.toByteArray();
        r5 = "postInfo.toByteArray()";
        a.f.b.j.o(r4, r5);
        r3.bk(r4);
        r3 = com.tencent.mm.plugin.story.model.j.rST;
        r3 = com.tencent.mm.plugin.story.model.j.a.cxT();
        r0 = r20;
        r4 = r0.rXz;
        r4 = r4.xDa;
        r4 = (int) r4;
        r0 = r20;
        r5 = r0.rXz;
        r3.a(r4, r5);
        r3 = com.tencent.mm.plugin.story.model.s.rTV;
        r2 = com.tencent.mm.plugin.story.model.s.a(r2);
        r3 = com.tencent.mm.plugin.zero.b.a.class;
        r3 = com.tencent.mm.kernel.g.K(r3);
        r4 = "MMKernel.service<IConfig…onfigService::class.java)";
        a.f.b.j.o(r3, r4);
        r3 = (com.tencent.mm.plugin.zero.b.a) r3;
        r3 = r3.Nu();
        r4 = "StoryCheckSendVideoBitrateExceed";
        r3 = r3.getValue(r4);
        r4 = 0;
        r3 = com.tencent.mm.sdk.platformtools.bo.getInt(r3, r4);
        r4 = 1;
        if (r3 != r4) goto L_0x0195;
    L_0x00ea:
        r3 = com.tencent.mm.sdk.platformtools.bo.isNullOrNil(r2);
        if (r3 != 0) goto L_0x0195;
    L_0x00f0:
        r3 = TAG;
        r4 = "checkRemuxVideo, filePath:";
        r5 = java.lang.String.valueOf(r2);
        r4 = r4.concat(r5);
        com.tencent.mm.sdk.platformtools.ab.i(r3, r4);
        r3 = com.tencent.mm.plugin.story.c.a.c.rRk;
        r3 = r3.Uw();
        r11 = r3;
        r11 = (com.tencent.mm.plugin.story.c.a.c.a) r11;
        if (r2 != 0) goto L_0x010e;
    L_0x010b:
        a.f.b.j.dWJ();
    L_0x010e:
        r3 = r11.aab(r2);
        if (r3 == 0) goto L_0x01fd;
    L_0x0114:
        r3 = TAG;
        r4 = "checkRemuxVideo, exceed bitrate:";
        r5 = java.lang.String.valueOf(r2);
        r4 = r4.concat(r5);
        com.tencent.mm.sdk.platformtools.ab.i(r3, r4);
        r3 = com.tencent.mm.plugin.story.g.g.sbU;
        com.tencent.mm.plugin.story.g.g.cAk();
        r11.aaa(r2);
        r3 = new java.lang.StringBuilder;
        r3.<init>();
        r3 = r3.append(r2);
        r4 = ".remux";
        r3 = r3.append(r4);
        r3 = r3.toString();
        r4 = TAG;
        r5 = "remux outputFilepath:";
        r6 = java.lang.String.valueOf(r3);
        r5 = r5.concat(r6);
        com.tencent.mm.sdk.platformtools.ab.i(r4, r5);
        r18 = com.tencent.mm.sdk.platformtools.bo.yz();
        r4 = r11.eTi;
        r5 = r11.eTj;
        r6 = r11.videoBitrate;
        r7 = com.tencent.mm.plugin.sight.base.b.qwY;
        r8 = 8;
        r9 = 2;
        r10 = 1103626240; // 0x41c80000 float:25.0 double:5.45263811E-315;
        r11 = r11.eTk;
        r11 = (float) r11;
        r12 = 0;
        r13 = 0;
        r14 = com.tencent.mm.plugin.sight.base.b.qwX;
        r4 = com.tencent.mm.plugin.sight.base.SightVideoJNI.remuxing(r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14);
        r5 = TAG;
        r6 = new java.lang.StringBuilder;
        r7 = "remux cost:";
        r6.<init>(r7);
        r8 = com.tencent.mm.sdk.platformtools.bo.az(r18);
        r6 = r6.append(r8);
        r7 = "ms, ret:";
        r6 = r6.append(r7);
        r6 = r6.append(r4);
        r6 = r6.toString();
        com.tencent.mm.sdk.platformtools.ab.i(r5, r6);
        if (r4 < 0) goto L_0x01c6;
    L_0x0192:
        com.tencent.mm.vfs.e.aQ(r3, r2);
    L_0x0195:
        r2 = 0;
    L_0x0196:
        if (r2 != 0) goto L_0x01be;
    L_0x0198:
        r2 = com.tencent.mm.plugin.story.g.h.scu;
        r2 = com.tencent.mm.plugin.story.g.h.cAC();
        r4 = java.lang.System.currentTimeMillis();
        r2.aV(r4);
        r3 = new com.tencent.mm.plugin.story.model.g.b;
        r0 = r20;
        r4 = r0.rXz;
        r2 = new com.tencent.mm.plugin.story.model.g.e$d;
        r0 = r20;
        r2.<init>(r0);
        r2 = (com.tencent.mm.plugin.story.model.g.a) r2;
        r0 = r16;
        r1 = r17;
        r3.<init>(r4, r0, r1, r2);
        r3.cne();
    L_0x01be:
        r2 = 109479; // 0x1aba7 float:1.53413E-40 double:5.409E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r2);
        goto L_0x0048;
    L_0x01c6:
        r2 = r15.eRu;
        r2 = r2 + 1;
        r15.eRu = r2;
        r0 = r20;
        r2 = r0.rXz;
        r4 = r15.toByteArray();
        r5 = "postInfo.toByteArray()";
        a.f.b.j.o(r4, r5);
        r2.bk(r4);
        r2 = com.tencent.mm.plugin.story.model.j.rST;
        r2 = com.tencent.mm.plugin.story.model.j.a.cxT();
        r0 = r20;
        r4 = r0.rXz;
        r4 = r4.xDa;
        r4 = (int) r4;
        r0 = r20;
        r5 = r0.rXz;
        r2.a(r4, r5);
        com.tencent.mm.vfs.e.deleteFile(r3);
        r2 = com.tencent.mm.loader.g.h.eRk;
        r0 = r20;
        r0.a(r2);
        r2 = 1;
        goto L_0x0196;
    L_0x01fd:
        r2 = TAG;
        r3 = "checkRemuxVideo, no need remux";
        com.tencent.mm.sdk.platformtools.ab.i(r2, r3);
        goto L_0x0195;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.story.model.g.e.Pa():void");
    }

    public final String Pc() {
        AppMethodBeat.i(109480);
        String valueOf = String.valueOf((int) this.rXz.xDa);
        AppMethodBeat.o(109480);
        return valueOf;
    }
}
