code
stringlengths
73
34.1k
label
stringclasses
1 value
protected Object getSingleExcelRow(Object userObj, String key, boolean isExternalCall) { logger.entering(new Object[] { userObj, key, isExternalCall }); Class<?> cls; try { cls = Class.forName(userObj.getClass().getName()); } catch (ClassNotFoundException e) { thr...
java
private void setValueForArrayType(DataMemberInformation memberInfo) throws IllegalAccessException, ArrayIndexOutOfBoundsException, IllegalArgumentException, InstantiationException { logger.entering(memberInfo); Field eachField = memberInfo.getField(); Object objectToSetDataInto = mem...
java
private void setValueForNonArrayType(DataMemberInformation memberInfo) throws IllegalAccessException, InstantiationException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { logger.entering(memberInfo); Field eachField = memberInfo....
java
public List<String> getHeaderRowContents(String sheetName, int size) { return excelReader.getHeaderRowContents(sheetName, size); }
java
public int getWidth() { try { return ((RemoteWebElement) getElement()).getSize().width; } catch (NumberFormatException e) { throw new WebElementException("Attribute " + WIDTH + " not found for Image " + getLocator(), e); } }
java
public int getHeight() { try { return ((RemoteWebElement) getElement()).getSize().height; } catch (NumberFormatException e) { throw new WebElementException("Attribute " + HEIGHT + " not found for Image " + getLocator(), e); } }
java
void checkPort(int port, String msg) { StringBuilder message = new StringBuilder().append(" ").append(msg); String portInUseError = String.format("Port %d is already in use. Please shutdown the service " + "listening on this port or configure a different port%s.", port, message); ...
java
@Override public Object[][] getDataByIndex(String indexes) throws IOException, DataProviderException { logger.entering(indexes); int[] arrayIndex = DataProviderHelper.parseIndexString(indexes); Object[][] yamlObjRequested = getDataByIndex(arrayIndex); logger.exiting((Obj...
java
public void selectByValue(String value) { getDispatcher().beforeSelect(this, value); new Select(getElement()).selectByValue(value); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.SELECTED, value); } getD...
java
public void selectByLabel(String label) { getDispatcher().beforeSelect(this, label); new Select(getElement()).selectByVisibleText(label); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.SELECTED, label); } ...
java
public void selectByValue(String[] values) { for (int i = 0; i < values.length; i++) { selectByValue(values[i]); } }
java
public void selectByLabel(String[] labels) { for (int i = 0; i < labels.length; i++) { selectByLabel(labels[i]); } }
java
public void selectByIndex(String[] indexes) { for (int i = 0; i < indexes.length; i++) { selectByIndex(Integer.parseInt(indexes[i])); } }
java
public String[] getSelectOptions() { List<WebElement> optionList = getElement().findElements(By.tagName("option")); String[] optionArray = new String[optionList.size()]; for (int i = 0; i < optionList.size(); i++) { optionArray[i] = optionList.get(i).getText(); } retu...
java
public String getSelectedLabel() { List<WebElement> options = getElement().findElements(By.tagName("option")); for (WebElement option : options) { if (option.isSelected()) { return option.getText(); } } return null; }
java
public String getSelectedValue() { List<WebElement> options = getElement().findElements(By.tagName("option")); for (WebElement option : options) { if (option.isSelected()) { return option.getAttribute("value"); } } return null; }
java
public String[] getSelectedLabels() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> selected = new ArrayList<String>(); for (WebElement option : options) { if (option.isSelected()) { selected.add(option.getText()); ...
java
public String[] getSelectedValues() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> selected = new ArrayList<String>(); for (WebElement option : options) { if (option.isSelected()) { selected.add(option.getAttribute("value"))...
java
public String[] getContentLabel() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> contents = new ArrayList<String>(); for (WebElement option : options) { contents.add(option.getText()); } return (String[]) contents.toArray(...
java
public String[] getContentValue() { List<WebElement> options = getElement().findElements(By.tagName("option")); List<String> contents = new ArrayList<String>(); for (WebElement option : options) { contents.add(option.getAttribute("value")); } return (String[]) conte...
java
public void deselectByValue(String value) { getDispatcher().beforeDeselect(this, value); new Select(getElement()).deselectByValue(value); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, value); } ...
java
public void deselectByIndex(int index) { getDispatcher().beforeDeselect(this, index); new Select(getElement()).deselectByIndex(index); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, Integer.toString(index)); } ...
java
public void deselectByLabel(String label) { getDispatcher().beforeDeselect(this, label); new Select(getElement()).deselectByVisibleText(label); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIActions(UIActions.CLEARED, label); } ...
java
public void click(String locator) { getDispatcher().beforeClick(this, locator); getElement().click(); validatePresenceOfAlert(); if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) { logUIAction(UIActions.CLICKED); } WebDriverWaitUtil...
java
private void parseResults() { logger.entering(); if (result.getStatus() == ITestResult.SUCCESS) { this.status = "Passed"; } else if (result.getStatus() == ITestResult.FAILURE) { this.status = "Failed"; } else if (result.getStatus() == ITestResult.SKIP) { ...
java
public String getStackTraceInfo(Throwable aThrowable) { final Writer localWriter = new StringWriter(); final PrintWriter printWriter = new PrintWriter(localWriter); aThrowable.printStackTrace(printWriter); return localWriter.toString(); }
java
public String toJson() { logger.entering(); parseResults(); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String json = gson.toJson(this); logger.exiting(json); return json; }
java
public static synchronized ConfigParser setConfigFile(String file) { LOGGER.entering(file); if (configuration == null) { configFile = file; } LOGGER.exiting(parser.toString()); return parser; }
java
public List<String> getRowContents(Row row, int size) { logger.entering(new Object[] { row, size }); List<String> rowData = new ArrayList<String>(); if (row != null) { for (int i = 1; i <= size; i++) { String data = null; if (row.getCell(i) != null) { ...
java
public int getRowIndex(String sheetName, String key) { logger.entering(new Object[] { sheetName, key }); int index = -1; Sheet sheet = fetchSheet(sheetName); int rowCount = sheet.getPhysicalNumberOfRows(); for (int i = 0; i < rowCount; i++) { Row row = sheet.getRow(i...
java
static List<String> getExecutableNames() { List<String> executableNames = new ArrayList<>(); if (Platform.getCurrent().is(Platform.WINDOWS)) { Collections.addAll(executableNames, ProcessNames.PHANTOMJS.getWindowsImageName(), ProcessNames.CHROMEDRIVER.getWindowsImageName()...
java
static String extractMsi(String msiFile) { LOGGER.entering(msiFile); Process process = null; String exeFilePath = null; boolean isMsiExtracted = true; try { process = Runtime.getRuntime().exec( new String[] { "msiexec", "/a", msiFile, "/qn", "TARG...
java
public RemoteWebDriver createDriver(MobileNodeType nodeType, WebDriverPlatform platform, CommandExecutor command, URL url, Capabilities caps) { if (mobileProviders.containsKey(nodeType)) { logger.log(Level.FINE, "Found mobile driver provider that supports " +...
java
public static void waitUntilElementIsClickable(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.elementToBeClickable(by); waitForCondition(condition); ...
java
public static void waitUntilElementIsInvisible(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<Boolean> condition = ExpectedConditions.invisibilityOfElementLocated(by); waitForCondition(condition); ...
java
public static void waitUntilElementIsPresent(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.presenceOfElementLocated(by); waitForCondition(condition); ...
java
public static void waitUntilElementIsVisible(final String elementLocator) { logger.entering(elementLocator); By by = HtmlElementUtils.resolveByType(elementLocator); ExpectedCondition<WebElement> condition = ExpectedConditions.visibilityOfElementLocated(by); waitForCondition(condition); ...
java
public static void waitUntilPageTitleContains(final String pageTitle) { logger.entering(pageTitle); Preconditions .checkArgument(StringUtils.isNotEmpty(pageTitle), "Expected Page title cannot be null (or) empty."); ExpectedCondition<Boolean> condition = ExpectedConditions.titleCo...
java
public static void waitUntilTextPresent(final String searchString) { logger.entering(searchString); Preconditions.checkArgument(StringUtils.isNotEmpty(searchString), "Search string cannot be null (or) empty."); ExpectedCondition<Boolean> conditionToCheck = new ExpectedCondition<Boolean>() { ...
java
public static void waitUntilAllElementsArePresent(final String... locators) { logger.entering(new Object[] { Arrays.toString(locators) }); Preconditions.checkArgument(locators != null, "Please provide a valid set of locators."); for (String eachLocator : locators) { waitUntilElementI...
java
public static boolean changePassword(String userName, String newPassword) { LOGGER.entering(userName, newPassword.replaceAll(".", "*")); boolean changeSucceeded = false; File authFile = new File(AUTH_FILE_LOCATION); try { authFile.delete(); authFile.createNewFile(...
java
protected void parse(String json) { logger.entering(json); try { Gson gson = new Gson(); BaseLog baseLog = gson.fromJson(json, this.getClass()); this.msg = baseLog.msg; this.screen = baseLog.screen; this.location = baseLog.location; ...
java
public void shutdown() throws Exception { if (type == null) { return; } if (type instanceof Hub) { ((Hub) type).stop(); } if (type instanceof SelfRegisteringRemote) { ((SelfRegisteringRemote) type).stopRemoteServer(); } if (type...
java
public void boot(String[] args) throws Exception { SeLionStandaloneConfiguration configuration = new SeLionStandaloneConfiguration(); JCommander commander = new JCommander(); commander.setAcceptUnknownOptions(true); commander.addObject(configuration); commander.parse(args); ...
java
@Override public void dragToValue(double value) { logger.entering(value); WebElement webElement = findElement(locator); Point currentLocation = webElement.getLocation(); Dimension elementSize = webElement.getSize(); int x = currentLocation.getX(); int y = currentLocat...
java
public void exiting(Object object) { if (!getLogger().isLoggable(Level.FINER)) { return; } FrameInfo fi = getLoggingFrame(); getLogger().exiting(fi.className, fi.methodName, object); }
java
private static FrameInfo getLoggingFrame() { StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); StackTraceElement loggingFrame = null; /* * We need to dig through all the frames until we get to a frame that contains this class, then dig through all * frame...
java
@Override public void onStart(ISuite suite) { logger.entering(suite); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } // Nothing should query for SeLionConfig values before this point. ...
java
public static String filterOutputDirectory(String base, String suiteName) { logger.entering(new Object[] { base, suiteName }); int index = base.lastIndexOf(suiteName); String outputFolderWithoutName = base.substring(0, index); logger.exiting(outputFolderWithoutName + File.separator); ...
java
@Override public void onFinish(ISuite suite) { logger.entering(suite); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } LocalGridManager.shutDownHub(); logger.exiting(); }
java
@Override public void onStart(ITestContext context) { logger.entering(context); if (ListenerManager.isCurrentMethodSkipped(this)) { logger.exiting(ListenerManager.THREAD_EXCLUSION_MSG); return; } String testName = context.getCurrentXmlTest().getName(); ...
java
private void invokeInitializersBasedOnPriority(ITestContext context) { ServiceLoader<Initializer> serviceLoader = ServiceLoader.load(Initializer.class); List<AbstractConfigInitializer> loader = new ArrayList<AbstractConfigInitializer>(); for (Initializer l : serviceLoader) { loader.a...
java
@Override public boolean filter(Object data) { logger.entering(data); String[] keyValues = filterKeyValues.split(","); String tempKey = null; Field field; try { field = data.getClass().getDeclaredField(filterKeyName); field.setAccessible(true); ...
java
public static void isValidXpath(String locator) { logger.entering(locator); Preconditions.checkArgument(StringUtils.isNotBlank(locator), INVALID_LOCATOR_ERR_MSG); if (locator.startsWith("xpath=/") || locator.startsWith("/")) { throw new UnsupportedOperationException( ...
java
public static boolean isElementPresent(String locator) { logger.entering(locator); boolean flag = false; try { flag = HtmlElementUtils.locateElement(locator) != null; } catch (NoSuchElementException e) { // NOSONAR } logger.exiting(flag); return flag; ...
java
String getSubFolderName() { if (subFolderName == null) { String relPath = getAbsolutePath().replace(REPO_ABSOLUTE_PATH, ""); relPath = relPath.substring(relPath.indexOf(SystemUtils.FILE_SEPARATOR) + 1); String[] parts = relPath.split("[\\\\/]"); subFolderName = ((...
java
private CommandLine createCommandForChildProcess() throws IOException { LOGGER.entering(); CommandLine cmdLine = CommandLine.parse("appium"); // add the program argument / dash options cmdLine.addArguments(getProgramArguments()); LOGGER.exiting(cmdLine.toString()); ret...
java
public MgcpSignal provide(String pkg, String signal, int requestId, NotifiedEntity notifiedEntity, Map<String, String> parameters, MgcpEndpoint endpoint) throws UnrecognizedMgcpPackageException, UnsupportedMgcpSignalException { switch (pkg) { case AudioPackage.PACKAGE_NAME: ...
java
public boolean contains(Format format) { for (Format f : list) { if (f.matches(format)) return true; } return false; }
java
public void intersection(Formats other, Formats intersection) { intersection.list.clear(); for (Format f1 : list) { for (Format f2 : other.list) { if (f1.matches(f2)) intersection.list.add(f2); } } }
java
public void add(Task task) { synchronized(LOCK) { //terminated task will be selected immediately before start task.setListener(this); this.task[wi] = task; wi++; } }
java
private void continueExecution() { //increment task index i++; //submit next if the end of the chain not reached yet if (i < task.length && task[i] != null) { scheduler.submit(task[i]); } else if (listener != null) { listener.onTerminatio...
java
public char getDataLength() { char length = 0; List<StunAttribute> attrs = getAttributes(); for (StunAttribute att : attrs) { int attLen = att.getDataLength() + StunAttribute.HEADER_LENGTH; // take attribute padding into account: attLen += (4 - (attLen % 4)) % 4; length += attLen; } return leng...
java
public void addAttribute(StunAttribute attribute) throws IllegalArgumentException { if (getAttributePresentity(attribute.getAttributeType()) == N_A) { throw new IllegalArgumentException("The attribute " + attribute.getName() + " is not allowed in a " + getName()); } synchronized (attributes) { attributes.p...
java
public void setTransactionID(byte[] tranID) throws StunException { if (tranID == null || (tranID.length != TRANSACTION_ID_LENGTH && tranID.length != RFC3489_TRANSACTION_ID_LENGTH)) throw new StunException(StunException.ILLEGAL_ARGUMENT, "Invalid transaction id length"); int tranIDLength = tranID.length; this....
java
protected byte getAttributePresentity(char attributeType) { if (!rfc3489CompatibilityMode) { return O; } byte msgIndex = -1; byte attributeIndex = -1; switch (messageType) { case BINDING_REQUEST: msgIndex = BINDING_REQUEST_PRESENTITY_INDEX; break; case BINDING_SUCCESS_RESPONSE: msgIndex = BI...
java
public String getName() { switch (messageType) { case ALLOCATE_REQUEST: return "ALLOCATE-REQUEST"; case ALLOCATE_RESPONSE: return "ALLOCATE-RESPONSE"; case ALLOCATE_ERROR_RESPONSE: return "ALLOCATE-ERROR-RESPONSE"; case BINDING_REQUEST: return "BINDING-REQUEST"; case BINDING_SUCCESS_RESPONSE: ...
java
public byte[] encode() throws IllegalStateException { prepareForEncoding(); // make sure we have everything necessary to encode a proper message validateAttributePresentity(); final char dataLength = getDataLength(); byte binMsg[] = new byte[HEADER_LENGTH + dataLength]; int offset = 0; // STUN Message...
java
private void prepareForEncoding() { // remove MESSAGE-INTEGRITY and FINGERPRINT attributes so that we can // make sure they are added at the end. StunAttribute msgIntAttr = removeAttribute(StunAttribute.MESSAGE_INTEGRITY); StunAttribute fingerprint = removeAttribute(StunAttribute.FINGERPRINT); // add a SOFTW...
java
private static void performAttributeSpecificActions(StunAttribute attribute, byte[] binMessage, int offset, int msgLen) throws StunException { // check finger print CRC if (attribute instanceof FingerprintAttribute) { if (!validateFingerprint((FingerprintAttribute) attribute, binMessage, offset, msgLen)) { ...
java
protected void validateAttributePresentity() throws IllegalStateException { if (!rfc3489CompatibilityMode) { return; } for (char i = StunAttribute.MAPPED_ADDRESS; i < StunAttribute.REFLECTED_FROM; i++) { if (getAttributePresentity(i) == M && getAttribute(i) == null) { throw new IllegalStateException("A...
java
public static SessionDescription buildSdp(boolean offer, String localAddress, String externalAddress, MediaChannel... channels) { // Session-level fields SessionDescription sd = new SessionDescription(); sd.setVersion(new VersionField((short) 0)); String originAddress = (externalAddress == null || externalAddre...
java
public static void rejectMediaField(SessionDescription answer, MediaDescriptionField media) { MediaDescriptionField rejected = new MediaDescriptionField(); rejected.setMedia(media.getMedia()); rejected.setPort(0); rejected.setProtocol(media.getProtocol()); rejected.setPayloadTypes(media.getPayloadTypes()); ...
java
protected void setDescriptor(Text line) throws ParseException { line.trim(); try { //split using equal sign Iterator<Text> it = line.split('=').iterator(); //skip first token (m) Text t = it.next(); //select second token (media_type port prof...
java
protected void addAttribute(Text attribute) { if (attribute.startsWith(SessionDescription.RTPMAP)) { addRtpMapAttribute(attribute); return; } if (attribute.startsWith(SessionDescription.FMTP)) { addFmtAttribute(attribute); return; } ...
java
private void addCandidate(Text attribute) { // Copy and trim the attribute Text attr = new Text(); attribute.copy(attr); attr.trim(); // Parse the candidate field and add it to list of candidates CandidateField candidateField = new CandidateField(attr); this.candidates.add(candidateField); // Candida...
java
protected void setConnection(Text line) throws ParseException { connection = new ConnectionField(); connection.strain(line); Collections.sort(this.candidates); }
java
private RTPFormat createFormat(int payload, Text description) { MediaType mtype = MediaType.fromDescription(mediaType); switch (mtype) { case AUDIO: return createAudioFormat(payload, description); case VIDEO: return createVideoFormat(payload, description); case APPLICATION: return createApplicationFo...
java
private RTPFormat createAudioFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate //TODO : convert to sample...
java
private RTPFormat createVideoFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate //TODO : convert to frame ...
java
private RTPFormat createApplicationFormat(int payload, Text description) { Iterator<Text> it = description.split('/').iterator(); //encoding name Text token = it.next(); token.trim(); EncodingName name = new EncodingName(token); //clock rate token = it.next(); ...
java
private boolean isTypeValid(char type) { return (type == MAPPED_ADDRESS || type == RESPONSE_ADDRESS || type == SOURCE_ADDRESS || type == CHANGED_ADDRESS || type == REFLECTED_FROM || type == XOR_MAPPED_ADDRESS || type == ALTERNATE_SERVER || type == XOR_PEER_ADDRESS || type == XOR_RELAYED_ADDRESS || typ...
java
public static boolean isSubclass(Class a, Class b) { if (a == b) return false; if (!(b.isAssignableFrom(a))) return false; return true; }
java
public void append(byte[] data, int len) { if (data == null || len <= 0 || len > data.length) { throw new IllegalArgumentException("Invalid combination of parameters data and length to append()"); } int oldLimit = buffer.limit(); // grow buffer if necessary grow(len...
java
public int readInt(int off) { this.buffer.rewind(); return ((buffer.get(off++) & 0xFF) << 24) | ((buffer.get(off++) & 0xFF) << 16) | ((buffer.get(off++) & 0xFF) << 8) | (buffer.get(off++) & 0xFF); }
java
public byte[] readRegion(int off, int len) { this.buffer.rewind(); if (off < 0 || len <= 0 || off + len > this.buffer.limit()) { return null; } byte[] region = new byte[len]; this.buffer.get(region, off, len); return region; }
java
public void readRegionToBuff(int off, int len, byte[] outBuff) { assert off >= 0; assert len > 0; assert outBuff != null; assert outBuff.length >= len; assert buffer.limit() >= off + len; buffer.position(off); buffer.get(outBuff, 0, len); }
java
public int readUnsignedShortAsInt(int off) { this.buffer.position(off); int b1 = (0x000000FF & (this.buffer.get())); int b2 = (0x000000FF & (this.buffer.get())); int val = b1 << 8 | b2; return val; }
java
public long readUnsignedIntAsLong(int off) { buffer.position(off); return (((long)(buffer.get() & 0xff) << 24) | ((long)(buffer.get() & 0xff) << 16) | ((long)(buffer.get() & 0xff) << 8) | ((long)(buffer.get() & 0xff))) & 0xFFFFFFFFL; }
java
public void shrink(int delta) { if (delta <= 0) { return; } int newLimit = buffer.limit() - delta; if (newLimit <= 0) { newLimit = 0; } this.buffer.limit(newLimit); }
java
public void recycle() { while(buffer.size()>0) buffer.poll().recycle(); if(activeFrame!=null) activeFrame.recycle(); activeFrame=null; activeData=null; byteIndex=0; }
java
public void bind(boolean isLocal) throws IOException, SocketException { try { rtpChannel = udpManager.open(rtpHandler); // if control enabled open rtcp channel as well if (channelsManager.getIsControlEnabled()) { rtcpChannel = udpManager.open(new RTCPHandler()); } } catch (IOException e) { throw...
java
public void setPeer(SocketAddress address) { this.remotePeer = address; boolean connectImmediately = false; if (rtpChannel != null) { if (rtpChannel.isConnected()) try { rtpChannel.disconnect(); } catch (IOException e) { logger.error(e); } connectImmediately = udpManager .connect...
java
public void close() { if (rtpChannel != null) { if (rtpChannel.isConnected()) { try { rtpChannel.disconnect(); } catch (IOException e) { logger.error(e); } try { rtpChannel.socket().close(); rtpChannel.close(); } catch (IOException e) { logger.error(e); } } } ...
java
public boolean isAvailable() { // The channel is available is is connected boolean available = this.rtpChannel != null && this.rtpChannel.isConnected(); // In case of WebRTC calls the DTLS handshake must be completed if(this.isWebRtc) { available = available && this.webRtcHandler.isHandshakeComplete(); } ...
java
public void enableWebRTC(Text remotePeerFingerprint) { this.isWebRtc = true; if (this.webRtcHandler == null) { this.webRtcHandler = new DtlsHandler(this.dtlsServerProvider); } this.webRtcHandler.setRemoteFingerprint("sha-256", remotePeerFingerprint.toString()); }
java
public void open() { // generate a new unique identifier for the channel this.ssrc = SsrcGenerator.generateSsrc(); this.statistics.setSsrc(this.ssrc); this.open = true; if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " is open"); } }
java
public void close() throws IllegalStateException { if (this.open) { // Close channels this.rtpChannel.close(); if (!this.rtcpMux) { this.rtcpChannel.close(); } if(logger.isDebugEnabled()) { logger.debug(this.mediaType + " channel " + this.ssrc + " is closed"); } // Reset state res...
java
private void reset() { // Reset codecs resetFormats(); // Reset channels if (this.rtcpMux) { this.rtcpMux = false; } // Reset ICE if (this.ice) { disableICE(); } // Reset WebRTC if (this.dtls) { disableDTLS(); } // Reset statistics this.statistics.reset(); this.cname = ""; ...
java
protected void setFormats(RTPFormats formats) { try { this.rtpChannel.setFormatMap(formats); this.rtpChannel.setOutputFormats(formats.getFormats()); } catch (FormatNotSupportedException e) { // Never happens logger.warn("Could not set output formats", e); } }
java