├── .gitignore
├── CyberLink4Android.iml
├── Pic
├── dlna01.jpg
├── dlna02.jpg
└── dlna03.jpg
├── README.md
├── build.gradle
├── build
└── intermediates
│ ├── dex-cache
│ └── cache.xml
│ └── gradle_project_sync_data.bin
├── dmc_sample
├── build.gradle
├── dmc_sample.iml
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── charonchui
│ │ └── cyberlink
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── charonchui
│ │ └── cyberlink
│ │ ├── BaseActivity.java
│ │ ├── ControlActivity.java
│ │ ├── DMCApplication.java
│ │ ├── MainActivity.java
│ │ ├── SplashActivity.java
│ │ ├── engine
│ │ ├── DLNAContainer.java
│ │ ├── MultiPointController.java
│ │ └── SearchThread.java
│ │ ├── inter
│ │ └── IController.java
│ │ ├── service
│ │ └── DLNAService.java
│ │ └── util
│ │ ├── DLNAUtil.java
│ │ ├── LogUtil.java
│ │ └── NetUtil.java
│ └── res
│ ├── drawable-hdpi
│ ├── back_fast.png
│ ├── back_fast_on.png
│ ├── devices.png
│ ├── dlna_search_focused.9.png
│ ├── dlna_search_normal.9.png
│ ├── go_fast.png
│ ├── go_fast_on.png
│ ├── home_background.png
│ ├── ic_launcher.png
│ ├── mediacontroller_bg.png
│ ├── mediacontroller_pause01.png
│ ├── mediacontroller_pause02.png
│ ├── mediacontroller_play01.png
│ ├── mediacontroller_play02.png
│ ├── next_video_button_nomal.png
│ ├── next_video_button_selected.png
│ ├── pause_button.png
│ ├── play_button.png
│ ├── pre_video_button_nomal.png
│ ├── pre_video_button_selected.png
│ ├── scrubber_control_disabled_holo.png
│ ├── scrubber_control_focused_holo.png
│ ├── scrubber_control_normal_holo.png
│ ├── scrubber_control_pressed_holo.png
│ ├── scrubber_primary_holo.9.png
│ ├── scrubber_secondary_holo.9.png
│ ├── scrubber_track_holo_dark.9.png
│ ├── splash.jpg
│ ├── tip_bg.9.png
│ ├── volume_must.png
│ ├── volume_no_nomal.png
│ └── volume_no_selected.png
│ ├── drawable
│ ├── back_fast_selector.xml
│ ├── dlna_search_selector.xml
│ ├── go_fast_selector.xml
│ ├── mediacontroller_pause_button.xml
│ ├── mediacontroller_play_button.xml
│ ├── next_video_selector.xml
│ ├── pre_video_selector.xml
│ ├── scrubber_control_selector_holo.xml
│ └── scrubber_progress_horizontal_holo_dark.xml
│ ├── layout
│ ├── activity_control.xml
│ ├── activity_main.xml
│ ├── activity_splash.xml
│ ├── empty_view.xml
│ └── item_lv_main.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── library
├── build.gradle
├── library.iml
├── libs
│ └── clink210.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── charon
│ │ └── library
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── org
│ │ └── cybergarage
│ │ ├── sql
│ │ ├── Database.java
│ │ └── mysql
│ │ │ └── MySQL.java
│ │ └── upnp
│ │ └── std
│ │ └── av
│ │ ├── controller
│ │ ├── MediaController.java
│ │ └── server
│ │ │ ├── BrowseAction.java
│ │ │ └── BrowseResult.java
│ │ ├── player
│ │ ├── MediaPlayer.java
│ │ └── action
│ │ │ ├── BrowseAction.java
│ │ │ ├── BrowseResult.java
│ │ │ └── BrowseResultNode.java
│ │ ├── renderer
│ │ ├── AVTransport.java
│ │ ├── AVTransportInfo.java
│ │ ├── AVTransportInfoList.java
│ │ ├── ConnectionInfo.java
│ │ ├── ConnectionInfoList.java
│ │ ├── ConnectionManager.java
│ │ ├── MediaRenderer.java
│ │ └── RenderingControl.java
│ │ └── server
│ │ ├── ConnectionInfo.java
│ │ ├── ConnectionInfoList.java
│ │ ├── ConnectionManager.java
│ │ ├── ContentDirectory.java
│ │ ├── DC.java
│ │ ├── Directory.java
│ │ ├── DirectoryList.java
│ │ ├── MediaServer.java
│ │ ├── UPnP.java
│ │ ├── action
│ │ ├── BrowseAction.java
│ │ └── SearchAction.java
│ │ ├── directory
│ │ ├── file
│ │ │ └── FileDirectory.java
│ │ ├── gateway
│ │ │ └── GatewayDirectory.java
│ │ └── mythtv
│ │ │ ├── MythDatabase.java
│ │ │ ├── MythDirectory.java
│ │ │ └── MythRecordedInfo.java
│ │ └── object
│ │ ├── ContentNode.java
│ │ ├── ContentNodeList.java
│ │ ├── ContentProperty.java
│ │ ├── ContentPropertyList.java
│ │ ├── DIDLLite.java
│ │ ├── DIDLLiteNode.java
│ │ ├── Format.java
│ │ ├── FormatList.java
│ │ ├── FormatObject.java
│ │ ├── SearchCap.java
│ │ ├── SearchCapList.java
│ │ ├── SearchCriteria.java
│ │ ├── SearchCriteriaList.java
│ │ ├── SortCap.java
│ │ ├── SortCapList.java
│ │ ├── SortCriterionList.java
│ │ ├── container
│ │ ├── ContainerNode.java
│ │ └── RootNode.java
│ │ ├── format
│ │ ├── DefaultFormat.java
│ │ ├── GIFFormat.java
│ │ ├── Header.java
│ │ ├── ID3Format.java
│ │ ├── ID3Frame.java
│ │ ├── ID3FrameList.java
│ │ ├── ImageIOFormat.java
│ │ ├── JPEGFormat.java
│ │ ├── MPEGFormat.java
│ │ └── PNGFormat.java
│ │ ├── item
│ │ ├── ItemNode.java
│ │ ├── ItemNodeList.java
│ │ ├── ResourceNode.java
│ │ ├── ResourceNodeList.java
│ │ ├── file
│ │ │ ├── FileItemNode.java
│ │ │ └── FileItemNodeList.java
│ │ └── mythtv
│ │ │ └── MythRecordedItemNode.java
│ │ ├── search
│ │ ├── IdSearchCap.java
│ │ └── TitleSearchCap.java
│ │ └── sort
│ │ ├── DCDateSortCap.java
│ │ ├── DCTitleSortCap.java
│ │ └── UPnPClassSortCap.java
│ └── res
│ └── values
│ ├── dimens.xml
│ └── strings.xml
├── local.properties
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 |
15 | # Gradle files
16 | .gradle/
17 | build/
18 | /*/build/
19 |
20 | # Local configuration file (sdk path, etc)
21 | local.properties
22 |
23 | # Proguard folder generated by Eclipse
24 | proguard/
25 |
26 | # Log Files
27 | *.log
28 |
29 | .idea/
30 | *.iml
--------------------------------------------------------------------------------
/CyberLink4Android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Pic/dlna01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/Pic/dlna01.jpg
--------------------------------------------------------------------------------
/Pic/dlna02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/Pic/dlna02.jpg
--------------------------------------------------------------------------------
/Pic/dlna03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/Pic/dlna03.jpg
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | CyberLink4Android
2 | ===
3 |
4 | CyberLink for Android is a **DLNA** development package for UPnP™ developers on Android development. CyberLink controls these protocols automatically, and supports to create your devices and control points quickly.The file on www.cybergarage.org for Android can only realize the find and browse function, so I combine the Cyberlink4Java and the jar for Android make this Cyberlink for Android.
5 |
6 | - **See http://www.cybergarage.org for more information.**
7 | - **[CyberLink4Java](https://github.com/cybergarage/CyberLink4Java)**
8 |
9 | 
10 | 
11 | 
12 |
13 | Status
14 | ===
15 |
16 | * [](https://oss.sonatype.org/content/repositories/releases/com/charonchui/cyberlink/library/1.0.0/)
17 |
18 |
19 | Usage
20 | ===
21 |
22 | for Gradle
23 | ---
24 |
25 | If you are building with Gradle, simply add the following line to the `dependencies` section of your `build.gradle` file :
26 | `compile 'com.charonchui.cyberlink:library:1.0.0'`
27 |
28 | for Maven
29 | ---
30 |
31 | ```xml
32 |
33 | com.charonchui.cyberlink
34 | library
35 | 1.0.0
36 |
37 | ```
38 |
39 | Developed By
40 | ===
41 |
42 | * Charon Chui -
43 |
44 |
45 | License
46 | ===
47 |
48 | Copyright (C) 2013 Charon Chui
49 |
50 | Licensed under the Apache License, Version 2.0 (the "License");
51 | you may not use this file except in compliance with the License.
52 | You may obtain a copy of the License at
53 |
54 | http://www.apache.org/licenses/LICENSE-2.0
55 |
56 | Unless required by applicable law or agreed to in writing, software
57 | distributed under the License is distributed on an "AS IS" BASIS,
58 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59 | See the License for the specific language governing permissions and
60 | limitations under the License.
61 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/build/intermediates/dex-cache/cache.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
9 |
10 |
11 | -
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/build/intermediates/gradle_project_sync_data.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/build/intermediates/gradle_project_sync_data.bin
--------------------------------------------------------------------------------
/dmc_sample/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "22.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.charonchui.cyberlink"
9 | minSdkVersion 8
10 | targetSdkVersion 22
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | compile project(':library')
25 | }
26 |
--------------------------------------------------------------------------------
/dmc_sample/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/xuchuanren/android-sdks/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/dmc_sample/src/androidTest/java/com/charonchui/cyberlink/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/dmc_sample/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/BaseActivity.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class BaseActivity extends Activity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | DMCApplication.getInstance().addActivity(this);
12 | }
13 |
14 | @Override
15 | protected void onDestroy() {
16 | DMCApplication.getInstance().removeActivity(this);
17 | super.onDestroy();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/DMCApplication.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import org.cybergarage.upnp.ControlPoint;
7 |
8 | import android.app.Activity;
9 | import android.app.Application;
10 |
11 | public class DMCApplication extends Application {
12 | private static DMCApplication mDmcApplication;
13 |
14 | private List activities;
15 |
16 | public ControlPoint mControlPoint;
17 |
18 | @Override
19 | public void onCreate() {
20 | super.onCreate();
21 | if (activities != null) {
22 | activities = null;
23 | }
24 | activities = new ArrayList();
25 | mDmcApplication = this;
26 | }
27 |
28 | /**
29 | * Add this activity to the list set. Please use this on the activity's
30 | * onCreate method.
31 | *
32 | * @param activity
33 | * The activity to be added.
34 | */
35 | public void addActivity(Activity activity) {
36 | if (activities != null) {
37 | if (activities.contains(activity)) {
38 | activities.remove(activity);
39 | }
40 | activities.add(activity);
41 | }
42 | }
43 |
44 | /**
45 | * Remove this activity from the list set. On every activity's onDestroy
46 | * method we all should use this method.
47 | *
48 | * @param activity
49 | */
50 | public void removeActivity(Activity activity) {
51 | if (activities != null && activities.contains(activity)) {
52 | activities.remove(activity);
53 | }
54 | }
55 |
56 | /**
57 | * Get the application instance.
58 | *
59 | * @return DMCApplication
60 | */
61 | public static DMCApplication getInstance() {
62 | return mDmcApplication;
63 | }
64 |
65 | /**
66 | * Quit this application.
67 | */
68 | public void quit() {
69 | if (activities != null) {
70 | for (Activity activity : activities) {
71 | activity.finish();
72 | }
73 | activities = null;
74 | }
75 | }
76 |
77 | /**
78 | * Set the ControlPoint have been used in this application, to make sure it
79 | * is the same one in this application.
80 | *
81 | * @param controlPoint
82 | * The ControlPoint we have created first in this application.
83 | */
84 | public void setControlPoint(ControlPoint controlPoint) {
85 | mControlPoint = controlPoint;
86 | }
87 |
88 | /**
89 | * Get the ControlPoint have been set by setControlPoint method, this may be
90 | * null.
91 | *
92 | * @return The ControlPoint have been set by by setControlPoint.
93 | */
94 | public ControlPoint getControlPoint() {
95 | return mControlPoint;
96 | }
97 | }
98 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink;
2 |
3 | import java.util.List;
4 |
5 | import org.cybergarage.upnp.Device;
6 |
7 | import android.content.Intent;
8 | import android.os.Bundle;
9 | import android.view.View;
10 | import android.view.View.OnClickListener;
11 | import android.view.ViewGroup;
12 | import android.view.ViewGroup.LayoutParams;
13 | import android.widget.AdapterView;
14 | import android.widget.AdapterView.OnItemClickListener;
15 | import android.widget.BaseAdapter;
16 | import android.widget.Button;
17 | import android.widget.ListView;
18 | import android.widget.TextView;
19 | import android.widget.Toast;
20 |
21 | import com.charon.cyberlink.engine.DLNAContainer;
22 | import com.charon.cyberlink.engine.DLNAContainer.DeviceChangeListener;
23 | import com.charon.cyberlink.service.DLNAService;
24 | import com.charon.cyberlink.util.LogUtil;
25 |
26 | public class MainActivity extends BaseActivity {
27 | protected static final String TAG = "MainActivity";
28 | private Button btn_main;
29 | private ListView lv_main;
30 | private View emptyView;
31 | private List mDevices;
32 | private DeviceAdapter mDeviceAdapter;
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_main);
38 | findView();
39 | initView();
40 | }
41 |
42 | @Override
43 | protected void onResume() {
44 | super.onResume();
45 | refresh();
46 | }
47 |
48 | @Override
49 | protected void onDestroy() {
50 | super.onDestroy();
51 | stopDLNAService();
52 | }
53 |
54 | private void findView() {
55 | btn_main = (Button) findViewById(R.id.btn_main);
56 | lv_main = (ListView) findViewById(R.id.lv_main);
57 | }
58 |
59 | private void initView() {
60 | btn_main.setOnClickListener(new OnClickListener() {
61 |
62 | @Override
63 | public void onClick(View v) {
64 | Toast.makeText(MainActivity.this, "start dlna service to find dlna devices.", Toast.LENGTH_SHORT).show();
65 | startDLNAService();
66 | mDevices = DLNAContainer.getInstance().getDevices();
67 | LogUtil.d(TAG, "mDevices size:" + mDevices.size());
68 | refresh();
69 | }
70 | });
71 |
72 | emptyView = View.inflate(this, R.layout.empty_view, null);
73 | addContentView(emptyView, new LayoutParams(LayoutParams.MATCH_PARENT,
74 | LayoutParams.MATCH_PARENT));
75 | lv_main.setEmptyView(emptyView);
76 |
77 | mDeviceAdapter = new DeviceAdapter();
78 | mDevices = DLNAContainer.getInstance().getDevices();
79 | lv_main.setAdapter(mDeviceAdapter);
80 | lv_main.setOnItemClickListener(new OnItemClickListener() {
81 |
82 | @Override
83 | public void onItemClick(AdapterView> parent, View view,
84 | int position, long id) {
85 | DLNAContainer.getInstance().setSelectedDevice(mDevices.get(position));
86 | startControlActivity();
87 | }
88 | });
89 |
90 | DLNAContainer.getInstance().setDeviceChangeListener(
91 | new DeviceChangeListener() {
92 |
93 | @Override
94 | public void onDeviceChange(Device device) {
95 | runOnUiThread(new Runnable() {
96 | public void run() {
97 | refresh();
98 | }
99 | });
100 | }
101 | });
102 | }
103 |
104 | private void refresh() {
105 | if (mDeviceAdapter != null) {
106 | mDeviceAdapter.notifyDataSetChanged();
107 | }
108 | }
109 |
110 | private void startDLNAService() {
111 | Intent intent = new Intent(getApplicationContext(), DLNAService.class);
112 | startService(intent);
113 | }
114 |
115 | private void stopDLNAService() {
116 | Intent intent = new Intent(getApplicationContext(), DLNAService.class);
117 | stopService(intent);
118 | }
119 |
120 | private void startControlActivity() {
121 | Intent intent = new Intent(getApplicationContext(),
122 | ControlActivity.class);
123 | startActivity(intent);
124 | }
125 |
126 | private class DeviceAdapter extends BaseAdapter {
127 |
128 | @Override
129 | public int getCount() {
130 | if (mDevices == null) {
131 | return 0;
132 | } else {
133 | return mDevices.size();
134 | }
135 | }
136 |
137 | @Override
138 | public Object getItem(int position) {
139 | if (mDevices != null) {
140 | return mDevices.get(position);
141 | }
142 |
143 | return null;
144 | }
145 |
146 | @Override
147 | public long getItemId(int position) {
148 | return position;
149 | }
150 |
151 | @Override
152 | public View getView(int position, View convertView, ViewGroup parent) {
153 | ViewHolder holder;
154 | if (convertView == null) {
155 | convertView = View.inflate(getApplicationContext(),
156 | R.layout.item_lv_main, null);
157 | holder = new ViewHolder();
158 | convertView.setTag(holder);
159 | } else {
160 | holder = (ViewHolder) convertView.getTag();
161 | }
162 | holder.tv_name_item = (TextView) convertView
163 | .findViewById(R.id.tv_name_item);
164 | holder.tv_name_item.setText(mDevices.get(position)
165 | .getFriendlyName());
166 | return convertView;
167 | }
168 | }
169 |
170 | static class ViewHolder {
171 | private TextView tv_name_item;
172 | }
173 |
174 | }
175 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/SplashActivity.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.os.Handler;
6 | import android.view.animation.AlphaAnimation;
7 | import android.widget.ImageView;
8 |
9 | import com.charon.cyberlink.engine.DLNAContainer;
10 | import com.charon.cyberlink.service.DLNAService;
11 |
12 | /**
13 | * Splash activity, show the welcome image and start the DLNAService.
14 | *
15 | * @author CharonChui
16 | *
17 | */
18 | public class SplashActivity extends BaseActivity {
19 | private ImageView iv_splash;
20 |
21 | private Handler handler = new Handler();
22 |
23 | private static final int sDelayTime = 2000;
24 |
25 | @Override
26 | protected void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | setContentView(R.layout.activity_splash);
29 | startDLNAService();
30 | findView();
31 | setUp();
32 | }
33 |
34 | private void findView() {
35 | iv_splash = (ImageView) findViewById(R.id.iv_splash);
36 | }
37 |
38 | private void setUp() {
39 | playAnimation();
40 | handler.postDelayed(new Runnable() {
41 |
42 | @Override
43 | public void run() {
44 | startMainActivity();
45 | }
46 | }, sDelayTime);
47 | }
48 |
49 | private void playAnimation() {
50 | AlphaAnimation alphaAnimation = new AlphaAnimation(0.2f, 1.0f);
51 | alphaAnimation.setDuration(sDelayTime);
52 | alphaAnimation.setFillAfter(true);
53 | iv_splash.startAnimation(alphaAnimation);
54 | }
55 |
56 | private void startMainActivity() {
57 | Intent intent = new Intent(getApplicationContext(), MainActivity.class);
58 | startActivity(intent);
59 | finish();
60 | }
61 |
62 | private void startDLNAService() {
63 | // Clear the device container.
64 | DLNAContainer.getInstance().clear();
65 | Intent intent = new Intent(getApplicationContext(), DLNAService.class);
66 | startService(intent);
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/engine/DLNAContainer.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink.engine;
2 |
3 | import java.util.ArrayList;
4 | import java.util.List;
5 |
6 | import org.cybergarage.upnp.Device;
7 |
8 | import com.charon.cyberlink.util.DLNAUtil;
9 | import com.charon.cyberlink.util.LogUtil;
10 |
11 | public class DLNAContainer {
12 | private List mDevices;
13 | private Device mSelectedDevice;
14 | private DeviceChangeListener mDeviceChangeListener;
15 | private static final DLNAContainer mDLNAContainer = new DLNAContainer();
16 | private static final String TAG = "DLNAContainer";
17 |
18 | private DLNAContainer() {
19 | mDevices = new ArrayList();
20 | }
21 |
22 | public static DLNAContainer getInstance() {
23 | return mDLNAContainer;
24 | }
25 |
26 | public synchronized void addDevice(Device d) {
27 | if (!DLNAUtil.isMediaRenderDevice(d))
28 | return;
29 | int size = mDevices.size();
30 | for (int i = 0; i < size; i++) {
31 | String udnString = mDevices.get(i).getUDN();
32 | if (d.getUDN().equalsIgnoreCase(udnString)) {
33 | return;
34 | }
35 | }
36 |
37 | mDevices.add(d);
38 | LogUtil.d(TAG, "Devices add a device" + d.getDeviceType());
39 | if (mDeviceChangeListener != null) {
40 | mDeviceChangeListener.onDeviceChange(d);
41 | }
42 | }
43 |
44 | public synchronized void removeDevice(Device d) {
45 | if (!DLNAUtil.isMediaRenderDevice(d)) {
46 | return;
47 | }
48 | int size = mDevices.size();
49 | for (int i = 0; i < size; i++) {
50 | String udnString = mDevices.get(i).getUDN();
51 | if (d.getUDN().equalsIgnoreCase(udnString)) {
52 | Device device = mDevices.remove(i);
53 | LogUtil.d(TAG, "Devices remove a device");
54 |
55 | boolean ret = false;
56 | if (mSelectedDevice != null) {
57 | ret = mSelectedDevice.getUDN().equalsIgnoreCase(
58 | device.getUDN());
59 | }
60 | if (ret) {
61 | mSelectedDevice = null;
62 | }
63 | if (mDeviceChangeListener != null) {
64 | mDeviceChangeListener.onDeviceChange(d);
65 | }
66 | break;
67 | }
68 | }
69 | }
70 |
71 | public synchronized void clear() {
72 | if (mDevices != null) {
73 | mDevices.clear();
74 | mSelectedDevice = null;
75 | }
76 | }
77 |
78 | public Device getSelectedDevice() {
79 | return mSelectedDevice;
80 | }
81 |
82 | public void setSelectedDevice(Device mSelectedDevice) {
83 | this.mSelectedDevice = mSelectedDevice;
84 | }
85 |
86 | public void setDeviceChangeListener(
87 | DeviceChangeListener deviceChangeListener) {
88 | mDeviceChangeListener = deviceChangeListener;
89 | }
90 |
91 | public List getDevices() {
92 | return mDevices;
93 | }
94 |
95 | public interface DeviceChangeListener {
96 | void onDeviceChange(Device device);
97 | }
98 |
99 | }
100 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/engine/SearchThread.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink.engine;
2 |
3 | import org.cybergarage.upnp.ControlPoint;
4 | import org.cybergarage.upnp.Device;
5 | import org.cybergarage.upnp.device.DeviceChangeListener;
6 |
7 | import com.charon.cyberlink.util.LogUtil;
8 |
9 | /**
10 | * A thread to search the devices all the time.
11 | *
12 | * @author CharonChui
13 | */
14 | public class SearchThread extends Thread {
15 | private boolean flag = true;
16 | private ControlPoint mControlPoint;
17 | private boolean mStartComplete;
18 | private int mSearchTimes;
19 | private static final int mFastInternalTime = 15000;
20 | private static final int mNormalInternalTime = 3600000;
21 | private static final String TAG = "SearchThread";
22 |
23 | public SearchThread(ControlPoint mControlPoint) {
24 | super();
25 | this.mControlPoint = mControlPoint;
26 | this.mControlPoint.addDeviceChangeListener(mDeviceChangeListener);
27 | }
28 |
29 | @Override
30 | public void run() {
31 | while (flag) {
32 | if (mControlPoint == null) {
33 | break;
34 | }
35 | searchDevices();
36 | }
37 | }
38 |
39 | /**
40 | * Search for the DLNA devices.
41 | */
42 | private void searchDevices() {
43 | try {
44 | if (mStartComplete) {
45 | mControlPoint.search();
46 | LogUtil.d(TAG, "controlpoint search...");
47 | } else {
48 | mControlPoint.stop();
49 | boolean startRet = mControlPoint.start();
50 | LogUtil.d(TAG, "controlpoint start:" + startRet);
51 | if (startRet) {
52 | mStartComplete = true;
53 | }
54 | }
55 | } catch (Exception e) {
56 | e.printStackTrace();
57 | }
58 | // Search the devices five times fast, and after that we can make it
59 | // search lowly to save the power.
60 | synchronized (this) {
61 | try {
62 | mSearchTimes++;
63 | if (mSearchTimes >= 5) {
64 | wait(mNormalInternalTime);
65 | } else {
66 | wait(mFastInternalTime);
67 | }
68 | } catch (Exception e) {
69 | e.printStackTrace();
70 | }
71 | }
72 | }
73 |
74 | /**
75 | * Set the search times, set this to 0 to make it search fast.
76 | *
77 | * @param searchTimes
78 | * The times we have searched.
79 | */
80 | public synchronized void setSearcTimes(int searchTimes) {
81 | this.mSearchTimes = searchTimes;
82 | }
83 |
84 | /**
85 | * Notify all the thread.
86 | */
87 | public void awake() {
88 | synchronized (this) {
89 | notifyAll();
90 | }
91 | }
92 |
93 | /**
94 | * Stop the thread, if quit this application we should use this method to
95 | * stop the thread.
96 | */
97 | public void stopThread() {
98 | flag = false;
99 | awake();
100 | }
101 |
102 | private DeviceChangeListener mDeviceChangeListener = new DeviceChangeListener() {
103 |
104 | @Override
105 | public void deviceRemoved(Device dev) {
106 | LogUtil.d(TAG, "control point remove a device");
107 | DLNAContainer.getInstance().removeDevice(dev);
108 | }
109 |
110 | @Override
111 | public void deviceAdded(Device dev) {
112 | LogUtil.d(TAG, "control point add a device..." + dev.getDeviceType() + dev.getFriendlyName());
113 | DLNAContainer.getInstance().addDevice(dev);
114 | }
115 | };
116 | }
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/inter/IController.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink.inter;
2 |
3 | import org.cybergarage.upnp.Device;
4 |
5 | public interface IController {
6 |
7 | /**
8 | * Play the video with the video path.
9 | *
10 | * @param device
11 | * The device be controlled.
12 | * @param path
13 | * The path of the video.
14 | * @return If is success to play the video.
15 | */
16 | boolean play(Device device, String path);
17 |
18 | /**
19 | * Go on playing the video from the position.
20 | *
21 | * @param device
22 | * The device be controlled.
23 | * @param pausePosition
24 | * The format must be 00:00:00.
25 | */
26 | boolean goon(Device device, String pausePosition);
27 |
28 | /**
29 | * All the state is "STOPPED" // "PLAYING" // "TRANSITIONING"//
30 | * "PAUSED_PLAYBACK"// "PAUSED_RECORDING"// "RECORDING" //
31 | * "NO_MEDIA_PRESENT//
32 | */
33 | String getTransportState(Device device);
34 |
35 | /**
36 | * Get the min volume value,this must be 0.
37 | *
38 | * @param device
39 | * @return
40 | */
41 | int getMinVolumeValue(Device device);
42 |
43 | /**
44 | * Get the max volume value, usually it is 100.
45 | *
46 | * @param device
47 | * The device be controlled.
48 | * @return The max volume value.
49 | */
50 | int getMaxVolumeValue(Device device);
51 |
52 | /**
53 | * Seek the playing video to a target position.
54 | *
55 | * @param device
56 | * The device be controlled.
57 | * @param targetPosition
58 | * Target position we want to set.
59 | * @return
60 | */
61 | boolean seek(Device device, String targetPosition);
62 |
63 | /**
64 | * Get the current playing position of the video.
65 | *
66 | * @param device
67 | * The device be controlled.
68 | * @return Current playing position is 00:00:00
69 | */
70 | String getPositionInfo(Device device);
71 |
72 | /**
73 | * Get the duration of the video playing.
74 | *
75 | * @param device
76 | * The device be controlled.
77 | * @return The media duration like 00:00:00,if get failed it will return
78 | * null.
79 | */
80 | String getMediaDuration(Device device);
81 |
82 | /**
83 | * Mute the device or not.
84 | *
85 | * @param device
86 | * The device be controlled.
87 | * @param targetValue
88 | * 1 is that want mute, 0 if you want make it off of mute.
89 | * @return If is success to mute the device.
90 | */
91 | boolean setMute(Device device, String targetValue);
92 |
93 | /**
94 | * Get if the device is mute.
95 | *
96 | * @param device
97 | * The device be controlled.
98 | * @return 1 is mute, otherwise will return 0.
99 | */
100 | String getMute(Device device);
101 |
102 | /**
103 | * Set the device's voice.
104 | *
105 | * @param device
106 | * The device be controlled.
107 | * @param value
108 | * Target voice want be set.
109 | * @return
110 | */
111 | boolean setVoice(Device device, int value);
112 |
113 | /**
114 | * Get the current voice of the device.
115 | *
116 | * @param device
117 | * The device be controlled.
118 | * @return Current voice.
119 | */
120 | int getVoice(Device device);
121 |
122 | /**
123 | * Stop to play.
124 | *
125 | * @param device
126 | * The device to controlled.
127 | * @return If if success to stop the video.
128 | */
129 | boolean stop(Device device);
130 |
131 | /**
132 | * Pause the playing video.
133 | *
134 | * @param device
135 | * The device to controlled.
136 | * @return If if success to pause the video.
137 | */
138 | boolean pause(Device device);
139 | }
140 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/service/DLNAService.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink.service;
2 |
3 | import org.cybergarage.upnp.ControlPoint;
4 |
5 | import android.app.Service;
6 | import android.content.BroadcastReceiver;
7 | import android.content.Context;
8 | import android.content.Intent;
9 | import android.content.IntentFilter;
10 | import android.net.ConnectivityManager;
11 | import android.net.wifi.WifiManager;
12 | import android.os.Bundle;
13 | import android.os.IBinder;
14 |
15 | import com.charon.cyberlink.DMCApplication;
16 | import com.charon.cyberlink.engine.SearchThread;
17 | import com.charon.cyberlink.util.LogUtil;
18 |
19 | /**
20 | * The service to search the DLNA Device in background all the time.
21 | *
22 | * @author CharonChui
23 | *
24 | */
25 | public class DLNAService extends Service {
26 | private static final String TAG = "DLNAService";
27 | private ControlPoint mControlPoint;
28 | private SearchThread mSearchThread;
29 | private WifiStateReceiver mWifiStateReceiver;
30 |
31 | @Override
32 | public IBinder onBind(Intent intent) {
33 | return null;
34 | }
35 |
36 | @Override
37 | public void onCreate() {
38 | super.onCreate();
39 | init();
40 | }
41 |
42 | @Override
43 | public void onDestroy() {
44 | super.onDestroy();
45 | unInit();
46 | }
47 |
48 | @Override
49 | public int onStartCommand(Intent intent, int flags, int startId) {
50 | startThread();
51 | return super.onStartCommand(intent, flags, startId);
52 | }
53 |
54 | private void init() {
55 | mControlPoint = new ControlPoint();
56 | DMCApplication.getInstance().setControlPoint(mControlPoint);
57 | mSearchThread = new SearchThread(mControlPoint);
58 | registerWifiStateReceiver();
59 | }
60 |
61 | private void unInit() {
62 | stopThread();
63 | unregisterWifiStateReceiver();
64 | }
65 |
66 | /**
67 | * Make the thread start to search devices.
68 | */
69 | private void startThread() {
70 | if (mSearchThread != null) {
71 | LogUtil.d(TAG, "thread is not null");
72 | mSearchThread.setSearcTimes(0);
73 | } else {
74 | LogUtil.d(TAG, "thread is null, create a new thread");
75 | mSearchThread = new SearchThread(mControlPoint);
76 | }
77 |
78 | if (mSearchThread.isAlive()) {
79 | LogUtil.d(TAG, "thread is alive");
80 | mSearchThread.awake();
81 | } else {
82 | LogUtil.d(TAG, "start the thread");
83 | mSearchThread.start();
84 | }
85 | }
86 |
87 | private void stopThread() {
88 | if (mSearchThread != null) {
89 | mSearchThread.stopThread();
90 | mControlPoint.stop();
91 | mSearchThread = null;
92 | mControlPoint = null;
93 | LogUtil.w(TAG, "stop dlna service");
94 | }
95 | }
96 |
97 | private void registerWifiStateReceiver() {
98 | if (mWifiStateReceiver == null) {
99 | mWifiStateReceiver = new WifiStateReceiver();
100 | registerReceiver(mWifiStateReceiver, new IntentFilter(
101 | ConnectivityManager.CONNECTIVITY_ACTION));
102 | }
103 | }
104 |
105 | private void unregisterWifiStateReceiver() {
106 | if (mWifiStateReceiver != null) {
107 | unregisterReceiver(mWifiStateReceiver);
108 | mWifiStateReceiver = null;
109 | }
110 | }
111 |
112 | private class WifiStateReceiver extends BroadcastReceiver {
113 | @Override
114 | public void onReceive(Context c, Intent intent) {
115 | Bundle bundle = intent.getExtras();
116 | int statusInt = bundle.getInt("wifi_state");
117 | switch (statusInt) {
118 | case WifiManager.WIFI_STATE_UNKNOWN:
119 | break;
120 | case WifiManager.WIFI_STATE_ENABLING:
121 | break;
122 | case WifiManager.WIFI_STATE_ENABLED:
123 | LogUtil.e(TAG, "wifi enable");
124 | startThread();
125 | break;
126 | case WifiManager.WIFI_STATE_DISABLING:
127 | break;
128 | case WifiManager.WIFI_STATE_DISABLED:
129 | LogUtil.e(TAG, "wifi disabled");
130 | break;
131 | default:
132 | break;
133 | }
134 | }
135 | }
136 |
137 | }
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/util/DLNAUtil.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink.util;
2 |
3 | import org.cybergarage.upnp.Device;
4 |
5 | public class DLNAUtil {
6 | private static final String MEDIARENDER = "urn:schemas-upnp-org:device:MediaRenderer:1";
7 |
8 | /**
9 | * Check if the device is a media render device
10 | *
11 | * @param device
12 | * @return
13 | */
14 | public static boolean isMediaRenderDevice(Device device) {
15 | if (device != null
16 | && MEDIARENDER.equalsIgnoreCase(device.getDeviceType())) {
17 | return true;
18 | }
19 |
20 | return false;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/util/LogUtil.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink.util;
2 |
3 | import android.util.Log;
4 |
5 | /**
6 | * Log utilities that can control whether print the log.
7 | */
8 | public class LogUtil {
9 | private static final int LOG_LEVEL = 6;
10 |
11 | private static final int VERBOSE = 5;
12 | private static final int DEBUG = 4;
13 | private static final int INFO = 3;
14 | private static final int WARN = 2;
15 | private static final int ERROR = 1;
16 |
17 | public static void v(String tag, String msg) {
18 | if (LOG_LEVEL > VERBOSE) {
19 | Log.v(tag, msg);
20 | }
21 | }
22 |
23 | public static void d(String tag, String msg) {
24 | if (LOG_LEVEL > DEBUG) {
25 | Log.d(tag, msg);
26 | }
27 | }
28 |
29 | public static void i(String tag, String msg) {
30 | if (LOG_LEVEL > INFO) {
31 | Log.i(tag, msg);
32 | }
33 | }
34 |
35 | public static void w(String tag, String msg) {
36 | if (LOG_LEVEL > WARN) {
37 | Log.w(tag, msg);
38 | }
39 | }
40 |
41 | public static void e(String tag, String msg) {
42 | if (LOG_LEVEL > ERROR) {
43 | Log.e(tag, msg);
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/java/com/charonchui/cyberlink/util/NetUtil.java:
--------------------------------------------------------------------------------
1 | package com.charon.cyberlink.util;
2 |
3 | import android.content.Context;
4 | import android.net.ConnectivityManager;
5 | import android.net.NetworkInfo;
6 | import android.net.wifi.WifiManager;
7 |
8 | /**
9 | * 网络连接的一些工具类
10 | */
11 | public class NetUtil {
12 |
13 | /**
14 | * 判断当前网络是否可用
15 | */
16 | public static boolean isNetAvailable(Context context) {
17 | ConnectivityManager connectivityManager = (ConnectivityManager) context
18 | .getSystemService(Context.CONNECTIVITY_SERVICE);
19 | NetworkInfo activeNetworkInfo = connectivityManager
20 | .getActiveNetworkInfo();
21 | return activeNetworkInfo != null && activeNetworkInfo.isAvailable();
22 | }
23 |
24 | /**
25 | * 判断WIFI是否使用
26 | */
27 | public static boolean isWIFIActivate(Context context) {
28 | return ((WifiManager) context.getSystemService(Context.WIFI_SERVICE))
29 | .isWifiEnabled();
30 | }
31 |
32 | /**
33 | * 修改WIFI状态
34 | *
35 | * @param status
36 | * true为开启WIFI,false为关闭WIFI
37 | */
38 | public static void changeWIFIStatus(Context context, boolean status) {
39 | ((WifiManager) context.getSystemService(Context.WIFI_SERVICE))
40 | .setWifiEnabled(status);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/back_fast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/back_fast.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/back_fast_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/back_fast_on.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/devices.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/devices.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/dlna_search_focused.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/dlna_search_focused.9.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/dlna_search_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/dlna_search_normal.9.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/go_fast.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/go_fast.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/go_fast_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/go_fast_on.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/home_background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/home_background.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_bg.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_pause01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_pause01.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_pause02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_pause02.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_play01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_play01.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_play02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/mediacontroller_play02.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/next_video_button_nomal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/next_video_button_nomal.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/next_video_button_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/next_video_button_selected.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/pause_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/pause_button.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/play_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/play_button.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/pre_video_button_nomal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/pre_video_button_nomal.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/pre_video_button_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/pre_video_button_selected.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_disabled_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_disabled_holo.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_focused_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_focused_holo.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_normal_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_normal_holo.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_pressed_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/scrubber_control_pressed_holo.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/scrubber_primary_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/scrubber_primary_holo.9.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/scrubber_secondary_holo.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/scrubber_secondary_holo.9.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/scrubber_track_holo_dark.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/scrubber_track_holo_dark.9.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/splash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/splash.jpg
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/tip_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/tip_bg.9.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/volume_must.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/volume_must.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/volume_no_nomal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/volume_no_nomal.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable-hdpi/volume_no_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/drawable-hdpi/volume_no_selected.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/back_fast_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/dlna_search_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/go_fast_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/mediacontroller_pause_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/mediacontroller_play_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/next_video_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/pre_video_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/scrubber_control_selector_holo.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/drawable/scrubber_progress_horizontal_holo_dark.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
17 | -
18 |
21 |
22 | -
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
18 |
19 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/layout/activity_splash.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
14 |
15 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/layout/empty_view.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
12 |
13 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/layout/item_lv_main.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
13 |
14 |
24 |
25 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/dmc_sample/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DLNA_DMC
5 | Settings
6 | Hello world!
7 | splash image
8 | No devices, please make sure the devices are in the same wifi network, and retry later.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/dmc_sample/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
30 |
31 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 22
5 | buildToolsVersion "22.0.1"
6 |
7 | defaultConfig {
8 | minSdkVersion 8
9 | targetSdkVersion 22
10 | versionCode 1
11 | versionName "1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | }
24 |
--------------------------------------------------------------------------------
/library/libs/clink210.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CharonChui/CyberLink4Android/0175bdc9c3cb3a35aab74ec68e6a9c745f135e1f/library/libs/clink210.jar
--------------------------------------------------------------------------------
/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /home/xuchuanren/android-sdks/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/library/src/androidTest/java/com/charon/library/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.charon.library;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/sql/mysql/MySQL.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * CyberSQL for Java
4 | *
5 | * Copyright (C) Satoshi Konno 2004
6 | *
7 | * File: MySQL.java
8 | *
9 | * Revision;
10 | *
11 | * 02/10/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.sql.mysql;
17 |
18 | import java.sql.*;
19 | import org.cybergarage.sql.*;
20 | import org.cybergarage.util.*;
21 |
22 | public class MySQL extends Database
23 | {
24 | ////////////////////////////////////////////////
25 | // Constructor
26 | ////////////////////////////////////////////////
27 |
28 | public MySQL()
29 | {
30 | try {
31 | Class.forName("com.mysql.jdbc.Driver").newInstance();
32 | }
33 | catch (Exception e) {
34 | Debug.warning(e);
35 | }
36 | }
37 |
38 | ////////////////////////////////////////////////
39 | // abstract methods
40 | ////////////////////////////////////////////////
41 |
42 | public boolean open(String host, String dbname, String user, String passwd)
43 | {
44 | try {
45 | String dburl = "jdbc:mysql://" + host + "/" + dbname;
46 | Connection con = DriverManager.getConnection(dburl, user, passwd);
47 | setConnection(con);
48 | }
49 | catch (Exception e) {
50 | Debug.warning(e);
51 | return false;
52 | }
53 |
54 | return true;
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/controller/server/BrowseAction.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaPlayer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2005
6 | *
7 | * File : BrowseAction.java
8 | *
9 | * 09/26/05
10 | * - first revision.
11 | *
12 | ******************************************************************/
13 |
14 | package org.cybergarage.upnp.std.av.controller.server;
15 |
16 | import org.cybergarage.upnp.*;
17 |
18 | public class BrowseAction
19 | {
20 | ////////////////////////////////////////////////
21 | // Constants
22 | ////////////////////////////////////////////////
23 |
24 | public final static String OBJECT_ID = "ObjectID";
25 | public final static String BROWSE_FLAG = "BrowseFlag";
26 | public final static String FILTER = "Filter";
27 | public final static String STARTING_INDEX = "StartingIndex";
28 | public final static String REQUESTED_COUNT = "RequestedCount";
29 | public final static String SORT_CRITERIA = "SortCriteria";
30 |
31 | public final static String BROWSE_METADATA = "BrowseMetadata";
32 | public final static String BROWSE_DIRECT_CHILDREN = "BrowseDirectChildren";
33 |
34 | public final static String RESULT = "Result";
35 | public final static String NUMBER_RETURNED = "NumberReturned";
36 | public final static String TOTAL_MACHES = "TotalMatches";
37 | public final static String UPDATE_ID = "UpdateID";
38 |
39 | ////////////////////////////////////////////////
40 | // Member
41 | ////////////////////////////////////////////////
42 |
43 | private Action action;
44 |
45 | ////////////////////////////////////////////////
46 | // Constrictor
47 | ////////////////////////////////////////////////
48 |
49 | public BrowseAction(Action action)
50 | {
51 | this.action = action;
52 | }
53 |
54 | ////////////////////////////////////////////////
55 | // getArgument
56 | ////////////////////////////////////////////////
57 |
58 | public Argument getArgument(String name)
59 | {
60 | return action.getArgument(name);
61 | }
62 |
63 | ////////////////////////////////////////////////
64 | // Request
65 | ////////////////////////////////////////////////
66 |
67 | public String getBrowseFlag()
68 | {
69 | return action.getArgumentValue(BROWSE_FLAG);
70 | }
71 |
72 | public boolean isMetadata()
73 | {
74 | return BROWSE_METADATA.equals(getBrowseFlag());
75 | }
76 |
77 | public boolean isDirectChildren()
78 | {
79 | return BROWSE_DIRECT_CHILDREN.equals(getBrowseFlag());
80 | }
81 |
82 | public String getObjectID()
83 | {
84 | return action.getArgumentValue(OBJECT_ID);
85 | }
86 |
87 | public int getStartingIndex()
88 | {
89 | return action.getArgumentIntegerValue(STARTING_INDEX);
90 | }
91 |
92 | public int getRequestedCount()
93 | {
94 | return action.getArgumentIntegerValue(REQUESTED_COUNT);
95 | }
96 |
97 | public String getSortCriteria()
98 | {
99 | return action.getArgumentValue(SORT_CRITERIA);
100 | }
101 |
102 | public String getFilter()
103 | {
104 | return action.getArgumentValue(FILTER);
105 | }
106 |
107 | ////////////////////////////////////////////////
108 | // Request
109 | ////////////////////////////////////////////////
110 |
111 | public void setBrowseFlag(String browseFlag)
112 | {
113 | action.setArgumentValue(BROWSE_FLAG, browseFlag);
114 | }
115 |
116 | public void setObjectID(String objectID)
117 | {
118 | action.setArgumentValue(OBJECT_ID, objectID);
119 | }
120 |
121 | public void setStartingIndex(int idx)
122 | {
123 | action.setArgumentValue(STARTING_INDEX, idx);
124 | }
125 |
126 | public void setRequestedCount(int count)
127 | {
128 | action.setArgumentValue(REQUESTED_COUNT, count);
129 | }
130 |
131 | public void setFilter(String filter)
132 | {
133 | action.setArgumentValue(FILTER, filter);
134 | }
135 |
136 | public void setSortCriteria(String sortCaiteria)
137 | {
138 | action.setArgumentValue(SORT_CRITERIA, sortCaiteria);
139 | }
140 |
141 | ////////////////////////////////////////////////
142 | // Result
143 | ////////////////////////////////////////////////
144 |
145 | public void setResult(String value)
146 | {
147 | action.setArgumentValue(RESULT, value);
148 | }
149 |
150 | public void setNumberReturned(int value)
151 | {
152 | action.setArgumentValue(NUMBER_RETURNED, value);
153 | }
154 |
155 | public void setTotalMaches(int value)
156 | {
157 | action.setArgumentValue(TOTAL_MACHES, value);
158 | }
159 |
160 | public void setUpdateID(int value)
161 | {
162 | action.setArgumentValue(UPDATE_ID, value);
163 | }
164 |
165 | ////////////////////////////////////////////////
166 | // post
167 | ////////////////////////////////////////////////
168 |
169 | public boolean postControlAction()
170 | {
171 | return action.postControlAction();
172 | }
173 | }
174 |
175 |
176 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/controller/server/BrowseResult.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaPlayer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2005
6 | *
7 | * File : BrowseAction.java
8 | *
9 | * 09/26/05
10 | * - first revision.
11 | *
12 | ******************************************************************/
13 |
14 | package org.cybergarage.upnp.std.av.controller.server;
15 |
16 | import org.cybergarage.xml.*;
17 |
18 | public class BrowseResult
19 | {
20 | ////////////////////////////////////////////////
21 | // Member
22 | ////////////////////////////////////////////////
23 |
24 | private Node resultNode;
25 |
26 | ////////////////////////////////////////////////
27 | // Constrictor
28 | ////////////////////////////////////////////////
29 |
30 | public BrowseResult(Node node)
31 | {
32 | setResultNode(node);
33 | }
34 |
35 | ////////////////////////////////////////////////
36 | // Request
37 | ////////////////////////////////////////////////
38 |
39 | public void setResultNode(Node node)
40 | {
41 | resultNode = node;
42 | }
43 |
44 | public Node getResultNode()
45 | {
46 | return resultNode;
47 | }
48 |
49 | ////////////////////////////////////////////////
50 | // ContentNode
51 | ////////////////////////////////////////////////
52 |
53 | public int getNContentNodes()
54 | {
55 | return resultNode.getNNodes();
56 | }
57 |
58 | public Node getContentNode(int n)
59 | {
60 | return resultNode.getNode(n);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/player/MediaPlayer.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaPlayer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2005
6 | *
7 | * File : MediaPlayer.java
8 | *
9 | * 09/26/05
10 | * - first revision.
11 | * 02/05/08
12 | * - Added getContentDirectory(dev, objectId).
13 | * - Added browse().
14 | *
15 | ******************************************************************/
16 |
17 | package org.cybergarage.upnp.std.av.player;
18 |
19 | import org.cybergarage.upnp.std.av.renderer.*;
20 | import org.cybergarage.upnp.std.av.controller.*;
21 |
22 | public class MediaPlayer
23 | {
24 | ////////////////////////////////////////////////
25 | // Member
26 | ////////////////////////////////////////////////
27 |
28 | private MediaRenderer renderer = null;
29 | private MediaController controller = null;
30 |
31 | ////////////////////////////////////////////////
32 | // Constructor
33 | ////////////////////////////////////////////////
34 |
35 | public MediaPlayer(boolean useDMC, boolean useDMR)
36 | {
37 | if (useDMC)
38 | enableRenderer();
39 | if (useDMR)
40 | enableController();
41 | }
42 |
43 | public MediaPlayer()
44 | {
45 | this(true, true);
46 | }
47 |
48 | ////////////////////////////////////////////////
49 | // Controller
50 | ////////////////////////////////////////////////
51 |
52 | public MediaController getController()
53 | {
54 | return controller;
55 | }
56 |
57 | public void enableController()
58 | {
59 | if (controller == null)
60 | controller = new MediaController();
61 | }
62 |
63 | public void disableController()
64 | {
65 | controller = null;
66 | }
67 |
68 | public boolean isControllerEnable()
69 | {
70 | return (controller != null) ? true : false;
71 | }
72 |
73 | ////////////////////////////////////////////////
74 | // Renderer
75 | ////////////////////////////////////////////////
76 |
77 | public MediaRenderer getRenderer()
78 | {
79 | return renderer;
80 | }
81 |
82 | public void enableRenderer()
83 | {
84 | if (renderer == null)
85 | renderer = new MediaRenderer();
86 | }
87 |
88 | public void disableRenderer()
89 | {
90 | renderer = null;
91 | }
92 |
93 | public boolean isRendererEnable()
94 | {
95 | return (renderer != null) ? true : false;
96 | }
97 |
98 | ////////////////////////////////////////////////
99 | // Member
100 | ///////////////////////////
101 | /////////////////////
102 |
103 | public void start()
104 | {
105 | if (renderer != null)
106 | renderer.start();
107 | if (controller != null)
108 | controller.start();
109 | }
110 |
111 | public void stop()
112 | {
113 | if (renderer != null)
114 | renderer.stop();
115 | if (controller != null)
116 | controller.stop();
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/player/action/BrowseAction.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaPlayer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2005
6 | *
7 | * File : BrowseAction.java
8 | *
9 | * 09/26/05
10 | * - first revision.
11 | *
12 | ******************************************************************/
13 |
14 | package org.cybergarage.upnp.std.av.player.action;
15 |
16 | import org.cybergarage.upnp.*;
17 |
18 | public class BrowseAction
19 | {
20 | ////////////////////////////////////////////////
21 | // Constants
22 | ////////////////////////////////////////////////
23 |
24 | public final static String OBJECT_ID = "ObjectID";
25 | public final static String BROWSE_FLAG = "BrowseFlag";
26 | public final static String FILTER = "Filter";
27 | public final static String STARTING_INDEX = "StartingIndex";
28 | public final static String REQUESTED_COUNT = "RequestedCount";
29 | public final static String SORT_CRITERIA = "SortCriteria";
30 |
31 | public final static String BROWSE_METADATA = "BrowseMetadata";
32 | public final static String BROWSE_DIRECT_CHILDREN = "BrowseDirectChildren";
33 |
34 | public final static String RESULT = "Result";
35 | public final static String NUMBER_RETURNED = "NumberReturned";
36 | public final static String TOTAL_MACHES = "TotalMatches";
37 | public final static String UPDATE_ID = "UpdateID";
38 |
39 | ////////////////////////////////////////////////
40 | // Member
41 | ////////////////////////////////////////////////
42 |
43 | private Action action;
44 |
45 | ////////////////////////////////////////////////
46 | // Constrictor
47 | ////////////////////////////////////////////////
48 |
49 | public BrowseAction(Action action)
50 | {
51 | this.action = action;
52 | }
53 |
54 | ////////////////////////////////////////////////
55 | // getArgument
56 | ////////////////////////////////////////////////
57 |
58 | public Argument getArgument(String name)
59 | {
60 | return action.getArgument(name);
61 | }
62 |
63 | ////////////////////////////////////////////////
64 | // Request
65 | ////////////////////////////////////////////////
66 |
67 | public String getBrowseFlag()
68 | {
69 | return action.getArgumentValue(BROWSE_FLAG);
70 | }
71 |
72 | public boolean isMetadata()
73 | {
74 | return BROWSE_METADATA.equals(getBrowseFlag());
75 | }
76 |
77 | public boolean isDirectChildren()
78 | {
79 | return BROWSE_DIRECT_CHILDREN.equals(getBrowseFlag());
80 | }
81 |
82 | public String getObjectID()
83 | {
84 | return action.getArgumentValue(OBJECT_ID);
85 | }
86 |
87 | public int getStartingIndex()
88 | {
89 | return action.getArgumentIntegerValue(STARTING_INDEX);
90 | }
91 |
92 | public int getRequestedCount()
93 | {
94 | return action.getArgumentIntegerValue(REQUESTED_COUNT);
95 | }
96 |
97 | public int getNumberReturned()
98 | {
99 | return action.getArgumentIntegerValue(NUMBER_RETURNED);
100 | }
101 |
102 | public int getTotalMatches()
103 | {
104 | return action.getArgumentIntegerValue(TOTAL_MACHES);
105 | }
106 |
107 | public String getSortCriteria()
108 | {
109 | return action.getArgumentValue(SORT_CRITERIA);
110 | }
111 |
112 | public String getFilter()
113 | {
114 | return action.getArgumentValue(FILTER);
115 | }
116 |
117 | ////////////////////////////////////////////////
118 | // Request
119 | ////////////////////////////////////////////////
120 |
121 | public void setBrowseFlag(String browseFlag)
122 | {
123 | action.setArgumentValue(BROWSE_FLAG, browseFlag);
124 | }
125 |
126 | public void setObjectID(String objectID)
127 | {
128 | action.setArgumentValue(OBJECT_ID, objectID);
129 | }
130 |
131 | public void setStartingIndex(int idx)
132 | {
133 | action.setArgumentValue(STARTING_INDEX, idx);
134 | }
135 |
136 | public void setRequestedCount(int count)
137 | {
138 | action.setArgumentValue(REQUESTED_COUNT, count);
139 | }
140 |
141 | public void setFilter(String filter)
142 | {
143 | action.setArgumentValue(FILTER, filter);
144 | }
145 |
146 | public void setSortCriteria(String sortCaiteria)
147 | {
148 | action.setArgumentValue(SORT_CRITERIA, sortCaiteria);
149 | }
150 |
151 | ////////////////////////////////////////////////
152 | // Result
153 | ////////////////////////////////////////////////
154 |
155 | public void setResult(String value)
156 | {
157 | action.setArgumentValue(RESULT, value);
158 | }
159 |
160 | public void setNumberReturned(int value)
161 | {
162 | action.setArgumentValue(NUMBER_RETURNED, value);
163 | }
164 |
165 | public void setTotalMaches(int value)
166 | {
167 | action.setArgumentValue(TOTAL_MACHES, value);
168 | }
169 |
170 | public void setUpdateID(int value)
171 | {
172 | action.setArgumentValue(UPDATE_ID, value);
173 | }
174 |
175 | ////////////////////////////////////////////////
176 | // post
177 | ////////////////////////////////////////////////
178 |
179 | public boolean postControlAction()
180 | {
181 | return action.postControlAction();
182 | }
183 | }
184 |
185 |
186 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/player/action/BrowseResult.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaPlayer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2005
6 | *
7 | * File : BrowseAction.java
8 | *
9 | * 09/26/05
10 | * - first revision.
11 | *
12 | ******************************************************************/
13 |
14 | package org.cybergarage.upnp.std.av.player.action;
15 |
16 | import org.cybergarage.xml.*;
17 |
18 | public class BrowseResult
19 | {
20 | ////////////////////////////////////////////////
21 | // Member
22 | ////////////////////////////////////////////////
23 |
24 | private Node resultNode;
25 |
26 | ////////////////////////////////////////////////
27 | // Constrictor
28 | ////////////////////////////////////////////////
29 |
30 | public BrowseResult(Node node)
31 | {
32 | setResultNode(node);
33 | }
34 |
35 | ////////////////////////////////////////////////
36 | // Request
37 | ////////////////////////////////////////////////
38 |
39 | public void setResultNode(Node node)
40 | {
41 | resultNode = node;
42 | }
43 |
44 | public Node getResultNode()
45 | {
46 | return resultNode;
47 | }
48 |
49 | ////////////////////////////////////////////////
50 | // ContentNode
51 | ////////////////////////////////////////////////
52 |
53 | public int getNContentNodes()
54 | {
55 | return resultNode.getNNodes();
56 | }
57 |
58 | public Node getContentNode(int n)
59 | {
60 | return resultNode.getNode(n);
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/player/action/BrowseResultNode.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaPlayer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2005
6 | *
7 | * File : BrowseAction.java
8 | *
9 | * 09/26/05
10 | * - first revision.
11 | *
12 | ******************************************************************/
13 |
14 | package org.cybergarage.upnp.std.av.player.action;
15 |
16 | import java.io.*;
17 |
18 | import org.cybergarage.upnp.std.av.server.object.item.*;
19 |
20 | public class BrowseResultNode extends ItemNode
21 | {
22 | ////////////////////////////////////////////////
23 | // Constroctor
24 | ////////////////////////////////////////////////
25 |
26 | public BrowseResultNode()
27 | {
28 | }
29 |
30 | ////////////////////////////////////////////////
31 | // Abstract methods
32 | ////////////////////////////////////////////////
33 |
34 | public long getContentLength()
35 | {
36 | return 0;
37 | }
38 |
39 | public InputStream getContentInputStream()
40 | {
41 | return null;
42 | }
43 |
44 | public String getMimeType()
45 | {
46 | return "*/*";
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/renderer/AVTransportInfo.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File : ConnectionInfo.java
8 | *
9 | * Revision:
10 | *
11 | * 02/22/08
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.renderer;
17 |
18 | public class AVTransportInfo
19 | {
20 | ////////////////////////////////////////////////
21 | // Constructor
22 | ////////////////////////////////////////////////
23 |
24 | public AVTransportInfo()
25 | {
26 | setInstanceID(0);
27 | setURI("");
28 | setURIMetaData("");
29 | }
30 |
31 | ////////////////////////////////////////////////
32 | // Constructor
33 | ////////////////////////////////////////////////
34 |
35 | private int instanceID;
36 |
37 | public int getInstanceID() {
38 | return instanceID;
39 | }
40 |
41 | public void setInstanceID(int instanceID) {
42 | this.instanceID = instanceID;
43 | }
44 |
45 | ////////////////////////////////////////////////
46 | // Constructor
47 | ////////////////////////////////////////////////
48 |
49 | private String uri;
50 |
51 | public String getURI() {
52 | return uri;
53 | }
54 |
55 | public void setURI(String uri) {
56 | this.uri = uri;
57 | }
58 |
59 | ////////////////////////////////////////////////
60 | // Constructor
61 | ////////////////////////////////////////////////
62 |
63 | private String uriMetaData;
64 |
65 | public String getURIMetaData() {
66 | return uriMetaData;
67 | }
68 |
69 | public void setURIMetaData(String uriMetaData) {
70 | this.uriMetaData = uriMetaData;
71 | }
72 |
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/renderer/AVTransportInfoList.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File: ConnectionInfoList.java
8 | *
9 | * Revision;
10 | *
11 | * 02/22/08
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.renderer;
17 |
18 | import java.util.*;
19 |
20 | public class AVTransportInfoList extends Vector
21 | {
22 | ////////////////////////////////////////////////
23 | // Constrictor
24 | ////////////////////////////////////////////////
25 |
26 | public AVTransportInfoList()
27 | {
28 | }
29 |
30 | ////////////////////////////////////////////////
31 | // getConnectionInfo
32 | ////////////////////////////////////////////////
33 |
34 | public AVTransportInfo getAVTransportInfo(int n)
35 | {
36 | return (AVTransportInfo)get(n);
37 | }
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/renderer/ConnectionInfo.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File : ConnectionInfo.java
8 | *
9 | * Revision:
10 | *
11 | * 02/22/08
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.renderer;
17 |
18 | public class ConnectionInfo
19 | {
20 | ////////////////////////////////////////////////
21 | // Constants
22 | ////////////////////////////////////////////////
23 |
24 | public final static String INPUT = "Input";
25 | public final static String OUTPUT = "Output";
26 | public final static String OK = "OK";
27 | public final static String UNKNOWN = "Unknown";
28 |
29 | ////////////////////////////////////////////////
30 | // Constructor
31 | ////////////////////////////////////////////////
32 |
33 | public ConnectionInfo(int id)
34 | {
35 | setID(id);
36 | setRcsID(-1);
37 | setAVTransportID(-1);
38 | setProtocolInfo("");
39 | setPeerConnectionManager("");
40 | setPeerConnectionID(-1);
41 | setDirection(OUTPUT);
42 | setStatus(UNKNOWN);
43 | }
44 |
45 | ////////////////////////////////////////////////
46 | // ID
47 | ////////////////////////////////////////////////
48 |
49 | private int id;
50 |
51 | public void setID(int value)
52 | {
53 | id = value;
54 | }
55 |
56 | public int getID()
57 | {
58 | return id;
59 | }
60 |
61 | ////////////////////////////////////////////////
62 | // RcsID
63 | ////////////////////////////////////////////////
64 |
65 | private int rcsId;
66 |
67 | public void setRcsID(int value)
68 | {
69 | rcsId = value;
70 | }
71 |
72 | public int getRcsID()
73 | {
74 | return rcsId;
75 | }
76 |
77 | ////////////////////////////////////////////////
78 | // AVTransportID
79 | ////////////////////////////////////////////////
80 |
81 | private int transId;
82 |
83 | public void setAVTransportID(int value)
84 | {
85 | transId = value;
86 | }
87 |
88 | public int getAVTransportID()
89 | {
90 | return transId;
91 | }
92 |
93 | ////////////////////////////////////////////////
94 | // ProtocolInfo
95 | ////////////////////////////////////////////////
96 |
97 | private String protocolInfo;
98 |
99 | public void setProtocolInfo(String value)
100 | {
101 | protocolInfo = value;
102 | }
103 |
104 | public String getProtocolInfo()
105 | {
106 | return protocolInfo;
107 | }
108 |
109 | ////////////////////////////////////////////////
110 | // PeerConnectionManager
111 | ////////////////////////////////////////////////
112 |
113 | private String peerConnectionManager;
114 |
115 | public void setPeerConnectionManager(String value)
116 | {
117 | peerConnectionManager = value;
118 | }
119 |
120 | public String getPeerConnectionManager()
121 | {
122 | return peerConnectionManager;
123 | }
124 |
125 | ////////////////////////////////////////////////
126 | // PeerConnectionID
127 | ////////////////////////////////////////////////
128 |
129 | private int peerConnectionID;
130 |
131 | public void setPeerConnectionID(int value)
132 | {
133 | peerConnectionID = value;
134 | }
135 |
136 | public int getPeerConnectionID()
137 | {
138 | return peerConnectionID;
139 | }
140 |
141 | ////////////////////////////////////////////////
142 | // Direction
143 | ////////////////////////////////////////////////
144 |
145 | private String direction;
146 |
147 | public void setDirection(String value)
148 | {
149 | direction = value;
150 | }
151 |
152 | public String getDirection()
153 | {
154 | return direction;
155 | }
156 |
157 | ////////////////////////////////////////////////
158 | // Status
159 | ////////////////////////////////////////////////
160 |
161 | private String status;
162 |
163 | public void setStatus(String value)
164 | {
165 | status = value;
166 | }
167 |
168 | public String getStatus()
169 | {
170 | return status;
171 | }
172 | }
173 |
174 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/renderer/ConnectionInfoList.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File: ConnectionInfoList.java
8 | *
9 | * Revision;
10 | *
11 | * 02/22/08
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.renderer;
17 |
18 | import java.util.*;
19 |
20 | public class ConnectionInfoList extends Vector
21 | {
22 | ////////////////////////////////////////////////
23 | // Constrictor
24 | ////////////////////////////////////////////////
25 |
26 | public ConnectionInfoList()
27 | {
28 | }
29 |
30 | ////////////////////////////////////////////////
31 | // getConnectionInfo
32 | ////////////////////////////////////////////////
33 |
34 | public ConnectionInfo getConnectionInfo(int n)
35 | {
36 | return (ConnectionInfo)get(n);
37 | }
38 |
39 |
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/renderer/MediaRenderer.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003
6 | *
7 | * File : MediaRender.java
8 | *
9 | * 02/22/08
10 | * - first revision.
11 | *
12 | ******************************************************************/
13 |
14 | package org.cybergarage.upnp.std.av.renderer;
15 |
16 | import java.io.*;
17 |
18 | import org.cybergarage.net.*;
19 | import org.cybergarage.util.*;
20 | import org.cybergarage.http.*;
21 | import org.cybergarage.upnp.*;
22 | import org.cybergarage.upnp.control.ActionListener;
23 | import org.cybergarage.upnp.device.*;
24 |
25 | public class MediaRenderer extends Device
26 | {
27 | ////////////////////////////////////////////////
28 | // Constants
29 | ////////////////////////////////////////////////
30 |
31 | public final static String DEVICE_TYPE = "urn:schemas-upnp-org:device:MediaRenderer:1";
32 |
33 | public final static int DEFAULT_HTTP_PORT = 39520;
34 |
35 | public final static String DESCRIPTION =
36 | "\n" +
37 | "\n" +
38 | " \n" +
39 | " 1\n" +
40 | " 0\n" +
41 | " \n" +
42 | " \n" +
43 | " urn:schemas-upnp-org:device:MediaRender:1\n" +
44 | " Cyber Garage Media Render\n" +
45 | " Cyber Garage\n" +
46 | " http://www.cybergarage.org\n" +
47 | " Provides content through UPnP ContentDirectory service\n" +
48 | " Cyber Garage Media Render\n" +
49 | " 1.0\n" +
50 | " http://www.cybergarage.org\n" +
51 | " uuid:362d9414-31a0-48b6-b684-2b4bd38391d0\n" +
52 | " \n" +
53 | " \n" +
54 | " urn:schemas-upnp-org:service:RenderingControl:1\n" +
55 | " RenderingControl\n" +
56 | " \n" +
57 | " \n" +
58 | " urn:schemas-upnp-org:service:ConnectionManager:1\n" +
59 | " ConnectionManager\n" +
60 | " \n" +
61 | " \n" +
62 | " urn:schemas-upnp-org:service:AVTransport:1\n" +
63 | " AVTransport\n" +
64 | " \n" +
65 | " \n" +
66 | " \n" +
67 | "";
68 |
69 | ////////////////////////////////////////////////
70 | // Constructor
71 | ////////////////////////////////////////////////
72 |
73 | private final static String DESCRIPTION_FILE_NAME = "description/description.xml";
74 |
75 | public MediaRenderer(String descriptionFileName) throws InvalidDescriptionException
76 | {
77 | super(new File(descriptionFileName));
78 | initialize();
79 | }
80 |
81 | public MediaRenderer()
82 | {
83 | super();
84 | try {
85 | initialize(DESCRIPTION, RenderingControl.SCPD, ConnectionManager.SCPD, AVTransport.SCPD);
86 | }
87 | catch (InvalidDescriptionException ide) {}
88 | }
89 |
90 | public MediaRenderer(String description, String renderCtrlSCPD, String conMgrSCPD, String avTransSCPD) throws InvalidDescriptionException
91 | {
92 | super();
93 | initialize(description, renderCtrlSCPD, conMgrSCPD, avTransSCPD);
94 | }
95 |
96 | private void initialize(String description, String renderCtrlSCPD, String conMgrSCPD, String avTransSCPD) throws InvalidDescriptionException
97 | {
98 | loadDescription(description);
99 |
100 | Service renCtrlService = getService(RenderingControl.SERVICE_TYPE);
101 | renCtrlService.loadSCPD(renderCtrlSCPD);
102 |
103 | Service conManService = getService(ConnectionManager.SERVICE_TYPE);
104 | conManService.loadSCPD(conMgrSCPD);
105 |
106 | Service avTransService = getService(AVTransport.SERVICE_TYPE);
107 | avTransService.loadSCPD(avTransSCPD);
108 |
109 | initialize();
110 | }
111 |
112 | private void initialize()
113 | {
114 | // Netwroking initialization
115 | UPnP.setEnable(UPnP.USE_ONLY_IPV4_ADDR);
116 | String firstIf = HostInterface.getHostAddress(0);
117 | setInterfaceAddress(firstIf);
118 | setHTTPPort(DEFAULT_HTTP_PORT);
119 |
120 | renCon = new RenderingControl(this);
121 | conMan = new ConnectionManager(this);
122 | avTrans = new AVTransport(this);
123 |
124 | setActionListener(null);
125 | }
126 |
127 | protected void finalize()
128 | {
129 | stop();
130 | }
131 |
132 | ////////////////////////////////////////////////
133 | // Memeber
134 | ////////////////////////////////////////////////
135 |
136 | private ConnectionManager conMan;
137 | private RenderingControl renCon;
138 | private AVTransport avTrans;
139 |
140 | public ConnectionManager getConnectionManager()
141 | {
142 | return conMan;
143 | }
144 |
145 | public RenderingControl getRenderingControl()
146 | {
147 | return renCon;
148 | }
149 |
150 | public AVTransport getAVTransport()
151 | {
152 | return avTrans;
153 | }
154 |
155 | ////////////////////////////////////////////////
156 | // HostAddress
157 | ////////////////////////////////////////////////
158 |
159 | public void setInterfaceAddress(String ifaddr)
160 | {
161 | HostInterface.setInterface(ifaddr);
162 | }
163 |
164 | public String getInterfaceAddress()
165 | {
166 | return HostInterface.getInterface();
167 | }
168 |
169 | ////////////////////////////////////////////////
170 | // HttpRequestListner (Overridded)
171 | ////////////////////////////////////////////////
172 |
173 | public void httpRequestRecieved(HTTPRequest httpReq)
174 | {
175 | String uri = httpReq.getURI();
176 | Debug.message("uri = " + uri);
177 |
178 | /*
179 | if (uri.startsWith(ContentDirectory.CONTENT_EXPORT_URI) == true) {
180 | getContentDirectory().contentExportRequestRecieved(httpReq);
181 | return;
182 | }
183 | */
184 |
185 | super.httpRequestRecieved(httpReq);
186 | }
187 |
188 | ////////////////////////////////////////////////
189 | // Action Listener
190 | ////////////////////////////////////////////////
191 |
192 | private ActionListener actionListener;
193 |
194 | public void setActionListener(ActionListener listener)
195 | {
196 | actionListener = listener;
197 | }
198 |
199 | public ActionListener getActionListener()
200 | {
201 | return actionListener;
202 | }
203 |
204 | ////////////////////////////////////////////////
205 | // start/stop (Overided)
206 | ////////////////////////////////////////////////
207 |
208 | public boolean start()
209 | {
210 | super.start();
211 | return true;
212 | }
213 |
214 | public boolean stop()
215 | {
216 | super.stop();
217 | return true;
218 | }
219 |
220 | ////////////////////////////////////////////////
221 | // update
222 | ////////////////////////////////////////////////
223 |
224 | public void update()
225 | {
226 | }
227 |
228 | }
229 |
230 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/ConnectionInfo.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File : ConnectionInfo.java
8 | *
9 | * Revision:
10 | *
11 | * 06/19/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server;
17 |
18 | public class ConnectionInfo
19 | {
20 | ////////////////////////////////////////////////
21 | // Constants
22 | ////////////////////////////////////////////////
23 |
24 | public final static String INPUT = "Input";
25 | public final static String OUTPUT = "Output";
26 | public final static String OK = "OK";
27 | public final static String UNKNOWN = "Unknown";
28 |
29 | ////////////////////////////////////////////////
30 | // Constructor
31 | ////////////////////////////////////////////////
32 |
33 | public ConnectionInfo(int id)
34 | {
35 | setID(id);
36 | setRcsID(-1);
37 | setAVTransportID(-1);
38 | setProtocolInfo("");
39 | setPeerConnectionManager("");
40 | setPeerConnectionID(-1);
41 | setDirection(OUTPUT);
42 | setStatus(UNKNOWN);
43 | }
44 |
45 | ////////////////////////////////////////////////
46 | // ID
47 | ////////////////////////////////////////////////
48 |
49 | private int id;
50 |
51 | public void setID(int value)
52 | {
53 | id = value;
54 | }
55 |
56 | public int getID()
57 | {
58 | return id;
59 | }
60 |
61 | ////////////////////////////////////////////////
62 | // RcsID
63 | ////////////////////////////////////////////////
64 |
65 | private int rcsId;
66 |
67 | public void setRcsID(int value)
68 | {
69 | rcsId = value;
70 | }
71 |
72 | public int getRcsID()
73 | {
74 | return rcsId;
75 | }
76 |
77 | ////////////////////////////////////////////////
78 | // AVTransportID
79 | ////////////////////////////////////////////////
80 |
81 | private int transId;
82 |
83 | public void setAVTransportID(int value)
84 | {
85 | transId = value;
86 | }
87 |
88 | public int getAVTransportID()
89 | {
90 | return transId;
91 | }
92 |
93 | ////////////////////////////////////////////////
94 | // ProtocolInfo
95 | ////////////////////////////////////////////////
96 |
97 | private String protocolInfo;
98 |
99 | public void setProtocolInfo(String value)
100 | {
101 | protocolInfo = value;
102 | }
103 |
104 | public String getProtocolInfo()
105 | {
106 | return protocolInfo;
107 | }
108 |
109 | ////////////////////////////////////////////////
110 | // PeerConnectionManager
111 | ////////////////////////////////////////////////
112 |
113 | private String peerConnectionManager;
114 |
115 | public void setPeerConnectionManager(String value)
116 | {
117 | peerConnectionManager = value;
118 | }
119 |
120 | public String getPeerConnectionManager()
121 | {
122 | return peerConnectionManager;
123 | }
124 |
125 | ////////////////////////////////////////////////
126 | // PeerConnectionID
127 | ////////////////////////////////////////////////
128 |
129 | private int peerConnectionID;
130 |
131 | public void setPeerConnectionID(int value)
132 | {
133 | peerConnectionID = value;
134 | }
135 |
136 | public int getPeerConnectionID()
137 | {
138 | return peerConnectionID;
139 | }
140 |
141 | ////////////////////////////////////////////////
142 | // Direction
143 | ////////////////////////////////////////////////
144 |
145 | private String direction;
146 |
147 | public void setDirection(String value)
148 | {
149 | direction = value;
150 | }
151 |
152 | public String getDirection()
153 | {
154 | return direction;
155 | }
156 |
157 | ////////////////////////////////////////////////
158 | // Status
159 | ////////////////////////////////////////////////
160 |
161 | private String status;
162 |
163 | public void setStatus(String value)
164 | {
165 | status = value;
166 | }
167 |
168 | public String getStatus()
169 | {
170 | return status;
171 | }
172 | }
173 |
174 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/ConnectionInfoList.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File: ConnectionInfoList.java
8 | *
9 | * Revision;
10 | *
11 | * 06/19/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server;
17 |
18 | import java.util.*;
19 |
20 | public class ConnectionInfoList extends Vector
21 | {
22 | ////////////////////////////////////////////////
23 | // Constrictor
24 | ////////////////////////////////////////////////
25 |
26 | public ConnectionInfoList()
27 | {
28 | }
29 |
30 | ////////////////////////////////////////////////
31 | // getConnectionInfo
32 | ////////////////////////////////////////////////
33 |
34 | public ConnectionInfo getConnectionInfo(int n)
35 | {
36 | return (ConnectionInfo)get(n);
37 | }
38 |
39 |
40 | }
41 |
42 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/DC.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003
6 | *
7 | * File : UPnP
8 | *
9 | * Revision:
10 | *
11 | * 11/13/03
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server;
17 |
18 | public class DC
19 | {
20 | ////////////////////////////////////////////////
21 | // Constants
22 | ////////////////////////////////////////////////
23 |
24 | public final static String TITLE = "dc:title";
25 | public final static String DATE = "dc:date";
26 | public final static String CREATOR = "dc:creator";
27 | }
28 |
29 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/Directory.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003
6 | *
7 | * File : Directory
8 | *
9 | * Revision:
10 | *
11 | * 11/11/03
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server;
17 |
18 | import org.cybergarage.upnp.std.av.server.object.container.*;
19 |
20 | public abstract class Directory extends ContainerNode
21 | {
22 | ////////////////////////////////////////////////
23 | // Constructor
24 | ////////////////////////////////////////////////
25 |
26 | public Directory(ContentDirectory cdir, String name)
27 | {
28 | setContentDirectory(cdir);
29 | setFriendlyName(name);
30 | }
31 |
32 | public Directory(String name)
33 | {
34 | this(null, name);
35 | }
36 |
37 | ////////////////////////////////////////////////
38 | // Name
39 | ////////////////////////////////////////////////
40 |
41 | public void setFriendlyName(String name)
42 | {
43 | setTitle(name);
44 | }
45 |
46 | public String getFriendlyName()
47 | {
48 | return getTitle();
49 | }
50 |
51 |
52 | ////////////////////////////////////////////////
53 | // update
54 | ////////////////////////////////////////////////
55 |
56 | public abstract boolean update();
57 |
58 | public void updateContentList()
59 | {
60 | if (update() == true) {
61 | int nContents = getNContentNodes();
62 | setChildCount(nContents);
63 | getContentDirectory().updateSystemUpdateID();
64 | }
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/DirectoryList.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003
6 | *
7 | * File: DirectoryList.java
8 | *
9 | * Revision;
10 | *
11 | * 11/11/03
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server;
17 |
18 | import java.util.*;
19 |
20 | public class DirectoryList extends Vector
21 | {
22 | ////////////////////////////////////////////////
23 | // Constrictor
24 | ////////////////////////////////////////////////
25 |
26 | public DirectoryList()
27 | {
28 | }
29 |
30 | ////////////////////////////////////////////////
31 | // getDirectory
32 | ////////////////////////////////////////////////
33 |
34 | public Directory getDirectory(int n)
35 | {
36 | return (Directory)get(n);
37 | }
38 |
39 | public Directory getDirectory(String name)
40 | {
41 | int dirCnt = size();
42 | for (int n=0; n
15 | * - Removed a SOAP header from output().
16 | * 10/28/04
17 | * - Brent Hills
18 | * - Removed a SOAP header from output().
19 | * 04/18/05
20 | * - Matt
21 | * - Changed toString() using UTF-8 OutputStreamWriter.
22 | *
23 | ******************************************************************/
24 |
25 | package org.cybergarage.upnp.std.av.server.object;
26 |
27 | import java.io.*;
28 | import org.cybergarage.soap.*;
29 | import org.cybergarage.util.*;
30 |
31 | public class DIDLLite
32 | {
33 | ////////////////////////////////////////////////
34 | // Constants
35 | ////////////////////////////////////////////////
36 |
37 | public final static String NAME = "DIDL-Lite";
38 | public final static String XMLNS = "xmlns";
39 | public final static String XMLNS_URL = "urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/";
40 | public final static String XMLNS_DC = "xmlns:dc";
41 | public final static String XMLNS_DC_URL = "http://purl.org/dc/elements/1.1/";
42 | public final static String XMLNS_UPNP = "xmlns:upnp";
43 | public final static String XMLNS_UPNP_URL = "urn:schemas-upnp-org:metadata-1-0/upnp/";
44 |
45 | public final static String CONTAINER = "container";
46 | public final static String ID = "id";
47 | public final static String SEARCHABLE = "searchable";
48 | public final static String PARENTID = "parentID";
49 | public final static String RESTICTED = "restricted";
50 |
51 | public final static String OBJECT_CONTAINER = "object.container";
52 |
53 | public final static String RES = "res";
54 | public final static String RES_PROTOCOLINFO = "protocolInfo";
55 |
56 | ////////////////////////////////////////////////
57 | // Constrictor
58 | ////////////////////////////////////////////////
59 |
60 | public DIDLLite()
61 | {
62 | }
63 |
64 | ////////////////////////////////////////////////
65 | // ContentNode
66 | ////////////////////////////////////////////////
67 |
68 | private ContentNodeList nodeList = new ContentNodeList();
69 |
70 | public void setContentNode(ContentNode node)
71 | {
72 | nodeList.clear();
73 | nodeList.add(node);
74 | }
75 |
76 | public void addContentNode(ContentNode node)
77 | {
78 | nodeList.add(node);
79 | }
80 |
81 | public int getNContentNodes()
82 | {
83 | return nodeList.size();
84 | }
85 |
86 | public ContentNode getContentNode(int n)
87 | {
88 | return nodeList.getContentNode(n);
89 | }
90 |
91 | ////////////////////////////////////////////////
92 | // toString
93 | ////////////////////////////////////////////////
94 |
95 | public void output(PrintWriter ps)
96 | {
97 | // Thanks for Brent Hills (10/26/04)
98 | ps.print(SOAP.VERSION_HEADER);
99 |
100 | DIDLLiteNode didlNode = new DIDLLiteNode();
101 |
102 | String name = didlNode.getName();
103 | //String value = didlNode.getValue();
104 |
105 | ps.print("<" + name);
106 | didlNode.outputAttributes(ps);
107 | ps.println(">");
108 |
109 | int nNodes = getNContentNodes();
110 | for (int n=0; n");
116 | }
117 |
118 | public String toString()
119 | {
120 | try {
121 | ByteArrayOutputStream byteOut = new ByteArrayOutputStream();
122 | Writer writer = new OutputStreamWriter(byteOut, "UTF-8");
123 | PrintWriter pr = new PrintWriter(writer);
124 | output(pr);
125 | pr.flush();
126 | return byteOut.toString();
127 | }
128 | catch (UnsupportedEncodingException e) {
129 | Debug.warning(e);
130 | }
131 | return "";
132 | }
133 |
134 | }
135 |
136 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/DIDLLiteNode.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003
6 | *
7 | * File : ContentNode
8 | *
9 | * Revision:
10 | *
11 | * 10/30/03
12 | * - first revision.
13 | * 10/26/04
14 | * - Brent Hills
15 | * - Changed DIDLLiteNode is a subclass of Node instead of ContentNode
16 | * because the node has the parentID attributes.
17 | *
18 | ******************************************************************/
19 |
20 | package org.cybergarage.upnp.std.av.server.object;
21 |
22 | import org.cybergarage.xml.Node;
23 |
24 | public class DIDLLiteNode extends Node // Thanks for Brent Hills (10/28/04)
25 | {
26 | ////////////////////////////////////////////////
27 | // Constroctor
28 | ////////////////////////////////////////////////
29 |
30 | public DIDLLiteNode()
31 | {
32 | setName(DIDLLite.NAME);
33 | setAttribute(DIDLLite.XMLNS, DIDLLite.XMLNS_URL);
34 | setAttribute(DIDLLite.XMLNS_DC, DIDLLite.XMLNS_DC_URL);
35 | setAttribute(DIDLLite.XMLNS_UPNP, DIDLLite.XMLNS_UPNP_URL);
36 | }
37 |
38 | ////////////////////////////////////////////////
39 | // Child node
40 | ////////////////////////////////////////////////
41 |
42 | public void addContentNode(ContentNode node)
43 | {
44 | addNode(node);
45 | }
46 |
47 | public boolean removeContentNode(ContentNode node)
48 | {
49 | return removeNode(node);
50 | }
51 | }
52 |
53 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/Format.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File: Format.java
8 | *
9 | * Revision;
10 | *
11 | * 01/12/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server.object;
17 |
18 | import java.io.*;
19 |
20 | public interface Format
21 | {
22 | public abstract FormatObject createObject(File file);
23 | public abstract boolean equals(File file);
24 | public abstract String getMimeType();
25 | public abstract String getMediaClass();
26 | }
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/FormatList.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File: FormatList
8 | *
9 | * Revision;
10 | *
11 | * 01/12/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server.object;
17 |
18 | import java.io.*;
19 | import java.util.*;
20 |
21 | public class FormatList extends Vector
22 | {
23 | public FormatList()
24 | {
25 | }
26 |
27 | public Format getFormat(int n)
28 | {
29 | return (Format)get(n);
30 | }
31 |
32 | public Format getFormat(String type)
33 | {
34 | if (type == null)
35 | return null;
36 |
37 | int nLists = size();
38 | for (int n=0; n Property;
68 | int nNode = node.getNNodes();
69 | for (int n=0; n Attribute;
79 | int nAttr = node.getNAttributes();
80 | for (int n=0; n>>>>>> .r88
85 | try {
86 | // Resolution (Width x Height)
87 | int imgWidth = imgReader.getWidth(0);
88 | int imgHeight = imgReader.getHeight(0);
89 | String resStr = Integer.toString(imgWidth) + "x" + Integer.toString(imgHeight);
90 | Attribute resAttr = new Attribute(ItemNode.RESOLUTION, resStr);
91 | attrList.add(resAttr);
92 |
93 | // Size
94 | long fsize = imgFile.length();
95 | Attribute sizeStr = new Attribute(ItemNode.SIZE, Long.toString(fsize));
96 | attrList.add(sizeStr);
97 | }
98 | catch (Exception e) {
99 | Debug.warning(e);
100 | }
101 | <<<<<<< .mine
102 | */
103 |
104 | return attrList;
105 | }
106 |
107 | public String getTitle()
108 | {
109 | String fname = imgFile.getName();
110 | int idx = fname.lastIndexOf(".");
111 | if (idx < 0)
112 | return "";
113 | String title = fname.substring(0, idx);
114 | return title;
115 | }
116 |
117 | public String getCreator()
118 | {
119 | return "";
120 | }
121 |
122 | ////////////////////////////////////////////////
123 | // print
124 | ////////////////////////////////////////////////
125 |
126 | public void print()
127 | {
128 | }
129 |
130 | ////////////////////////////////////////////////
131 | // main
132 | ////////////////////////////////////////////////
133 | /*
134 | public static void main(String args[])
135 | {
136 | Debug.on();
137 |
138 | try {
139 | ID3 id3 = new ID3(new File("C:/eclipse/workspace/upnp-media-server/images/SampleBGM01.mp3"));
140 | id3.print();
141 | }
142 | catch (Exception e) {
143 | Debug.warning(e);
144 | }
145 | }
146 | */
147 | }
148 |
149 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/format/JPEGFormat.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File : JPEGPlugIn.java
8 | *
9 | * Revision:
10 | *
11 | * 01/25/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server.object.format;
17 |
18 | import java.io.*;
19 |
20 | import org.cybergarage.upnp.std.av.server.object.*;
21 |
22 | public class JPEGFormat extends ImageIOFormat
23 | {
24 | ////////////////////////////////////////////////
25 | // Constroctor
26 | ////////////////////////////////////////////////
27 |
28 | public JPEGFormat()
29 | {
30 | }
31 |
32 | public JPEGFormat(File file)
33 | {
34 | super(file);
35 | }
36 |
37 | ////////////////////////////////////////////////
38 | // Abstract Methods
39 | ////////////////////////////////////////////////
40 |
41 | public boolean equals(File file)
42 | {
43 | byte headerID[] = Header.getID(file, 2);
44 | int header1 = (int)headerID[0] & 0xff;
45 | int header2 = (int)headerID[1] & 0xff;
46 | if (header1 == 0xff && header2 == 0xd8)
47 | return true;
48 | return false;
49 | }
50 |
51 | public FormatObject createObject(File file)
52 | {
53 | return new JPEGFormat(file);
54 | }
55 |
56 | public String getMimeType()
57 | {
58 | return "image/jpeg";
59 | }
60 |
61 | }
62 |
63 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/format/MPEGFormat.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File : MPEGPlugIn.java
8 | *
9 | * Revision:
10 | *
11 | * 02/02/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server.object.format;
17 |
18 | import java.io.*;
19 |
20 | import org.cybergarage.xml.*;
21 | import org.cybergarage.util.*;
22 | import org.cybergarage.upnp.std.av.server.object.*;
23 | import org.cybergarage.upnp.std.av.server.object.item.*;
24 |
25 | public class MPEGFormat implements Format, FormatObject
26 | {
27 | ////////////////////////////////////////////////
28 | // Member
29 | ////////////////////////////////////////////////
30 |
31 | private File mpegFile;
32 |
33 | ////////////////////////////////////////////////
34 | // Constroctor
35 | ////////////////////////////////////////////////
36 |
37 | public MPEGFormat()
38 | {
39 | }
40 |
41 | public MPEGFormat(File file)
42 | {
43 | mpegFile = file;
44 | }
45 |
46 | ////////////////////////////////////////////////
47 | // Abstract Methods
48 | ////////////////////////////////////////////////
49 |
50 | public boolean equals(File file)
51 | {
52 | String ext = Header.getSuffix(file);
53 | if (ext == null)
54 | return false;
55 | if (ext.startsWith("mpeg") || ext.startsWith("mpg"))
56 | return true;
57 | return false;
58 | }
59 |
60 | public FormatObject createObject(File file)
61 | {
62 | return new MPEGFormat(file);
63 | }
64 |
65 | public String getMimeType()
66 | {
67 | return "video/mpeg";
68 | }
69 |
70 | public String getMediaClass()
71 | {
72 | return "object.item.videoItem.movie";
73 | }
74 |
75 | public AttributeList getAttributeList()
76 | {
77 | AttributeList attrList = new AttributeList();
78 |
79 | try {
80 | // Size
81 | long fsize = mpegFile.length();
82 | Attribute sizeStr = new Attribute(ItemNode.SIZE, Long.toString(fsize));
83 | attrList.add(sizeStr);
84 | }
85 | catch (Exception e) {
86 | Debug.warning(e);
87 | }
88 |
89 | return attrList;
90 | }
91 |
92 | public String getTitle()
93 | {
94 | String fname = mpegFile.getName();
95 | int idx = fname.lastIndexOf(".");
96 | if (idx < 0)
97 | return "";
98 | String title = fname.substring(0, idx);
99 | return title;
100 | }
101 |
102 | public String getCreator()
103 | {
104 | return "";
105 | }
106 | }
107 |
108 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/format/PNGFormat.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003-2004
6 | *
7 | * File : PNGPlugIn.java
8 | *
9 | * Revision:
10 | *
11 | * 01/25/04
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server.object.format;
17 |
18 | import java.io.*;
19 |
20 | import org.cybergarage.upnp.std.av.server.object.*;
21 |
22 | public class PNGFormat extends ImageIOFormat
23 | {
24 | ////////////////////////////////////////////////
25 | // Constroctor
26 | ////////////////////////////////////////////////
27 |
28 | public PNGFormat()
29 | {
30 | }
31 |
32 | public PNGFormat(File file)
33 | {
34 | super(file);
35 | }
36 |
37 | ////////////////////////////////////////////////
38 | // Abstract Methods
39 | ////////////////////////////////////////////////
40 |
41 | public boolean equals(File file)
42 | {
43 | String headerID = Header.getIDString(file, 1, 3);
44 | if (headerID.startsWith("PNG") == true)
45 | return true;
46 | return false;
47 | }
48 |
49 | public FormatObject createObject(File file)
50 | {
51 | return new PNGFormat(file);
52 | }
53 |
54 | public String getMimeType()
55 | {
56 | return "image/png";
57 | }
58 |
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/item/ItemNodeList.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003
6 | **
7 | * File: ItemNodeList.java
8 | *
9 | * Revision;
10 | *
11 | * 11/11/03
12 | * - first revision.
13 | *
14 | ******************************************************************/
15 |
16 | package org.cybergarage.upnp.std.av.server.object.item;
17 |
18 | import java.util.*;
19 |
20 | public class ItemNodeList extends Vector
21 | {
22 | public ItemNodeList()
23 | {
24 | }
25 |
26 | public ItemNode getItemNode(int n)
27 | {
28 | return (ItemNode)get(n);
29 | }
30 | }
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/library/src/main/java/org/cybergarage/upnp/std/av/server/object/item/ResourceNode.java:
--------------------------------------------------------------------------------
1 | /******************************************************************
2 | *
3 | * MediaServer for CyberLink
4 | *
5 | * Copyright (C) Satoshi Konno 2003
6 | *
7 | * File : ItemNode.java
8 | *
9 | * Revision:
10 | *
11 | * 10/22/03
12 | * - first revision.
13 | * 01/28/04
14 | * - Added file and timestamp parameters.
15 | *
16 | ******************************************************************/
17 |
18 | package org.cybergarage.upnp.std.av.server.object.item;
19 |
20 | import org.cybergarage.xml.*;
21 | import org.cybergarage.upnp.std.av.server.object.*;
22 |
23 | public class ResourceNode extends ContentNode
24 | {
25 | ////////////////////////////////////////////////
26 | // Constants
27 | ////////////////////////////////////////////////
28 |
29 | public final static String
30 | NAME = "res";
31 |
32 | public final static String PROTOCOL_INFO = "protocolInfo";
33 |
34 | public final static String SIZE = "size";
35 | public final static String IMPORT_URI = "importUri";
36 | public final static String COLOR_DEPTH = "colorDepth";
37 | public final static String RESOLUTION = "resolution";
38 |
39 | ////////////////////////////////////////////////
40 | // Constroctor
41 | ////////////////////////////////////////////////
42 |
43 | public ResourceNode()
44 | {
45 | }
46 |
47 | ////////////////////////////////////////////////
48 | // isResourceNode
49 | ////////////////////////////////////////////// //
50 |
51 | public final static boolean isResourceNode(Node node)
52 | {
53 | String name = node.getName();
54 | if (name == null)
55 | return false;
56 | return name.equals(NAME);
57 | }
58 |
59 | ////////////////////////////////////////////////
60 | // set
61 | ////////////////////////////////////////////////
62 |
63 | public void set(Node node)
64 | {
65 | setValue(node.getValue());
66 |
67 | // Attribute -> Attribute;
68 | int nAttr = node.getNAttributes();
69 | for (int n=0; n
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Library
3 |
4 | Hello world!
5 | Settings
6 |
7 |
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | #Thu Aug 06 17:35:31 CST 2015
11 | sdk.dir=C\:\\develop\\adt-bundle-windows\\sdk
12 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':dmc_sample', ':library'
2 |
--------------------------------------------------------------------------------