зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1213517 - add webidl for track.getConstraints() and track.getSettings(). r=smaug
MozReview-Commit-ID: D15Lo3e1giL --HG-- extra : rebase_source : 9a9ce6900dae6dc1e9a80e0c67577da4aab44437
This commit is contained in:
Родитель
7ca9fd2a44
Коммит
551d3d6567
|
@ -250,6 +250,16 @@ MediaStreamTrack::Stop()
|
|||
mReadyState = MediaStreamTrackState::Ended;
|
||||
}
|
||||
|
||||
void MediaStreamTrack::GetConstraints(dom::MediaTrackConstraints& aResult)
|
||||
{
|
||||
aResult = mConstraints;
|
||||
}
|
||||
|
||||
void MediaStreamTrack::GetSettings(dom::MediaTrackSettings& aResult)
|
||||
{
|
||||
aResult = mSettings;
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
MediaStreamTrack::ApplyConstraints(const MediaTrackConstraints& aConstraints,
|
||||
ErrorResult &aRv)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
#include "MediaTrackConstraints.h"
|
||||
#include "mozilla/CORSMode.h"
|
||||
#include "PrincipalChangeObserver.h"
|
||||
#include "mozilla/dom/MediaStreamTrackBinding.h"
|
||||
#include "mozilla/dom/MediaTrackSettingsBinding.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -263,6 +265,9 @@ public:
|
|||
bool Enabled() { return mEnabled; }
|
||||
void SetEnabled(bool aEnabled);
|
||||
void Stop();
|
||||
void GetConstraints(dom::MediaTrackConstraints& aResult);
|
||||
void GetSettings(dom::MediaTrackSettings& aResult);
|
||||
|
||||
already_AddRefed<Promise>
|
||||
ApplyConstraints(const dom::MediaTrackConstraints& aConstraints, ErrorResult &aRv);
|
||||
already_AddRefed<MediaStreamTrack> Clone();
|
||||
|
@ -426,6 +431,8 @@ protected:
|
|||
MediaStreamTrackState mReadyState;
|
||||
bool mEnabled;
|
||||
const bool mRemote;
|
||||
dom::MediaTrackConstraints mConstraints;
|
||||
dom::MediaTrackSettings mSettings;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -84,8 +84,8 @@ interface MediaStreamTrack : EventTarget {
|
|||
MediaStreamTrack clone ();
|
||||
void stop ();
|
||||
// MediaTrackCapabilities getCapabilities ();
|
||||
// MediaTrackConstraints getConstraints ();
|
||||
// MediaTrackSettings getSettings ();
|
||||
MediaTrackConstraints getConstraints ();
|
||||
MediaTrackSettings getSettings ();
|
||||
|
||||
[Throws]
|
||||
Promise<void> applyConstraints (optional MediaTrackConstraints constraints);
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://w3c.github.io/mediacapture-main/getusermedia.html
|
||||
*/
|
||||
|
||||
dictionary MediaTrackSettings {
|
||||
long width;
|
||||
long height;
|
||||
double frameRate;
|
||||
DOMString facingMode;
|
||||
DOMString deviceId;
|
||||
|
||||
// Mozilla-specific extensions:
|
||||
|
||||
// http://fluffy.github.io/w3c-screen-share/#screen-based-video-constraints
|
||||
// OBE by http://w3c.github.io/mediacapture-screen-share
|
||||
|
||||
DOMString mediaSource;
|
||||
|
||||
// Experimental https://bugzilla.mozilla.org/show_bug.cgi?id=1131568#c3
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1193075
|
||||
|
||||
long long browserWindow;
|
||||
boolean scrollWithPage;
|
||||
long viewportOffsetX;
|
||||
long viewportOffsetY;
|
||||
long viewportWidth;
|
||||
long viewportHeight;
|
||||
};
|
|
@ -306,6 +306,7 @@ WEBIDL_FILES = [
|
|||
'MediaStreamError.webidl',
|
||||
'MediaStreamTrack.webidl',
|
||||
'MediaTrackConstraintSet.webidl',
|
||||
'MediaTrackSettings.webidl',
|
||||
'MediaTrackSupportedConstraints.webidl',
|
||||
'MenuBoxObject.webidl',
|
||||
'MessageChannel.webidl',
|
||||
|
|
Загрузка…
Ссылка в новой задаче