Skip to content
Snippets Groups Projects
Commit a2a499ef authored by Leo Ma's avatar Leo Ma
Browse files

Have fun

parents
No related branches found
No related tags found
No related merge requests found
Showing
with 930 additions and 0 deletions
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
Sea
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>
\ No newline at end of file
<component name="CopyrightManager">
<settings default="" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="myModules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ProjectJDKs.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Sea.iml" filepath="$PROJECT_DIR$/Sea.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
Yet Another Stream Encoder for Android
======================================
**yasea** is an RTMP streaming client in pure Java for Android for those who
hate JNI development. It combines the source code of both [!srs-sea](https://github.com/ossrs/srs-sea)
and [!SimpleRtmp](https://github.com/faucamp/SimpleRtmp) to encode video in
H.264 and audio in AAC by hardware and upload packets to server over RTMP.
Moreover, hardware encoding produces less CPU overhead than software does. And
the code does not depend on any native library.
Help
----
The project now can sample both video from camera and audio from microphone of
Android mobile and connect and handshake with the remote. Unfortunately it has
some problems with the correct format of RTMP packets which still can not be
identified by the server and Wireshark. Any help is welcome.
/build
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "net.ossrs.sea"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
}
package net.ossrs.sea;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.ossrs.sea">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package net.ossrs.sea;
import android.app.Activity;
import android.content.SharedPreferences;
import android.hardware.Camera;
import android.hardware.Camera.Size;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import java.io.IOException;
import java.util.List;
public class MainActivity extends Activity implements SurfaceHolder.Callback, Camera.PreviewCallback {
private static final String TAG = "SrsPublisher";
private AudioRecord mic = null;
private boolean aloop = false;
private Thread aworker = null;
private SurfaceView mCameraView = null;
private Camera mCamera = null;
private int mPreviewRotation = 90;
private int mDisplayRotation = 90;
private int mCamId = Camera.getNumberOfCameras() - 1; // default camera
private byte[] mYuvFrameBuffer;
private SrsEncoder mEncoder;
// settings storage
private SharedPreferences sp;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
sp = getSharedPreferences("SrsPublisher", MODE_PRIVATE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
setContentView(R.layout.activity_main);
mEncoder = new SrsEncoder();
mYuvFrameBuffer = new byte[SrsEncoder.VWIDTH * SrsEncoder.VHEIGHT * 3 / 2];
// restore data.
SrsEncoder.rtmpUrl = sp.getString("SrsEncoder.rtmpUrl", SrsEncoder.rtmpUrl);
SrsEncoder.vbitrate = sp.getInt("VBITRATE", SrsEncoder.vbitrate);
Log.i(TAG, String.format("initialize rtmp url to %s, vbitrate=%dkbps", SrsEncoder.rtmpUrl, SrsEncoder.vbitrate));
// initialize url.
final EditText efu = (EditText) findViewById(R.id.url);
efu.setText(SrsEncoder.rtmpUrl);
efu.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
String fu = efu.getText().toString();
if (fu == SrsEncoder.rtmpUrl || fu.isEmpty()) {
return;
}
SrsEncoder.rtmpUrl = fu;
Log.i(TAG, String.format("flv url changed to %s", SrsEncoder.rtmpUrl));
SharedPreferences.Editor editor = sp.edit();
editor.putString("SrsEncoder.rtmpUrl", SrsEncoder.rtmpUrl);
editor.commit();
}
});
final EditText evb = (EditText) findViewById(R.id.vbitrate);
evb.setText(String.format("%dkbps", SrsEncoder.vbitrate / 1000));
evb.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
int vb = Integer.parseInt(evb.getText().toString().replaceAll("kbps", ""));
if (vb * 1000 != SrsEncoder.vbitrate) {
SrsEncoder.vbitrate = vb * 1000;
SharedPreferences.Editor editor = sp.edit();
editor.putInt("VBITRATE", SrsEncoder.vbitrate);
editor.commit();
}
}
});
// for camera, @see https://developer.android.com/reference/android/hardware/Camera.html
final Button btnPublish = (Button) findViewById(R.id.publish);
final Button btnStop = (Button) findViewById(R.id.stop);
final Button btnSwitch = (Button) findViewById(R.id.swCam);
final Button btnRotate = (Button) findViewById(R.id.rotate);
mCameraView = (SurfaceView) findViewById(R.id.preview);
mCameraView.getHolder().addCallback(this);
// mCameraView.getHolder().setFormat(SurfaceHolder.SURFACE_TYPE_HARDWARE);
btnPublish.setEnabled(true);
btnStop.setEnabled(false);
btnPublish.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
startPublish();
btnPublish.setEnabled(false);
btnStop.setEnabled(true);
}
});
btnStop.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
stopPublish();
btnPublish.setEnabled(true);
btnStop.setEnabled(false);
}
});
btnSwitch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCamera != null && mEncoder != null) {
mCamId = (mCamId + 1) % Camera.getNumberOfCameras();
stopCamera();
mEncoder.swithCameraFace();
startCamera();
}
}
});
btnRotate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mCamera != null) {
mPreviewRotation = (mPreviewRotation + 90) % 360;
mCamera.setDisplayOrientation(mPreviewRotation);
}
}
});
}
@Override
protected void onResume() {
super.onResume();
final Button btn = (Button) findViewById(R.id.publish);
btn.setEnabled(true);
}
@Override
protected void onPause() {
super.onPause();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
private void startCamera() {
if (mCamera != null) {
Log.d(TAG, "start camera, already started. return");
return;
}
if (mCamId > (Camera.getNumberOfCameras() - 1) || mCamId < 0) {
Log.e(TAG, "####### start camera failed, inviald params, camera No.="+ mCamId);
return;
}
mCamera = Camera.open(mCamId);
Camera.CameraInfo info = new Camera.CameraInfo();
Camera.getCameraInfo(mCamId, info);
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT){
mDisplayRotation = (mPreviewRotation + 180) % 360;
mDisplayRotation = (360 - mDisplayRotation) % 360;
} else {
mDisplayRotation = mPreviewRotation;
}
Camera.Parameters params = mCamera.getParameters();
/* supported preview fps range */
// List<int[]> spfr = params.getSupportedPreviewFpsRange();
// Log.i("Cam", "! Supported Preview Fps Range:");
// int rn = 0;
// for (int[] r : spfr) {
// Log.i("Cam", "\tRange [" + rn++ + "]: " + r[0] + "~" + r[1]);
// }
// /* preview size */
List<Size> sizes = params.getSupportedPreviewSizes();
Log.i("Cam", "! Supported Preview Size:");
for (int i = 0; i < sizes.size(); i++) {
Log.i("Cam", "\tSize [" + i + "]: " + sizes.get(i).width + "x" + sizes.get(i).height);
}
/* picture size */
sizes = params.getSupportedPictureSizes();
Log.i("Cam", "! Supported Picture Size:");
for (int i = 0; i < sizes.size(); i++) {
Log.i("Cam", "\tSize [" + i + "]: " + sizes.get(i).width + "x" + sizes.get(i).height);
}
/***** set parameters *****/
//params.set("orientation", "portrait");
//params.set("orientation", "landscape");
//params.setRotation(90);
params.setPictureSize(SrsEncoder.VWIDTH, SrsEncoder.VHEIGHT);
params.setPreviewSize(SrsEncoder.VWIDTH, SrsEncoder.VHEIGHT);
int[] range = findClosestFpsRange(SrsEncoder.VFPS, params.getSupportedPreviewFpsRange());
params.setPreviewFpsRange(range[0], range[1]);
params.setPreviewFormat(SrsEncoder.VFORMAT);
params.setFlashMode(Camera.Parameters.FLASH_MODE_OFF);
params.setWhiteBalance(Camera.Parameters.WHITE_BALANCE_AUTO);
params.setSceneMode(Camera.Parameters.SCENE_MODE_AUTO);
mCamera.setParameters(params);
mCamera.setDisplayOrientation(mPreviewRotation);
mCamera.addCallbackBuffer(mYuvFrameBuffer);
mCamera.setPreviewCallbackWithBuffer(this);
try {
mCamera.setPreviewDisplay(mCameraView.getHolder());
} catch (IOException e) {
e.printStackTrace();
}
mCamera.startPreview();
}
private void stopCamera() {
if (mCamera != null) {
// need to SET NULL CB before stop preview!!!
mCamera.setPreviewCallback(null);
mCamera.stopPreview();
mCamera.release();
mCamera = null;
}
}
private void onGetYuvFrame(byte[] data) {
mEncoder.onGetYuvFrame(data);
}
@Override
public void onPreviewFrame(byte[] data, Camera c) {
onGetYuvFrame(data);
c.addCallbackBuffer(mYuvFrameBuffer);
}
private void onGetPcmFrame(byte[] pcmBuffer, int size) {
mEncoder.onGetPcmFrame(pcmBuffer, size);
}
private void startAudio() {
if (mic != null) {
return;
}
int bufferSize = 2 * AudioRecord.getMinBufferSize(SrsEncoder.ASAMPLERATE, SrsEncoder.ACHANNEL, SrsEncoder.AFORMAT);
mic = new AudioRecord(MediaRecorder.AudioSource.MIC, SrsEncoder.ASAMPLERATE, SrsEncoder.ACHANNEL, SrsEncoder.AFORMAT, bufferSize);
mic.startRecording();
byte pcmBuffer[] = new byte[4096];
while (aloop && !Thread.interrupted()) {
int size = mic.read(pcmBuffer, 0, pcmBuffer.length);
if (size <= 0) {
Log.e(TAG, "***** audio ignored, no data to read.");
break;
}
onGetPcmFrame(pcmBuffer, size);
}
}
private void stopAudio() {
aloop = false;
if (aworker != null) {
Log.i(TAG, "stop audio worker thread");
aworker.interrupt();
try {
aworker.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
aworker = null;
}
if (mic != null) {
mic.setRecordPositionUpdateListener(null);
mic.stop();
mic.release();
mic = null;
}
}
private void startPublish() {
int ret = mEncoder.start();
if (ret < 0) {
return;
}
startCamera();
aworker = new Thread(new Runnable() {
@Override
public void run() {
android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_AUDIO);
startAudio();
}
});
aloop = true;
aworker.start();
}
private void stopPublish() {
stopAudio();
stopCamera();
mEncoder.stop();
}
private int[] findClosestFpsRange(int expectedFps, List<int[]> fpsRanges) {
expectedFps *= 1000;
int[] closestRange = fpsRanges.get(0);
int measure = Math.abs(closestRange[0] - expectedFps) + Math.abs(closestRange[1] - expectedFps);
for (int[] range : fpsRanges) {
if (range[0] <= expectedFps && range[1] >= expectedFps) {
int curMeasure = Math.abs(range[0] - expectedFps) + Math.abs(range[1] - expectedFps);
if (curMeasure < measure) {
closestRange = range;
measure = curMeasure;
}
}
}
return closestRange;
}
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Log.d(TAG, "surfaceChanged");
}
@Override
public void surfaceCreated(SurfaceHolder arg0) {
Log.d(TAG, "surfaceCreated");
}
@Override
public void surfaceDestroyed(SurfaceHolder arg0) {
Log.d(TAG, "surfaceDestroyed");
}
}
This diff is collapsed.
This diff is collapsed.
package net.ossrs.sea;
import java.io.IOException;
import net.ossrs.sea.rtmp.RtmpPublisher;
import net.ossrs.sea.rtmp.io.RtmpConnection;
/**
* Srs implementation of an RTMP publisher
*
* @author francois, leoma
*/
public class SrsRtmpPublisher implements RtmpPublisher {
private RtmpPublisher rtmpConnection;
/**
* Constructor for URLs in the format: rtmp://host[:port]/application[?streamName]
*
* @param url a RTMP URL in the format: rtmp://host[:port]/application[?streamName]
*/
public SrsRtmpPublisher(String url) {
rtmpConnection = new RtmpConnection(url);
}
@Override
public void connect() throws IOException {
rtmpConnection.connect();
}
@Override
public void shutdown() {
rtmpConnection.shutdown();
}
@Override
public void publish(String publishType) throws IllegalStateException, IOException {
if (publishType == null) {
throw new IllegalStateException("No publish type specified");
}
rtmpConnection.publish(publishType);
}
@Override
public void closeStream() throws IllegalStateException {
rtmpConnection.closeStream();
}
@Override
public void publishVideoData(byte[] data, int dts) throws IllegalStateException {
if (data == null || data.length == 0) {
throw new IllegalStateException("Invalid Video Data");
}
if (dts < 0) {
throw new IllegalStateException("Invalid DTS");
}
rtmpConnection.publishVideoData(data, dts);
}
@Override
public void publishAudioData(byte[] data, int dts) throws IllegalStateException {
if (data == null || data.length == 0) {
throw new IllegalStateException("Invalid Audio Data");
}
if (dts < 0) {
throw new IllegalStateException("Invalid DTS");
}
rtmpConnection.publishAudioData(data, dts);
}
}
package net.ossrs.sea.rtmp;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import android.util.Log;
/**
* Some helper utilities for SHA256, mostly (used during handshake)
* This is separated in order to be more easily replaced on platforms that
* do not have the javax.crypto.* and/or java.security.* packages
*
* This implementation is directly inspired by the RTMPHandshake class of the
* Red5 Open Source Flash Server project
*
* @author francois
*/
public class Crypto {
private static final String TAG = "Crypto";
private Mac hmacSHA256;
public Crypto() {
try {
hmacSHA256 = Mac.getInstance("HmacSHA256");
} catch (SecurityException e) {
Log.e(TAG, "Security exception when getting HMAC", e);
} catch (NoSuchAlgorithmException e) {
Log.e(TAG, "HMAC SHA256 does not exist");
}
}
/**
* Calculates an HMAC SHA256 hash using a default key length.
*
*
* @param input
* @param key
* @return hmac hashed bytes
*/
public byte[] calculateHmacSHA256(byte[] input, byte[] key) {
byte[] output = null;
try {
hmacSHA256.init(new SecretKeySpec(key, "HmacSHA256"));
output = hmacSHA256.doFinal(input);
} catch (InvalidKeyException e) {
Log.e(TAG, "Invalid key", e);
}
return output;
}
/**
* Calculates an HMAC SHA256 hash using a set key length.
*
* @param input
* @param key
* @param length
* @return hmac hashed bytes
*/
public byte[] calculateHmacSHA256(byte[] input, byte[] key, int length) {
byte[] output = null;
try {
hmacSHA256.init(new SecretKeySpec(key, 0, length, "HmacSHA256"));
output = hmacSHA256.doFinal(input);
} catch (InvalidKeyException e) {
Log.e(TAG, "Invalid key", e);
}
return output;
}
}
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment