Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ffmpeg in device view #469

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c2be8c8
Fix focus scrolling to work properly the first time even if all level…
triwav Dec 27, 2022
310d37b
update to RTA v2.0 beta 11
triwav Dec 27, 2022
7b0032d
Update absolute key path to properly be able to dig into ArrayGrids a…
triwav Dec 27, 2022
9140b6a
expand focused node for easier access to its children
triwav Dec 27, 2022
416f3a8
screenshot select progress commit and RTA changes
triwav Jan 7, 2023
efe3d2b
Add pressPowerOn command
triwav Feb 9, 2023
e699440
remove ScreenshotSelectPage
triwav Feb 9, 2023
bab30a1
add rokuDeviceView panel that allows showing screenshots from Roku an…
triwav Feb 21, 2023
c935947
Merge branch 'master' into add_device_view
triwav Feb 21, 2023
7cf3a66
Make screenshot always fit onscreen
triwav Feb 21, 2023
9a7371d
update error to output to properly output message
triwav Feb 23, 2023
4f924bf
switch to using existence of @parcel/watcher package to determine whe…
triwav Feb 27, 2023
10aeac4
Fix error being printed when watcher is not available
triwav Mar 1, 2023
178f471
PR feedback
triwav Mar 1, 2023
092b89a
fix misspelling
triwav Mar 1, 2023
d784733
rename NodeBranchPage to Branch
triwav Mar 1, 2023
64eef27
Update webviews/src/views/RokuDeviceView/RokuDeviceView.svelte
triwav Mar 1, 2023
e3c8073
upgrade to RTA beta 14, Add ViewProviderId, ViewProviderEvent, ViewPr…
triwav Mar 7, 2023
f1f9a40
Merge branch 'add_device_view' of https://github.com/rokucommunity/vs…
triwav Mar 7, 2023
4d0188a
Fix several bugs from refactor
triwav Mar 8, 2023
bd821f8
fix tests getting stuck by calling dispose on provider
triwav Mar 8, 2023
da5f06e
Add rokuDeviceViewCancelInspectingNodes command
triwav Mar 9, 2023
d8c0b87
inspect-active-svg
TwitchBronBron Mar 9, 2023
a6efbaf
Merge branch 'add_device_view' of https://github.com/rokucommunity/vs…
TwitchBronBron Mar 9, 2023
e5fac82
Adds ffmpeg image generation to device view
TwitchBronBron Mar 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ module.exports = {
},
//disable some rules for certain files
overrides: [{
//these files are getting deleted soon, so ingore the eslint warnings for now
//these files are getting deleted soon, so ignore the eslint warnings for now
files: ['src/brsTypes/**/*.ts'],
rules: {
'@typescript-eslint/no-invalid-this': 'off',
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@
"a11y-structure": "ignore",
"a11y-mouse-events-have-key-events": "ignore",
"a11y-missing-content": "ignore",
"a11y-click-events-have-key-events": "ignore"
}
}
}
1 change: 1 addition & 0 deletions images/icons/inspect-active.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
205 changes: 65 additions & 140 deletions package-lock.json

Large diffs are not rendered by default.

78 changes: 76 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"multi-root-ready"
],
"engines": {
"vscode": "^1.53.0",
"vscode": "^1.57.0",
"node": "^12.12.0"
},
"repository": {
Expand Down Expand Up @@ -64,14 +64,16 @@
"glob": "^7.1.3",
"hex-rgb": "^5.0.0",
"iconv-lite": "0.4.24",
"jpeg-js": "^0.4.4",
"just-throttle": "^4.0.1",
"net": "^1.0.2",
"node-cache": "^4.2.0",
"node-ssdp": "^4.0.0",
"pngjs": "^7.0.0",
"pretty-bytes": "^5.6.0",
"roku-debug": "^0.18.3",
"roku-deploy": "^3.9.3",
"roku-test-automation": "^2.0.0-beta.11",
"roku-test-automation": "^2.0.0-beta.14",
"semver": "^7.1.3",
"source-map": "^0.7.3",
"thenby": "^1.3.4",
Expand Down Expand Up @@ -197,6 +199,12 @@
"name": "SceneGraph Inspector",
"type": "webview"
},
{
"id": "rokuDeviceView",
"contextualTitle": "Roku",
"name": "Device View",
"type": "webview"
},
{
"id": "rokuRegistryView",
"name": "Roku Registry",
Expand Down Expand Up @@ -257,6 +265,31 @@
"command": "extension.brightscript.rokuRegistry.clearRegistry",
"when": "view == rokuRegistryView",
"group": "navigation"
},
{
"command": "extension.brightscript.rokuDeviceView.refreshScreenshot",
"when": "view == rokuDeviceView && !brightscript.rokuDeviceView.enableScreenshotCapture",
"group": "navigation@1"
},
{
"command": "extension.brightscript.rokuDeviceView.resumeScreenshotCapture",
"when": "view == rokuDeviceView && !brightscript.rokuDeviceView.enableScreenshotCapture && !brightscript.rokuDeviceView.isInspectingNodes",
"group": "navigation@2"
},
{
"command": "extension.brightscript.rokuDeviceView.pauseScreenshotCapture",
"when": "view == rokuDeviceView && brightscript.rokuDeviceView.enableScreenshotCapture && !brightscript.rokuDeviceView.isInspectingNodes",
"group": "navigation@2"
},
{
"command": "extension.brightscript.rokuDeviceView.enableNodeInspector",
"when": "view == rokuDeviceView && brightscript.isOnDeviceComponentAvailable && !brightscript.rokuDeviceView.isInspectingNodes",
"group": "navigation@3"
},
{
"command": "extension.brightscript.rokuDeviceView.disableNodeInspector",
"when": "view == rokuDeviceView && brightscript.isOnDeviceComponentAvailable && brightscript.rokuDeviceView.isInspectingNodes",
"group": "navigation@3"
}
],
"commandPalette": []
Expand Down Expand Up @@ -2264,6 +2297,11 @@
"title": "Press the PowerOff button on the Roku remote",
"category": "Brightscript"
},
{
"command": "extension.brightscript.pressPowerOn",
"title": "Press the PowerOn button on the Roku remote",
"category": "Brightscript"
},
{
"command": "extension.brightscript.pressChannelUp",
"title": "Press the ChannelUp button on the Roku remote",
Expand Down Expand Up @@ -2382,6 +2420,42 @@
"command": "extension.brightscript.languageServer.info",
"title": "View BrighterScript LanguageServer Info",
"category": "BrighterScript"
},
{
"command": "extension.brightscript.rokuDeviceView.enableNodeInspector",
"title": "Inspect nodes",
"category": "BrighterScript",
"icon": "$(inspect)"
},
{
"command": "extension.brightscript.rokuDeviceView.disableNodeInspector",
"title": "Stop inspecting nodes",
"category": "BrighterScript",
"icon": "./images/icons/inspect-active.svg"
},
{
"command": "extension.brightscript.rokuDeviceView.pauseScreenshotCapture",
"title": "Pause Screenshot Capture",
"category": "BrighterScript",
"icon": "$(debug-pause)"
},
{
"command": "extension.brightscript.rokuDeviceView.resumeScreenshotCapture",
"title": "Resume Screenshot Capture",
"category": "BrighterScript",
"icon": "$(debug-start)"
},
{
"command": "extension.brightscript.rokuDeviceView.refreshScreenshot",
"title": "Refresh Screenshot",
"category": "BrighterScript",
"icon": "$(refresh)"
},
{
"command": "extension.brightscript.sceneGraphInspectorView.refreshNodeTree",
"title": "Refresh Nodetree",
"category": "BrighterScript",
"icon": "$(refresh)"
}
],
"keybindings": [
Expand Down
4 changes: 4 additions & 0 deletions src/BrightScriptCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ export class BrightScriptCommands {
await this.sendRemoteCommand('PowerOff');
});

this.registerCommand('pressPowerOn', async () => {
await this.sendRemoteCommand('PowerOn');
});

this.registerCommand('pressChannelUp', async () => {
await this.sendRemoteCommand('ChannelUp');
});
Expand Down
2 changes: 1 addition & 1 deletion src/LanguageServerManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('extension', () => {
).to.eql(embeddedPath);
});

it('returns value from worksapce when specified', async () => {
it('returns value from workspace when specified', async () => {
vscode.workspace.workspaceFile = URI.file(s`${tempDir}/workspace.code-workspace`);

setConfig(vscode.workspace.workspaceFile.fsPath, {
Expand Down
11 changes: 11 additions & 0 deletions src/commands/VscodeCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export enum VscodeCommand {
rokuDeviceViewRefreshScreenshot = 'extension.brightscript.rokuDeviceView.refreshScreenshot',
rokuDeviceViewResumeScreenshotCapture = 'extension.brightscript.rokuDeviceView.resumeScreenshotCapture',
rokuDeviceViewPauseScreenshotCapture = 'extension.brightscript.rokuDeviceView.pauseScreenshotCapture',
rokuDeviceViewEnableNodeInspector = 'extension.brightscript.rokuDeviceView.enableNodeInspector',
rokuDeviceViewDisableNodeInspector = 'extension.brightscript.rokuDeviceView.disableNodeInspector',
rokuRegistryExportRegistry = 'extension.brightscript.rokuRegistry.exportRegistry',
rokuRegistryImportRegistry = 'extension.brightscript.rokuRegistry.importRegistry',
rokuRegistryClearRegistry = 'extension.brightscript.rokuRegistry.clearRegistry',
rokuRegistryRefreshRegistry = 'extension.brightscript.rokuRegistry.refreshRegistry'
}
61 changes: 0 additions & 61 deletions src/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import * as extension from './extension';
import { vscode, vscodeLanguageClient } from './mockVscode.spec';
import { BrightScriptCommands } from './BrightScriptCommands';
import { languageServerManager } from './LanguageServerManager';
import * as rta from 'roku-test-automation';
import type { BrightScriptLaunchConfiguration } from './DebugConfigurationProvider';

const sinon = createSandbox();

Expand Down Expand Up @@ -49,7 +47,6 @@ describe('extension', () => {
});

afterEach(() => {
extensionInstance.odc = undefined;
extensionInstance['webviews'] = originalWebviews;
sinon.restore();
});
Expand Down Expand Up @@ -101,62 +98,4 @@ describe('extension', () => {
await extension.activate(context);
expect(spy.getCalls().length).to.be.greaterThan(0);
});

describe('RDB', () => {
const config = {} as BrightScriptLaunchConfiguration;
let context;
beforeEach(() => {
context = { ...vscode.context };
config.host = '86.75.30.9';
config.password = 'jenny';
});

describe('setupODC', () => {
it('sets up the underlying RokuDevice instance', () => {
const odc = extensionInstance['setupODC'](config);
expect(odc.device).to.be.instanceOf(rta.RokuDevice);
});

it('has the correct config values passed from the extension', () => {
const odc = extensionInstance['setupODC'](config);
const deviceConfig = odc.device.getCurrentDeviceConfig();
expect(deviceConfig.host).to.equal(config.host);
expect(deviceConfig.password).to.equal(config.password);
});
});

describe('registerWebViewProviders', () => {
it('initializes webview providers and calls registerWebviewViewProvider for each', () => {
extensionInstance['webviews'] = originalWebviews;
const spy = sinon.spy(vscode.window, 'registerWebviewViewProvider');
extensionInstance['registerWebviewProviders'](context);
expect(spy.callCount).to.equal(Object.keys(originalWebviews).length);
});
});

describe('debugSessionCustomEventHandler', () => {
describe('ChannelPublishedEvent', () => {
const e = {
event: 'ChannelPublishedEvent',
body: {
launchConfiguration: config
}
};

it('calls setupODC to create the odc instance if enabled', async () => {
config.injectRdbOnDeviceComponent = true;
const spy = sinon.stub(extensionInstance as any, 'setupODC').returns(undefined);
await extensionInstance['debugSessionCustomEventHandler'](e, {} as any, {} as any, {} as any, {} as any);
expect(spy.calledOnce).to.be.true;
});

it('does not call setupODC if not enabled', async () => {
config.injectRdbOnDeviceComponent = false;
const spy = sinon.stub(extensionInstance as any, 'setupODC').returns(undefined);
await extensionInstance['debugSessionCustomEventHandler'](e, {} as any, {} as any, {} as any, {} as any);
expect(spy.callCount).to.equal(0);
});
});
});
});
});
Loading