Skip to content

Commit

Permalink
v1.0.1 (#19)
Browse files Browse the repository at this point in the history
* [OTS-930] Add our own connection to mConnections (#8)

* Fixing .gitignore (#9)

* Adding setInput/OutputSignalProtocol to the api (#10)

* Adding setInput/OutputSignalProtocol to the api

* Fixing ThreadSignalProtocol

* Fixing otconfig builder

* updating version

* Adding slack notification and build status badge (#11)

* Adding logo

* Adding logo image

* [OTS-937] Change signal listening to a thread pool and make log customizable (#13)

* [OTS-937] Process the signals on a Thread Pool

* [OTS-937] Disable ThreadPool logs

* Modifying url for travis job (#14)

* Fix 1.0.1 (#15)

* Version 1.0.1

* Fixing Changelog style

* Fixing Changelog

* [OTS-937] Make the log level customizable from outside of the package

* Fixing logging (#16)

* Move Contributing Guidelines to .github/ (#17)

* Fixes 1.0.1 (#18)

* Fixing logging

* Updating 1.0.1
  • Loading branch information
marinaserranomontes authored Feb 10, 2017
1 parent 7e13764 commit b6dd9fe
Show file tree
Hide file tree
Showing 19 changed files with 601 additions and 97 deletions.
74 changes: 74 additions & 0 deletions .github/CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
**opentok/accelerator-core-ios** Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
File renamed without changes.
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## New issue checklist
<!-- Before submitting this issue, make sure you have done the following -->

- [ ] I have read all of the [`README`](https://github.com/opentok/accelerator-core-ios/blob/master/README.md)
- [ ] I have searched [existing issues](https://github.com/opentok/accelerator-core-ios/issues?q=is%3Aissue+sort%3Acreated-desc) and **this is not a duplicate**.

### General information

- Library version(s):
- iOS/Android/Browser version(s):
- Devices/Simulators/Machine affected:
- Reproducible in the demo project? (Yes/No):
- Related issues:

## Bug report

#### Expected behavior

> ...
#### Actual behavior

> ...
#### Steps to reproduce

> ...
#### Crash log? Screenshots? Videos? Sample project?

>...
## Question or Feature Request

> ...
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Pull request checklist

- [ ] All tests pass. Demo project builds and runs.
- [ ] I have resolved any merge conflicts. Confirmation: ____

#### This fixes issue #___.

## What's in this pull request?

>...
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
All notable changes to this project will be documented in this file.

--------------------------------------

####[1.0.1]

[ADDED] Simple LogWrapper above the android.util.Log class

[ADDED] Fixes for signal protocol

####[1.0.0]

Official release
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
![logo](tokbox-logo.png)

[![Build Status](https://travis-ci.com/opentok/accelerator-core-android.svg?token=CxoLD2TL8UCwsuAUJUsN&branch=master)](https://travis-ci.com/opentok/accelerator-core-android)

#Accelerator Core Android
[![Build Status](https://travis-ci.org/opentok/accelerator-core-android.svg?branch=master)](https://travis-ci.org/opentok/accelerator-core-android)

##Quickstart
The Accelerator Core Android library gives you an easy way to integrate [OpenTok SDK](https://tokbox.com) to any Android applications.
Expand Down
4 changes: 2 additions & 2 deletions accelerator-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ android {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0.0"
versionName "1.0.1"
project.archivesBaseName = "opentok-accelerator-core"
project.version = "1.0.0"
project.version = "1.0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.tokbox.android.otsdkwrapper;

/**
* Global log level for this module. Change it to the maximum log level you want to get for all
* modules.
*/
public class GlobalLogLevel {
public static short sMaxLogLevel = 0xFF;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import android.view.View;

import com.opentok.android.BaseVideoCapturer;
import com.tokbox.android.otsdkwrapper.GlobalLogLevel;
import com.tokbox.android.otsdkwrapper.utils.LogWrapper;

import java.io.FileOutputStream;
import java.nio.Buffer;
Expand All @@ -23,7 +25,12 @@
*/
public class ScreenSharingCapturer extends BaseVideoCapturer{
private static final String LOG_TAG = ScreenSharingCapturer.class.getSimpleName();
private Context mContext;
private static final short LOCAL_LOG_LEVEL = 0xFF;
private static final LogWrapper LOG =
new LogWrapper((short)(GlobalLogLevel.sMaxLogLevel & LOCAL_LOG_LEVEL));
public static void setLogLevel(short logLevel) {
LOG.setLogLevel(logLevel);
}

private boolean capturing = false;
private View contentView;
Expand Down Expand Up @@ -74,7 +81,6 @@ public void run() {
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
public ScreenSharingCapturer(Context context, View view, ImageReader imageReader) {
this.mContext = context;
this.contentView = view;
this.mImageReader = imageReader;
this.mImageReader.setOnImageAvailableListener(new ImageAvailableListener(), null);
Expand All @@ -91,14 +97,15 @@ public void init() {

@Override
public int startCapture() {
LOG.d(LOG_TAG, "Start Screensharing Capturer");
capturing = true;

mHandler.postDelayed(newFrame, 1000 / fps);
return 0;
}

@Override
public int stopCapture() {
LOG.d(LOG_TAG, "Stop Screensharing Capturer");
capturing = false;
mHandler.removeCallbacks(newFrame);
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,25 @@
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.ViewGroup;

import com.tokbox.android.otsdkwrapper.GlobalLogLevel;
import com.tokbox.android.otsdkwrapper.utils.LogWrapper;

/**
* Represents a headless fragment to enable the screensharing by default
*/
public class ScreenSharingFragment extends Fragment {

private static final String LOG_TAG = ScreenSharingFragment.class.getSimpleName();
private static final short LOCAL_LOG_LEVEL = 0xFF;
private static final LogWrapper LOG =
new LogWrapper((short)(GlobalLogLevel.sMaxLogLevel & LOCAL_LOG_LEVEL));
public static void setLogLevel(short logLevel) {
LOG.setLogLevel(logLevel);
}


private static final String ERROR = "ScreenSharing error";
private static final int REQUEST_MEDIA_PROJECTION = 1;
Expand Down Expand Up @@ -87,7 +96,6 @@ public void onCreate(Bundle savedInstanceState) {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onActivityCreated(Bundle savedInstanceState) {

super.onActivityCreated(savedInstanceState);

Activity activity = getActivity();
Expand All @@ -107,7 +115,7 @@ public void onActivityCreated(Bundle savedInstanceState) {
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_MEDIA_PROJECTION) {
if (resultCode != Activity.RESULT_OK) {
Log.i(LOG_TAG, "User cancelled screensharing permission");
LOG.i(LOG_TAG, "User cancelled screensharing permission");
mListener.onError(ERROR + ": User cancelled screensharing permission");
return;
}
Expand All @@ -117,7 +125,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
return;
}

Log.i(LOG_TAG, "Starting screen capture");
LOG.i(LOG_TAG, "Starting screen capture");
mResultCode = resultCode;
mResultData = data;
startScreenCapture();
Expand Down Expand Up @@ -171,15 +179,15 @@ private void tearDownMediaProjection() {
public void startScreenCapture() {

if (mMediaProjection != null) {
Log.i(LOG_TAG, "mMediaProjection != null");
LOG.i(LOG_TAG, "mMediaProjection != null");

setUpVirtualDisplay();
} else if (mResultCode != 0 && mResultData != null) {
Log.i(LOG_TAG, "mResultCode != 0 && mResultData != null");
LOG.i(LOG_TAG, "mResultCode != 0 && mResultData != null");
setUpMediaProjection();
setUpVirtualDisplay();
} else {
Log.i(LOG_TAG, "Requesting confirmation");
LOG.i(LOG_TAG, "Requesting confirmation");
startActivityForResult(
mMediaProjectionManager.createScreenCaptureIntent(),
REQUEST_MEDIA_PROJECTION);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import android.util.Log;

import com.tokbox.android.otsdkwrapper.GlobalLogLevel;
import com.tokbox.android.otsdkwrapper.utils.Callback;
import com.tokbox.android.otsdkwrapper.utils.LogWrapper;

/**
* This class implements a thread that reads from a input signal pipe and invokes a Callback
Expand All @@ -11,6 +13,13 @@
*/
public class SignalProcessorThread<OutputDataType, InputDataType> extends Thread {
private static final String LOG_TAG = SignalProcessorThread.class.getSimpleName();
private static final short LOCAL_LOG_LEVEL = 0xFF;
private static final LogWrapper LOG =
new LogWrapper((short)(GlobalLogLevel.sMaxLogLevel & LOCAL_LOG_LEVEL));

public static void setLogLevel(short logLevel) {
LOG.setLogLevel(logLevel);
}

private SignalProtocol<OutputDataType, InputDataType> mProcessedProtocol;
private boolean mChangingPipe = false;
Expand All @@ -31,8 +40,8 @@ public void run() {
do {
signal = mProcessedProtocol.read();
if (signal != null) {
Log.d(LOG_TAG, "(" + mProcessedProtocol.getClass().getSimpleName() +
"): got a processed signal: " + signal.mSignalName);
LOG.d(LOG_TAG, "(", mProcessedProtocol.getClass().getSimpleName(),
"): got a processed signal: ", signal.mSignalName);
mCallback.run(signal);
} else if (mChangingPipe) {
mChangingPipe = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

import android.util.Log;

import com.tokbox.android.otsdkwrapper.GlobalLogLevel;
import com.tokbox.android.otsdkwrapper.utils.LogWrapper;

import java.util.Collection;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
Expand All @@ -14,6 +17,14 @@ public abstract class ThreadedSignalProtocol<OutputDataType, InputDataType>
extends Thread
implements SignalProtocol<OutputDataType, InputDataType> {
protected final String LOG_TAG = getClass().getSimpleName();
private static final short LOCAL_LOG_LEVEL = 0xFF;
private static final LogWrapper LOG =
new LogWrapper((short)(GlobalLogLevel.sMaxLogLevel & LOCAL_LOG_LEVEL));

public static void setLogLevel(short logLevel) {
LOG.setLogLevel(logLevel);
}


private BlockingQueue<SignalInfo<InputDataType>> mInputQueue;

Expand Down Expand Up @@ -48,15 +59,15 @@ protected abstract Collection<SignalInfo<OutputDataType>> processSignal(
final public void run() {
while (mIsOpen) {
try {
Log.d(LOG_TAG, "Waiting for signal data");
LOG.d(LOG_TAG, "Waiting for signal data");
Collection<SignalInfo<OutputDataType>> processedSignals = processSignal(mInputQueue.take());
if (processedSignals != null) {
for(SignalInfo processedSignal: processedSignals) {
mOutputQueue.add(processedSignal);
}
}
} catch (InterruptedException e) {
Log.d(LOG_TAG, "Got interrupted while waiting for data. isOpen: " + mIsOpen);
LOG.d(LOG_TAG, "Got interrupted while waiting for data. isOpen: ", mIsOpen);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public class ClientLog {

// For internal use only. Please do not modify or remove this code.

public static final String LOG_CLIENT_VERSION = "android-vsol-2.0.0";
public static final String LOG_CLIENT_VERSION = "android-vsol-1.0.1";
public static final String LOG_COMPONENTID = "acceleratorCore";

public static final String LOG_ACTION_CONNECT = "Connect";
Expand Down
Loading

0 comments on commit b6dd9fe

Please sign in to comment.