OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Ericsson AB. All rights reserved. | 2 * Copyright (C) 2011 Ericsson AB. All rights reserved. |
3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 MediaStreamCenter& MediaStreamCenter::Instance() { | 48 MediaStreamCenter& MediaStreamCenter::Instance() { |
49 DCHECK(IsMainThread()); | 49 DCHECK(IsMainThread()); |
50 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); | 50 DEFINE_STATIC_LOCAL(MediaStreamCenter, center, ()); |
51 return center; | 51 return center; |
52 } | 52 } |
53 | 53 |
54 MediaStreamCenter::MediaStreamCenter() | 54 MediaStreamCenter::MediaStreamCenter() |
55 : private_( | 55 : private_(Platform::Current()->CreateMediaStreamCenter(this)) {} |
56 WTF::WrapUnique(Platform::Current()->CreateMediaStreamCenter(this))) { | |
57 } | |
58 | 56 |
59 MediaStreamCenter::~MediaStreamCenter() {} | 57 MediaStreamCenter::~MediaStreamCenter() {} |
60 | 58 |
61 void MediaStreamCenter::DidSetMediaStreamTrackEnabled( | 59 void MediaStreamCenter::DidSetMediaStreamTrackEnabled( |
62 MediaStreamComponent* component) { | 60 MediaStreamComponent* component) { |
63 if (private_) { | 61 if (private_) { |
64 if (component->Enabled()) { | 62 if (component->Enabled()) { |
65 private_->DidEnableMediaStreamTrack(component); | 63 private_->DidEnableMediaStreamTrack(component); |
66 } else { | 64 } else { |
67 private_->DidDisableMediaStreamTrack(component); | 65 private_->DidDisableMediaStreamTrack(component); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 } | 139 } |
142 | 140 |
143 void MediaStreamCenter::StopLocalMediaStream(const WebMediaStream& web_stream) { | 141 void MediaStreamCenter::StopLocalMediaStream(const WebMediaStream& web_stream) { |
144 MediaStreamDescriptor* stream = web_stream; | 142 MediaStreamDescriptor* stream = web_stream; |
145 MediaStreamDescriptorClient* client = stream->Client(); | 143 MediaStreamDescriptorClient* client = stream->Client(); |
146 if (client) | 144 if (client) |
147 client->StreamEnded(); | 145 client->StreamEnded(); |
148 } | 146 } |
149 | 147 |
150 } // namespace blink | 148 } // namespace blink |
OLD | NEW |