| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 WebString deviceId; | 53 WebString deviceId; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class TrackData { | 56 class TrackData { |
| 57 public: | 57 public: |
| 58 TrackData() {} | 58 TrackData() {} |
| 59 virtual ~TrackData() {} | 59 virtual ~TrackData() {} |
| 60 virtual void getSettings(Settings&) = 0; | 60 virtual void getSettings(Settings&) = 0; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 enum class ContentHintType { |
| 64 None, |
| 65 AudioSpeech, |
| 66 AudioMusic, |
| 67 VideoFluid, |
| 68 VideoDetailed |
| 69 }; |
| 70 |
| 63 WebMediaStreamTrack() {} | 71 WebMediaStreamTrack() {} |
| 64 WebMediaStreamTrack(const WebMediaStreamTrack& other) { assign(other); } | 72 WebMediaStreamTrack(const WebMediaStreamTrack& other) { assign(other); } |
| 65 ~WebMediaStreamTrack() { reset(); } | 73 ~WebMediaStreamTrack() { reset(); } |
| 66 | 74 |
| 67 WebMediaStreamTrack& operator=(const WebMediaStreamTrack& other) { | 75 WebMediaStreamTrack& operator=(const WebMediaStreamTrack& other) { |
| 68 assign(other); | 76 assign(other); |
| 69 return *this; | 77 return *this; |
| 70 } | 78 } |
| 71 BLINK_PLATFORM_EXPORT void assign(const WebMediaStreamTrack&); | 79 BLINK_PLATFORM_EXPORT void assign(const WebMediaStreamTrack&); |
| 72 | 80 |
| 73 BLINK_PLATFORM_EXPORT void initialize(const WebMediaStreamSource&); | 81 BLINK_PLATFORM_EXPORT void initialize(const WebMediaStreamSource&); |
| 74 BLINK_PLATFORM_EXPORT void initialize(const WebString& id, | 82 BLINK_PLATFORM_EXPORT void initialize(const WebString& id, |
| 75 const WebMediaStreamSource&); | 83 const WebMediaStreamSource&); |
| 76 | 84 |
| 77 BLINK_PLATFORM_EXPORT void reset(); | 85 BLINK_PLATFORM_EXPORT void reset(); |
| 78 bool isNull() const { return m_private.isNull(); } | 86 bool isNull() const { return m_private.isNull(); } |
| 79 | 87 |
| 80 BLINK_PLATFORM_EXPORT WebString id() const; | 88 BLINK_PLATFORM_EXPORT WebString id() const; |
| 81 | 89 |
| 82 BLINK_PLATFORM_EXPORT WebMediaStreamSource source() const; | 90 BLINK_PLATFORM_EXPORT WebMediaStreamSource source() const; |
| 83 BLINK_PLATFORM_EXPORT bool isEnabled() const; | 91 BLINK_PLATFORM_EXPORT bool isEnabled() const; |
| 84 BLINK_PLATFORM_EXPORT bool isMuted() const; | 92 BLINK_PLATFORM_EXPORT bool isMuted() const; |
| 93 BLINK_PLATFORM_EXPORT ContentHintType contentHint() const; |
| 85 | 94 |
| 86 // Extra data associated with this WebMediaStream. | 95 // Extra data associated with this WebMediaStream. |
| 87 // If non-null, the extra data pointer will be deleted when the object is | 96 // If non-null, the extra data pointer will be deleted when the object is |
| 88 // destroyed. Setting the track data pointer will cause any existing non-null | 97 // destroyed. Setting the track data pointer will cause any existing non-null |
| 89 // track data pointer to be deleted. | 98 // track data pointer to be deleted. |
| 90 BLINK_PLATFORM_EXPORT TrackData* getTrackData() const; | 99 BLINK_PLATFORM_EXPORT TrackData* getTrackData() const; |
| 91 BLINK_PLATFORM_EXPORT void setTrackData(TrackData*); | 100 BLINK_PLATFORM_EXPORT void setTrackData(TrackData*); |
| 92 | 101 |
| 93 // The lifetime of the WebAudioSourceProvider should outlive the | 102 // The lifetime of the WebAudioSourceProvider should outlive the |
| 94 // WebMediaStreamTrack, and clients are responsible for calling | 103 // WebMediaStreamTrack, and clients are responsible for calling |
| 95 // setSourceProvider(0) before the WebMediaStreamTrack is going away. | 104 // setSourceProvider(0) before the WebMediaStreamTrack is going away. |
| 96 BLINK_PLATFORM_EXPORT void setSourceProvider(WebAudioSourceProvider*); | 105 BLINK_PLATFORM_EXPORT void setSourceProvider(WebAudioSourceProvider*); |
| 97 | 106 |
| 98 #if INSIDE_BLINK | 107 #if INSIDE_BLINK |
| 99 BLINK_PLATFORM_EXPORT WebMediaStreamTrack(MediaStreamComponent*); | 108 BLINK_PLATFORM_EXPORT WebMediaStreamTrack(MediaStreamComponent*); |
| 100 BLINK_PLATFORM_EXPORT WebMediaStreamTrack& operator=(MediaStreamComponent*); | 109 BLINK_PLATFORM_EXPORT WebMediaStreamTrack& operator=(MediaStreamComponent*); |
| 101 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<MediaStreamComponent>() const; | 110 BLINK_PLATFORM_EXPORT operator WTF::PassRefPtr<MediaStreamComponent>() const; |
| 102 BLINK_PLATFORM_EXPORT operator MediaStreamComponent*() const; | 111 BLINK_PLATFORM_EXPORT operator MediaStreamComponent*() const; |
| 103 #endif | 112 #endif |
| 104 | 113 |
| 105 private: | 114 private: |
| 106 WebPrivatePtr<MediaStreamComponent> m_private; | 115 WebPrivatePtr<MediaStreamComponent> m_private; |
| 107 }; | 116 }; |
| 108 | 117 |
| 109 } // namespace blink | 118 } // namespace blink |
| 110 | 119 |
| 111 #endif // WebMediaStreamTrack_h | 120 #endif // WebMediaStreamTrack_h |
| OLD | NEW |