Example #1
0
  /**
   * Start streaming of a LiveTV channel
   *
   * @param channelUid the unique id of the channel
   * @param waitForKeyFrame start streaming after the first IFRAME has been received
   * @param priority priority of the received device on the server
   * @return returns the status of the operation
   */
  public int openStream(int channelUid, String language, boolean waitForKeyFrame, int priority) {
    Packet req =
        CreatePacket(Connection.XVDR_CHANNELSTREAM_OPEN, Connection.XVDR_CHANNEL_REQUEST_RESPONSE);

    req.putU32(channelUid);
    req.putS32(priority); // priority 50
    req.putU8((short) (waitForKeyFrame ? 1 : 0)); // start with IFrame
    req.putString(language);

    Packet resp = transmitMessage(req);

    if (resp == null) {
      return STATUS_NORESPONSE;
    }

    return (int) resp.getU32();
  }