-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from lgcast-dev/master
Initial LG Cast Integration
- Loading branch information
Showing
17 changed files
with
408 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* ScreenMirroringApi | ||
* Connect SDK | ||
* | ||
* Copyright (c) 2020 LG Electronics. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.connectsdk.service.capability; | ||
|
||
import android.content.Context; | ||
import android.content.Intent; | ||
import com.connectsdk.service.capability.listeners.ResponseListener; | ||
import com.connectsdk.service.lgcast.screenmirroring.SecondScreen; | ||
|
||
public interface LGCastControl extends CapabilityMethods { | ||
String Any = "LGCast.Any"; | ||
String ScreenMirroring = "LGCast.ScreenMirroring"; | ||
String RemoteCamera = "LGCast.RemoteCamera"; | ||
|
||
String[] Capabilities = { | ||
ScreenMirroring, | ||
RemoteCamera, | ||
}; | ||
|
||
int SCREEN_MIRRORING_ERROR_GENERIC = 0; | ||
int SCREEN_MIRRORING_ERROR_CONNECTION_CLOSED = 1; | ||
int SCREEN_MIRRORING_ERROR_DEVICE_SHUTDOWN = 2; | ||
int SCREEN_MIRRORING_ERROR_RENDERER_TERMINATED = 3; | ||
int SCREEN_MIRRORING_ERROR_STOPPED_BY_NOTIFICATION = 4; | ||
|
||
void startScreenMirroring(Context context, Intent projectionData, ScreenMirroringStartListener listener); | ||
void startScreenMirroring(Context context, Intent projectionData, Class secondScreenClass, ScreenMirroringStartListener listener); | ||
void stopScreenMirroring(Context context, ScreenMirroringStopListener listener); | ||
|
||
void startRemoteCamera(); | ||
void stopRemoteCamera(); | ||
|
||
interface ScreenMirroringStartListener extends ResponseListener<SecondScreen> { | ||
void onPairing(); | ||
} | ||
|
||
interface ScreenMirroringStopListener extends ResponseListener<String> { | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/com/connectsdk/service/lgcast/remotecamera/RemoteCameraApi.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* RemoteCameraApi | ||
* Connect SDK | ||
* | ||
* Copyright (c) 2020 LG Electronics. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.connectsdk.service.lgcast.remotecamera; | ||
|
||
import android.app.ActivityManager; | ||
import android.content.Context; | ||
import android.view.Surface; | ||
import com.lge.lgcast.remotecamera.service.RemoteCameraService; | ||
import com.lge.lgcast.remotecamera.service.RemoteCameraServiceIF; | ||
import com.lge.lgcast.common.utils.AppUtil; | ||
|
||
public class RemoteCameraApi { | ||
private Context mContext; | ||
|
||
public RemoteCameraApi(Context context) { | ||
mContext = context; | ||
} | ||
|
||
public void startRemoteCamera(Surface previewSurface) { | ||
RemoteCameraServiceIF.requestStart(mContext, previewSurface); | ||
} | ||
|
||
public void stopRemoteCamera() { | ||
RemoteCameraServiceIF.requestStop(mContext); | ||
} | ||
|
||
public boolean isRunning() { | ||
ActivityManager.RunningServiceInfo serviceInfo = AppUtil.getServiceInfo(mContext, RemoteCameraService.class.getName()); | ||
return (serviceInfo != null) ? serviceInfo.foreground : false; | ||
} | ||
} |
Oops, something went wrong.