Note: We no longer publish the latest version of our code here. We primarily use a kumc-bmi github organization. The heron ETL repository, in particular, is not public. Peers in the informatics community should see MultiSiteDev for details on requesting access.

source: webrtc/webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info.mm @ 0:4bda6873e34c

pub_scrub_3792 tip
Last change on this file since 0:4bda6873e34c was 0:4bda6873e34c, checked in by Michael Prittie <mprittie@…>, 6 years ago

Scrubbed password for publication.

File size: 4.2 KB
Line 
1/*
2 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 *  Use of this source code is governed by a BSD-style license
5 *  that can be found in the LICENSE file in the root of the source
6 *  tree. An additional intellectual property rights grant can be found
7 *  in the file PATENTS.  All contributing project authors may
8 *  be found in the AUTHORS file in the root of the source tree.
9 */
10
11#import "webrtc/modules/video_capture/mac/qtkit/video_capture_qtkit_info_objc.h"
12#include "webrtc/modules/video_capture/include/video_capture.h"
13#include "webrtc/modules/video_capture/video_capture_config.h"
14#include "webrtc/system_wrappers/interface/trace.h"
15
16namespace webrtc
17{
18namespace videocapturemodule
19{
20
21VideoCaptureMacQTKitInfo::VideoCaptureMacQTKitInfo(const int32_t id) :
22    DeviceInfoImpl(id)
23{
24    _captureInfo = [[VideoCaptureMacQTKitInfoObjC alloc] init];
25}
26
27VideoCaptureMacQTKitInfo::~VideoCaptureMacQTKitInfo()
28{
29    [_captureInfo release];
30
31}
32
33int32_t VideoCaptureMacQTKitInfo::Init()
34{
35
36    return 0;
37}
38
39uint32_t VideoCaptureMacQTKitInfo::NumberOfDevices()
40{
41
42    uint32_t captureDeviceCount =
43        [[_captureInfo getCaptureDeviceCount]intValue];
44    return captureDeviceCount;
45
46}
47
48int32_t VideoCaptureMacQTKitInfo::GetDeviceName(
49    uint32_t deviceNumber, char* deviceNameUTF8,
50    uint32_t deviceNameLength, char* deviceUniqueIdUTF8,
51    uint32_t deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
52    uint32_t productUniqueIdUTF8Length)
53{
54    int errNum = [[_captureInfo getDeviceNamesFromIndex:deviceNumber
55                   DefaultName:deviceNameUTF8 WithLength:deviceNameLength
56                   AndUniqueID:deviceUniqueIdUTF8
57                   WithLength:deviceUniqueIdUTF8Length
58                   AndProductID:productUniqueIdUTF8
59                   WithLength:productUniqueIdUTF8Length]intValue];
60    return errNum;
61}
62
63int32_t VideoCaptureMacQTKitInfo::NumberOfCapabilities(
64    const char* deviceUniqueIdUTF8)
65{
66    // Not implemented. Mac doesn't use discrete steps in capabilities, rather
67    // "analog". QTKit will do it's best to convert frames to what ever format
68    // you ask for.
69    WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
70                 "NumberOfCapabilities is not supported on the Mac platform.");
71    return -1;
72}
73
74
75int32_t VideoCaptureMacQTKitInfo::GetCapability(
76    const char* deviceUniqueIdUTF8,
77    const uint32_t deviceCapabilityNumber,
78    VideoCaptureCapability& capability)
79{
80    // Not implemented. Mac doesn't use discrete steps in capabilities, rather
81    // "analog". QTKit will do it's best to convert frames to what ever format
82    // you ask for.
83    WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
84                 "NumberOfCapabilities is not supported on the Mac platform.");
85    return -1;
86}
87
88
89int32_t VideoCaptureMacQTKitInfo::GetBestMatchedCapability(
90    const char*deviceUniqueIdUTF8,
91    const VideoCaptureCapability& requested, VideoCaptureCapability& resulting)
92{
93    // Not implemented. Mac doesn't use discrete steps in capabilities, rather
94    // "analog". QTKit will do it's best to convert frames to what ever format
95    // you ask for.
96    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
97                 "NumberOfCapabilities is not supported on the Mac platform.");
98    return -1;
99}
100
101int32_t VideoCaptureMacQTKitInfo::DisplayCaptureSettingsDialogBox(
102    const char* deviceUniqueIdUTF8,
103    const char* dialogTitleUTF8, void* parentWindow,
104    uint32_t positionX, uint32_t positionY)
105{
106
107    return [[_captureInfo
108             displayCaptureSettingsDialogBoxWithDevice:deviceUniqueIdUTF8
109             AndTitle:dialogTitleUTF8
110             AndParentWindow:parentWindow AtX:positionX AndY:positionY]
111             intValue];
112}
113
114int32_t VideoCaptureMacQTKitInfo::CreateCapabilityMap(
115    const char* deviceUniqueIdUTF8)
116{
117    // Not implemented. Mac doesn't use discrete steps in capabilities, rather
118    // "analog". QTKit will do it's best to convert frames to what ever format
119    // you ask for.
120    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
121                 "NumberOfCapabilities is not supported on the Mac platform.");
122     return -1;
123}
124}  // namespace videocapturemodule
125}  // namespace webrtc
Note: See TracBrowser for help on using the repository browser.