1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef MEDIA_CAPTURE_VIDEO_WIN_METRICS_H_
6 #define MEDIA_CAPTURE_VIDEO_WIN_METRICS_H_
7 
8 #include "media/capture/video_capture_types.h"
9 
10 namespace media {
11 
12 enum class VideoCaptureWinBackend { kDirectShow, kMediaFoundation };
13 
14 // These values are presisted to logs.
15 enum class VideoCaptureWinBackendUsed : int {
16   kUsingDirectShowAsDefault = 0,
17   kUsingMediaFoundationAsDefault = 1,
18   kUsingDirectShowAsFallback = 2,
19   kCount
20 };
21 
22 // These values are presisted to logs.
23 enum class ImageCaptureOutcome : int {
24   kSucceededUsingVideoStream = 0,
25   kSucceededUsingPhotoStream = 1,
26   kFailedUsingVideoStream = 2,
27   kFailedUsingPhotoStream = 3,
28   kCount
29 };
30 
31 enum class MediaFoundationFunctionRequiringRetry {
32   kGetDeviceStreamCount,
33   kGetDeviceStreamCategory,
34   kGetAvailableDeviceMediaType
35 };
36 
37 bool IsHighResolution(const VideoCaptureFormat& format);
38 
39 void LogVideoCaptureWinBackendUsed(VideoCaptureWinBackendUsed value);
40 void LogWindowsImageCaptureOutcome(VideoCaptureWinBackend backend_type,
41                                    ImageCaptureOutcome value,
42                                    bool is_high_res);
43 void LogNumberOfRetriesNeededToWorkAroundMFInvalidRequest(
44     MediaFoundationFunctionRequiringRetry function,
45     int retry_count);
46 
47 }  // namespace media
48 
49 #endif  // MEDIA_CAPTURE_VIDEO_WIN_METRICS_H_
50