Beispiel #1
0
  /** open sub output and move the input source of main output to sub. */
  private void changeModeToPip() {
    //		 mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    //		 mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_PIP);
    //		 TVOutput mOutput = mTvInputManager.getOutput("main");
    //		 String mString = null;
    //		 if (null != mOutput) {
    //		 mString = mOutput.getInput().getName();
    //		 }
    //		 if (null != mString) {
    //		 mTvInputManager.changeInputSource("sub", mString);
    //		 setScreenPos();
    //		 setTvViewPosition();
    //		 mTvContent.setScreenPosition("sub", x, y, w, h);
    //		 }
    try {
      if (null != mtv) {
        mtv.enterOutputMode(ITVCommon.OUTPUT_MODE_APP_PIP);
      }

      //			TVCommonNative.getDefault(mContext)
    } catch (RemoteException e) {
      e.printStackTrace();
    }
    setScreenPos();
    setTvViewPosition();
    mTvContent.setScreenPosition("sub", x, y, w, h);
  }
Beispiel #2
0
  public void switchOutputMode() {
    if (TurnkeyUiMainActivity.isResume) {
      MtkLog.i(TAG, "tk ui is running, can't change output mode.");
      return;
    }

    GetCurrentTask ctask = GetCurrentTask.getInstance(mContext);

    if (ctask.isCurActivtyMeidaMainActivity()) {
      toastNofunction();
      return;
    }

    if (!ctask.isCurTaskTKUI() && null != mtv) {
      try {
        int currentOutputMode = mtv.getCurrentOutputMode();
        if (ITVCommon.OUTPUT_MODE_NORMAL == currentOutputMode) {
          pipOn = false;
        }
      } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }

      //			 if (isCurrentModePIP()) {
      //			 DestroyApp.getTVDialogView(mContext.getApplicationContext())
      //			 .hide();
      //			 // changeModeToNormal();
      //			 TVOutputCommon common = TVOutputCommon.getInstance(mContext);
      //			 common.stop("sub");
      //			 } else {
      //			 changeModeToPip();
      //			 DestroyApp.getTVDialogView(mContext.getApplicationContext())
      //			 .show(mContext);
      //			 }
      if (pipOn) {
        DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
        // changeModeToNormal();
        TVOutputCommon common = TVOutputCommon.getInstance(mContext);
        mTvContent.setScreenPosition("sub", 0, 0, 0, 0);
        // common.stop("sub");
        common.stopEx("sub", true);
        pipOn = false;
      } else {
        changeModeToPip();
        DestroyApp.getTVDialogView(mContext.getApplicationContext()).show(mContext);
        //				DestroyApp.getTVDialogView(mContext.getApplicationContext())
        //						.startCheckPosition();
        pipOn = true;
      }
    }
  }
Beispiel #3
0
  public void resumeMainOutput() {
    setTvNormal(true);
    MtkLog.i(TAG, "~~~~~~~~~~~~~~~~~enter resumeMainOutput");

    mTvContent.enterTV();

    //		mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    try {
      if (null != mtv) {
        mtv.enterOutputMode(ITVCommon.OUTPUT_MODE_NORMAL);
      }

    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    TVOutput output = mTvInputManager.getOutput("main");
    if (null != output) {
      output.connect(output.getInput());
    }
    DestroyApp.getTVDialogView(mContext.getApplicationContext()).hide();
  }
Beispiel #4
0
  public void changeModeToNormal() {
    try {
      if (null != mtv) {
        mtv.enterOutputMode(ITVCommon.OUTPUT_MODE_NORMAL);
      }
      pipOn = false;
    } catch (RemoteException e) {
      e.printStackTrace();
    }
    // mTvInputManager.enterOutputMode(TVInputCommon.OUTPUT_MODE_NORMAL);
    //	mTvContent.setColorKey(false, 0xfff74dff);
    // String mString =
    // mTvInputManager.getOutput("sub").getInput().getName();
    // mTvInputManager.enterOutputMode(TVInputManager.OUTPUT_MODE_NORMAL);
    // mTvInputManager.changeInputSource("main", mString);
    // }

    // if (!isCurrentModeNormal()) {
    // TVOutput output = mTvInputManager.getOutput("sub");
    // output.stop();
    // }
  }