gecko-dev/dom/media/VideoStreamTrack.h
Andreas Pehrson ee5913bb8b Bug 1208371 - Move MediaStreamTrack's label to MediaStreamTrackSource. r=jib
MozReview-Commit-ID: Aj7Cht4zxc6

--HG--
extra : rebase_source : c454a9f2b81a6a1eb574c1abee0fab64abbe5b72
2016-01-22 16:27:37 +08:00

46 lines
1.5 KiB
C++

/* -*- 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"
#include "DOMMediaStream.h"
namespace mozilla {
namespace dom {
class VideoStreamTrack : public MediaStreamTrack {
public:
VideoStreamTrack(DOMMediaStream* aStream, TrackID aTrackID,
TrackID aInputTrackID,
MediaStreamTrackSource* aSource)
: MediaStreamTrack(aStream, aTrackID, aInputTrackID, aSource) {}
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
VideoStreamTrack* AsVideoStreamTrack() override { return this; }
const VideoStreamTrack* AsVideoStreamTrack() const override { return this; }
// WebIDL
void GetKind(nsAString& aKind) override { aKind.AssignLiteral("video"); }
protected:
already_AddRefed<MediaStreamTrack> CloneInternal(DOMMediaStream* aOwningStream,
TrackID aTrackID) override
{
return do_AddRef(new VideoStreamTrack(aOwningStream,
aTrackID,
mInputTrackID,
mSource));
}
};
} // namespace dom
} // namespace mozilla
#endif /* VIDEOSTREAMTRACK_H_ */