| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/capture/video/win/pin_base_win.h" | 5 #include "media/capture/video/win/pin_base_win.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 if (!IsMediaTypeValid(media_type)) | 137 if (!IsMediaTypeValid(media_type)) |
| 138 return VFW_E_TYPE_NOT_ACCEPTED; | 138 return VFW_E_TYPE_NOT_ACCEPTED; |
| 139 | 139 |
| 140 current_media_type_ = *media_type; | 140 current_media_type_ = *media_type; |
| 141 connector->AddRef(); | 141 connector->AddRef(); |
| 142 connected_pin_.Attach(connector); | 142 connected_pin_.Attach(connector); |
| 143 return S_OK; | 143 return S_OK; |
| 144 } | 144 } |
| 145 | 145 |
| 146 STDMETHODIMP PinBase::Disconnect() { | 146 STDMETHODIMP PinBase::Disconnect() { |
| 147 if (!connected_pin_.get()) | 147 if (!connected_pin_.Get()) |
| 148 return S_FALSE; | 148 return S_FALSE; |
| 149 | 149 |
| 150 connected_pin_.Reset(); | 150 connected_pin_.Reset(); |
| 151 return S_OK; | 151 return S_OK; |
| 152 } | 152 } |
| 153 | 153 |
| 154 STDMETHODIMP PinBase::ConnectedTo(IPin** pin) { | 154 STDMETHODIMP PinBase::ConnectedTo(IPin** pin) { |
| 155 *pin = connected_pin_.get(); | 155 *pin = connected_pin_.Get(); |
| 156 if (!connected_pin_.get()) | 156 if (!connected_pin_.Get()) |
| 157 return VFW_E_NOT_CONNECTED; | 157 return VFW_E_NOT_CONNECTED; |
| 158 | 158 |
| 159 connected_pin_.get()->AddRef(); | 159 connected_pin_.Get()->AddRef(); |
| 160 return S_OK; | 160 return S_OK; |
| 161 } | 161 } |
| 162 | 162 |
| 163 STDMETHODIMP PinBase::ConnectionMediaType(AM_MEDIA_TYPE* media_type) { | 163 STDMETHODIMP PinBase::ConnectionMediaType(AM_MEDIA_TYPE* media_type) { |
| 164 if (!connected_pin_.get()) | 164 if (!connected_pin_.Get()) |
| 165 return VFW_E_NOT_CONNECTED; | 165 return VFW_E_NOT_CONNECTED; |
| 166 *media_type = current_media_type_; | 166 *media_type = current_media_type_; |
| 167 return S_OK; | 167 return S_OK; |
| 168 } | 168 } |
| 169 | 169 |
| 170 STDMETHODIMP PinBase::QueryPinInfo(PIN_INFO* info) { | 170 STDMETHODIMP PinBase::QueryPinInfo(PIN_INFO* info) { |
| 171 info->dir = PINDIR_INPUT; | 171 info->dir = PINDIR_INPUT; |
| 172 info->pFilter = owner_; | 172 info->pFilter = owner_; |
| 173 if (owner_) | 173 if (owner_) |
| 174 owner_->AddRef(); | 174 owner_->AddRef(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 276 |
| 277 STDMETHODIMP_(ULONG) PinBase::Release() { | 277 STDMETHODIMP_(ULONG) PinBase::Release() { |
| 278 base::RefCounted<PinBase>::Release(); | 278 base::RefCounted<PinBase>::Release(); |
| 279 return 1; | 279 return 1; |
| 280 } | 280 } |
| 281 | 281 |
| 282 PinBase::~PinBase() { | 282 PinBase::~PinBase() { |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace media | 285 } // namespace media |
| OLD | NEW |