Skip to content

Commit 5ce64b3

Browse files
authored
Merge pull request #261 from ksvc/v4.4.2-22966
update to v4.4.2-22966
2 parents 1b4ee42 + 6816efd commit 5ce64b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2120
-923
lines changed

demo/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@
7979
android:launchMode="singleTop"
8080
android:theme="@style/Theme.RiseAnimation">
8181
</activity>
82+
<activity android:name="com.ksyun.media.streamer.demo.AudioStreamingActivity"
83+
android:configChanges="orientation|keyboardHidden|screenSize"
84+
android:launchMode="singleTop"
85+
android:theme="@style/Theme.RiseAnimation">
86+
</activity>
8287
</application>
8388

8489
</manifest>

demo/libs/arm64-v8a/libksylive.so

20 KB
Binary file not shown.

demo/libs/armeabi-v7a/libksylive.so

0 Bytes
Binary file not shown.

demo/libs/armeabi/libksylive.so

4 KB
Binary file not shown.

demo/libs/ksylive.jar

857 Bytes
Binary file not shown.

demo/libs/x86/libksylive.so

0 Bytes
Binary file not shown.
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent">
6+
7+
<TextView
8+
android:layout_width="match_parent"
9+
android:layout_height="wrap_content"
10+
android:layout_marginTop="6dp"
11+
android:text="音频编码"
12+
android:textSize="14sp" />
13+
14+
<RadioGroup
15+
android:id="@+id/aac_profile"
16+
android:layout_width="wrap_content"
17+
android:layout_height="wrap_content"
18+
android:layout_marginLeft="10dp"
19+
android:layout_marginTop="5dp"
20+
android:orientation="horizontal">
21+
22+
<RadioButton
23+
android:id="@+id/aac_lc"
24+
android:layout_width="wrap_content"
25+
android:layout_height="wrap_content"
26+
android:checked="true"
27+
android:text="AAC LC" />
28+
29+
<RadioButton
30+
android:id="@+id/aac_he"
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:checked="false"
34+
android:text="AAC HE" />
35+
36+
<RadioButton
37+
android:id="@+id/aac_he_v2"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
android:checked="false"
41+
android:text="AAC HEv2" />
42+
</RadioGroup>
43+
44+
<LinearLayout
45+
android:id="@+id/init_group"
46+
android:layout_width="match_parent"
47+
android:layout_height="wrap_content"
48+
android:orientation="vertical">
49+
50+
<CheckBox
51+
android:id="@+id/stereo_stream"
52+
android:layout_width="wrap_content"
53+
android:layout_height="wrap_content"
54+
android:layout_marginTop="5dp"
55+
android:checked="false"
56+
android:text="双声道推流" />
57+
58+
<CheckBox
59+
android:id="@+id/autoStart"
60+
android:layout_width="wrap_content"
61+
android:layout_height="wrap_content"
62+
android:layout_marginTop="5dp"
63+
android:checked="false"
64+
android:text="初始化完成后启动推流" />
65+
66+
<CheckBox
67+
android:id="@+id/print_debug_info"
68+
android:layout_width="wrap_content"
69+
android:layout_height="wrap_content"
70+
android:layout_marginTop="5dp"
71+
android:checked="true"
72+
android:text="显示调试信息" />
73+
</LinearLayout>
74+
75+
<LinearLayout
76+
android:id="@+id/audioBitrate"
77+
android:layout_width="match_parent"
78+
android:layout_height="wrap_content"
79+
android:orientation="horizontal">
80+
81+
<TextView
82+
android:layout_width="wrap_content"
83+
android:layout_height="wrap_content"
84+
android:text="音频码率"
85+
android:textSize="16sp" />
86+
87+
<EditText
88+
android:id="@+id/audioBitratePicker"
89+
android:layout_width="wrap_content"
90+
android:layout_height="wrap_content"
91+
android:inputType="number"
92+
android:text="48" />
93+
</LinearLayout>
94+
</LinearLayout>
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/root"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
android:background="#ffeeeeee" >
7+
8+
<Chronometer
9+
android:id="@+id/chronometer"
10+
android:layout_width="wrap_content"
11+
android:layout_height="46dp"
12+
android:layout_centerHorizontal="true"
13+
android:layout_alignParentTop="true"
14+
android:format="%s"
15+
android:gravity="center"
16+
android:textColor="@color/font_color_35"
17+
android:textSize="@dimen/font_size_38px" />
18+
19+
<TextView
20+
android:id="@+id/url"
21+
android:layout_width="match_parent"
22+
android:layout_height="wrap_content"
23+
android:layout_below="@id/chronometer"
24+
android:layout_marginTop="4dp"
25+
android:gravity="center"
26+
android:textColor="@color/font_color_35"
27+
android:textSize="@dimen/font_size_36px" />
28+
29+
<TextView
30+
android:id="@+id/debug_info"
31+
android:layout_width="match_parent"
32+
android:layout_height="wrap_content"
33+
android:layout_below="@id/url"
34+
android:layout_marginTop="8dp"
35+
android:gravity="left"
36+
android:textColor="@color/font_color_41"
37+
android:textSize="@dimen/font_size_22px" />
38+
39+
<LinearLayout
40+
android:id="@+id/bottom_bar"
41+
android:layout_width="match_parent"
42+
android:layout_height="36dp"
43+
android:layout_alignParentBottom="true"
44+
android:layout_marginBottom="10dp"
45+
android:layout_marginLeft="10dp"
46+
android:layout_marginRight="10dp"
47+
android:background="@color/trans_parent"
48+
android:gravity="center">
49+
50+
<TextView
51+
android:id="@+id/start_stream_tv"
52+
android:layout_width="wrap_content"
53+
android:layout_height="match_parent"
54+
android:layout_marginLeft="10dp"
55+
android:layout_marginRight="10dp"
56+
android:paddingLeft="5dp"
57+
android:paddingRight="5dp"
58+
android:gravity="center"
59+
android:background="#11123456"
60+
android:text="开始推流"
61+
android:textColor="@color/font_color_35"
62+
android:textSize="16sp">
63+
</TextView>
64+
65+
<TextView
66+
android:id="@+id/start_record_tv"
67+
android:layout_width="wrap_content"
68+
android:layout_height="match_parent"
69+
android:layout_marginLeft="10dp"
70+
android:layout_marginRight="10dp"
71+
android:paddingLeft="5dp"
72+
android:paddingRight="5dp"
73+
android:gravity="center"
74+
android:background="#11123456"
75+
android:text="开始录制"
76+
android:textColor="@color/font_color_35"
77+
android:textSize="16sp">
78+
</TextView>
79+
</LinearLayout>
80+
</RelativeLayout>

demo/res/layout/video_filter_fragment.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
android:layout_height="wrap_content"
1313
android:layout_marginLeft="10dp"
1414
android:layout_marginRight="10dp"
15-
android:layout_marginTop="5dp"
15+
android:layout_marginTop="8dp"
1616
android:gravity="center">
1717

1818
<TextView
@@ -37,7 +37,7 @@
3737
android:layout_height="wrap_content"
3838
android:layout_marginLeft="10dp"
3939
android:layout_marginRight="10dp"
40-
android:layout_marginTop="5dp"
40+
android:layout_marginTop="8dp"
4141
android:gravity="center">
4242

4343
<TextView
@@ -62,7 +62,7 @@
6262
android:layout_height="wrap_content"
6363
android:layout_marginLeft="10dp"
6464
android:layout_marginRight="10dp"
65-
android:layout_marginTop="10dp"
65+
android:layout_marginTop="8dp"
6666
android:gravity="center">
6767

6868
<TextView
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
package com.ksyun.media.streamer.demo;
2+
3+
import android.os.Bundle;
4+
import android.support.annotation.Nullable;
5+
import android.text.TextUtils;
6+
import android.view.LayoutInflater;
7+
import android.view.View;
8+
import android.view.ViewGroup;
9+
import android.widget.CheckBox;
10+
import android.widget.EditText;
11+
import android.widget.RadioGroup;
12+
13+
import com.ksyun.media.streamer.framework.AVConst;
14+
15+
import butterknife.BindView;
16+
import butterknife.ButterKnife;
17+
18+
/**
19+
* Audio streaming demo fragment.
20+
*/
21+
22+
public class AudioDemoFragment extends DemoFragment {
23+
private static final String TAG = "BaseDemoFragment";
24+
25+
@BindView(R.id.audioBitratePicker)
26+
protected EditText mAudioBitRateEditText;
27+
@BindView(R.id.aac_profile)
28+
protected RadioGroup mAACProfileGroup;
29+
30+
@BindView(R.id.stereo_stream)
31+
protected CheckBox mStereoStream;
32+
@BindView(R.id.autoStart)
33+
protected CheckBox mAutoStartCheckBox;
34+
@BindView(R.id.print_debug_info)
35+
protected CheckBox mShowDebugInfoCheckBox;
36+
37+
@Nullable
38+
@Override
39+
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
40+
Bundle savedInstanceState) {
41+
View view = inflater.inflate(R.layout.audio_demo_fragment, container, false);
42+
ButterKnife.bind(this, view);
43+
return view;
44+
}
45+
46+
protected void loadParams(AudioStreamingActivity.AudioStreamConfig config, String url) {
47+
// initial value
48+
config.mAudioKBitrate = 48;
49+
config.mUrl = url;
50+
config.mStereoStream = false;
51+
config.mAudioEncodeProfile = AVConst.PROFILE_AAC_LOW;
52+
53+
// audio bitrate
54+
if (!TextUtils.isEmpty(mAudioBitRateEditText.getText().toString())) {
55+
config.mAudioKBitrate = Integer.parseInt(mAudioBitRateEditText.getText().toString());
56+
}
57+
58+
// audio encode profile
59+
switch (mAACProfileGroup.getCheckedRadioButtonId()) {
60+
case R.id.aac_he:
61+
config.mAudioEncodeProfile = AVConst.PROFILE_AAC_HE;
62+
break;
63+
case R.id.aac_he_v2:
64+
config.mAudioEncodeProfile = AVConst.PROFILE_AAC_HE_V2;
65+
break;
66+
case R.id.aac_lc:
67+
default:
68+
config.mAudioEncodeProfile = AVConst.PROFILE_AAC_LOW;
69+
break;
70+
}
71+
72+
config.mStereoStream = mStereoStream.isChecked();
73+
config.mAutoStart = mAutoStartCheckBox.isChecked();
74+
config.mShowDebugInfo = mShowDebugInfoCheckBox.isChecked();
75+
}
76+
77+
@Override
78+
public void start(String url) {
79+
AudioStreamingActivity.AudioStreamConfig config =
80+
new AudioStreamingActivity.AudioStreamConfig();
81+
loadParams(config, url);
82+
AudioStreamingActivity.startActivity(getActivity(), config, AudioStreamingActivity.class);
83+
}
84+
}

0 commit comments

Comments
 (0)