Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: ppapi/examples/media_stream_video/media_stream_video.html

Issue 150403006: [PPAPI][MediaStream] Support configure for video input. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build errors Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/examples/media_stream_video/media_stream_video.cc ('k') | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/examples/media_stream_video/media_stream_video.html
diff --git a/ppapi/examples/media_stream_video/media_stream_video.html b/ppapi/examples/media_stream_video/media_stream_video.html
index a20c284cc25572453902e32bd24b4121b05b16b0..ba7a3253435ebcb7cf43641acbf871d8751bf090 100644
--- a/ppapi/examples/media_stream_video/media_stream_video.html
+++ b/ppapi/examples/media_stream_video/media_stream_video.html
@@ -17,7 +17,7 @@
function success(s) {
stream = s;
- plugin.postMessage({track: stream.getVideoTracks()[0]});
+ plugin.postMessage({command: 'init', track: stream.getVideoTracks()[0]});
}
function failure(e) {
@@ -28,19 +28,27 @@
plugin = document.getElementById('plugin');
plugin.addEventListener('message', handleMessage, false);
var constraints = {
- "audio": false,
- "video": {
- "mandatory": {
- "minWidth": "1280",
- "minHeight": "720",
- "minFrameRate": "30"
+ audio: false,
+ video: {
+ mandatory: {
+ minWidth: 640,
+ minHeight: 320,
+ minFrameRate: 30
},
- "optional": []
+ optional: []
}
};
+
navigator.webkitGetUserMedia(constraints, success, failure);
}
+ function changeFormat(format) {
+ plugin.postMessage({command:'format', format: format});
+ }
+
+ function changeSize(width, height) {
+ plugin.postMessage({command:'size', width: width, height: height});
+ }
document.addEventListener('DOMContentLoaded', initialize, false);
</script>
</head>
@@ -49,7 +57,18 @@
<h1>Pepper MediaStream Video API Example</h1><br>
This example demonstrates receiving frames from a video MediaStreamTrack and
rendering them in a plugin.<br>
+ Left side shows YUV frames. Right side shows BGRA frames.
<embed id="plugin" type="application/x-ppapi-example-media-stream-video"
- width="320" height="240"/>
+ width="640" height="240"/>
+ <h2>Format:</h2><br>
+ <button onclick="changeFormat('YV12')" >YV12</button>
+ <button onclick="changeFormat('I420')" >I420</button>
+ <button onclick="changeFormat('BGRA')" >BGRA</button>
+ <button onclick="changeFormat('DEFAULT')" >DEFAULT</button>
+ <h2>Size:</h2><br>
+ <button onclick="changeSize(72, 72)" >72 x 72</button>
+ <button onclick="changeSize(640, 360)" >640 x 360</button>
+ <button onclick="changeSize(1280, 720)" >1280 x 720</button>
+ <button onclick="changeSize(0, 0)" >DEFAULT</button>
</body>
</html>
« no previous file with comments | « ppapi/examples/media_stream_video/media_stream_video.cc ('k') | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698