OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/tools/mfplayer/mfplayer.h" | 5 #include "media/tools/mfplayer/mfplayer.h" |
6 | 6 |
7 #include <mfapi.h> | 7 #include <mfapi.h> |
8 #include <mferror.h> | 8 #include <mferror.h> |
9 #include <shlwapi.h> | 9 #include <shlwapi.h> |
| 10 #include <strsafe.h> |
10 | 11 |
11 #include <cassert> | 12 #include <cassert> |
12 #include <cstdio> | |
13 | 13 |
14 template <class T> | 14 template <class T> |
15 static void SafeRelease(T** pptr) { | 15 static void SafeRelease(T** pptr) { |
16 if (pptr && *pptr) { | 16 if (pptr && *pptr) { |
17 (*pptr)->Release(); | 17 (*pptr)->Release(); |
18 *pptr = NULL; | 18 *pptr = NULL; |
19 } | 19 } |
20 } | 20 } |
21 | 21 |
22 static HRESULT ProbeTopology(IMFMediaEvent* event, | 22 static HRESULT ProbeTopology(IMFMediaEvent* event, |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 if (FAILED(hr)) | 814 if (FAILED(hr)) |
815 break; | 815 break; |
816 SafeRelease(&event); | 816 SafeRelease(&event); |
817 } | 817 } |
818 // Release the last MESessionClosed event. | 818 // Release the last MESessionClosed event. |
819 SafeRelease(&event); | 819 SafeRelease(&event); |
820 return SUCCEEDED(hr); | 820 return SUCCEEDED(hr); |
821 } | 821 } |
822 | 822 |
823 } // namespace mfplayer | 823 } // namespace mfplayer |
OLD | NEW |