Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 : * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #ifndef AUDIOSTREAMTRACK_H_
7 : #define AUDIOSTREAMTRACK_H_
8 :
9 : #include "MediaStreamTrack.h"
10 : #include "DOMMediaStream.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 0 : class AudioStreamTrack : public MediaStreamTrack {
16 : public:
17 0 : AudioStreamTrack(DOMMediaStream* aStream, TrackID aTrackID,
18 : TrackID aInputTrackID,
19 : MediaStreamTrackSource* aSource,
20 : const MediaTrackConstraints& aConstraints = MediaTrackConstraints())
21 0 : : MediaStreamTrack(aStream, aTrackID, aInputTrackID, aSource, aConstraints) {}
22 :
23 : JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
24 :
25 0 : AudioStreamTrack* AsAudioStreamTrack() override { return this; }
26 :
27 0 : const AudioStreamTrack* AsAudioStreamTrack() const override { return this; }
28 :
29 : // WebIDL
30 0 : void GetKind(nsAString& aKind) override { aKind.AssignLiteral("audio"); }
31 :
32 : protected:
33 0 : already_AddRefed<MediaStreamTrack> CloneInternal(DOMMediaStream* aOwningStream,
34 : TrackID aTrackID) override
35 : {
36 0 : return do_AddRef(new AudioStreamTrack(aOwningStream,
37 : aTrackID,
38 : mInputTrackID,
39 : mSource,
40 0 : mConstraints));
41 : }
42 : };
43 :
44 : } // namespace dom
45 : } // namespace mozilla
46 :
47 : #endif /* AUDIOSTREAMTRACK_H_ */
|