2013-03-27 01:32:51 +00:00
|
|
|
/* -*- Mode: C++; 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/. */
|
|
|
|
|
|
|
|
#ifndef VIDEOSTREAMTRACK_H_
|
|
|
|
#define VIDEOSTREAMTRACK_H_
|
|
|
|
|
|
|
|
#include "MediaStreamTrack.h"
|
2013-09-05 20:25:17 +00:00
|
|
|
#include "DOMMediaStream.h"
|
2013-03-27 01:32:51 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class VideoStreamTrack : public MediaStreamTrack {
|
|
|
|
public:
|
2016-04-06 12:46:56 +00:00
|
|
|
VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID,
|
2016-01-22 08:27:37 +00:00
|
|
|
TrackID aInputTrackID,
|
2016-04-06 12:46:56 +00:00
|
|
|
MediaStreamTrackSource* aSource)
|
2016-01-22 08:27:37 +00:00
|
|
|
: MediaStreamTrack(aStream, aTrackID, aInputTrackID, aSource) {}
|
2013-03-27 01:32:51 +00:00
|
|
|
|
2016-01-18 03:50:29 +00:00
|
|
|
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-03-27 01:32:51 +00:00
|
|
|
|
2016-01-18 03:50:29 +00:00
|
|
|
VideoStreamTrack* AsVideoStreamTrack() override { return this; }
|
2013-03-27 01:32:51 +00:00
|
|
|
|
2016-02-01 14:43:38 +00:00
|
|
|
const VideoStreamTrack* AsVideoStreamTrack() const override { return this; }
|
|
|
|
|
2013-03-27 01:32:51 +00:00
|
|
|
// WebIDL
|
2016-01-18 03:50:29 +00:00
|
|
|
void GetKind(nsAString& aKind) override { aKind.AssignLiteral("video"); }
|
2016-01-22 08:27:51 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
already_AddRefed<MediaStreamTrack> CloneInternal(DOMMediaStream* aOwningStream,
|
|
|
|
TrackID aTrackID) override
|
|
|
|
{
|
|
|
|
return do_AddRef(new VideoStreamTrack(aOwningStream,
|
|
|
|
aTrackID,
|
|
|
|
mInputTrackID,
|
|
|
|
mSource));
|
|
|
|
}
|
2013-03-27 01:32:51 +00:00
|
|
|
};
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2013-03-27 01:32:51 +00:00
|
|
|
|
|
|
|
#endif /* VIDEOSTREAMTRACK_H_ */
|