Bug 1439997 - Remove old mac video capture code. r=jib, a=RyanVM
authorDan Minor <dminor@mozilla.com>
Mon, 07 Jan 2019 16:34:01 +0000
changeset 506645 9104a4e2e3a4670bb75334e3ab1994f7728362b9
parent 506644 a902a8dcea8d2d51debed83ddf0f589ae4c88129
child 506646 b295af2ecf44a671a7802d6de183a7a5a03c259d
push id10497
push userryanvm@gmail.com
push dateSat, 12 Jan 2019 18:08:31 +0000
treeherdermozilla-beta@c0445e5ce388 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib, RyanVM
bugs1439997
milestone65.0
Bug 1439997 - Remove old mac video capture code. r=jib, a=RyanVM This code is no longer used and has been removed upstream. We can remove it as well. Differential Revision: https://phabricator.services.mozilla.com/D15196
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation.h
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation.mm
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info.h
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info.mm
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info_objc.h
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info_objc.mm
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_objc.h
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_objc.mm
media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_utility.h
media/webrtc/trunk/webrtc/modules/video_capture/mac/video_capture_mac.mm
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_H_
-#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_H_
-
-#import <AVFoundation/AVFoundation.h>
-#include <stdio.h>
-
-#include "webrtc/modules/video_capture/device_info_impl.h"
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_utility.h"
-#include "webrtc/modules/video_capture/video_capture_impl.h"
-
-@class VideoCaptureMacAVFoundationObjC;
-@class VideoCaptureMacAVFoundationInfoObjC;
-
-namespace webrtc
-{
-namespace videocapturemodule
-{
-
-class VideoCaptureMacAVFoundation : public VideoCaptureImpl
-{
-public:
-    VideoCaptureMacAVFoundation(const int32_t id);
-    virtual ~VideoCaptureMacAVFoundation();
-
-    /*
-    *   Create a video capture module object
-    *
-    *   id - unique identifier of this video capture module object
-    *   deviceUniqueIdUTF8 -  name of the device. Available names can be found
-    *       by using GetDeviceName
-    *   deviceUniqueIdUTF8Length - length of deviceUniqueIdUTF8
-    */
-    static void Destroy(VideoCaptureModule* module);
-
-    int32_t Init(const int32_t id, const char* deviceUniqueIdUTF8);
-
-
-    // Start/Stop
-    virtual int32_t StartCapture(
-        const VideoCaptureCapability& capability);
-    virtual int32_t StopCapture();
-
-    // Properties of the set device
-
-    virtual bool CaptureStarted();
-
-    int32_t CaptureSettings(VideoCaptureCapability& settings);
-
-protected:
-    // Help functions
-    int32_t SetCameraOutput();
-
-private:
-    VideoCaptureMacAVFoundationObjC*        _captureDevice;
-    VideoCaptureMacAVFoundationInfoObjC*    _captureInfo;
-    bool                    _isCapturing;
-    int32_t            _id;
-    int32_t            _captureWidth;
-    int32_t            _captureHeight;
-    int32_t            _captureFrameRate;
-    RawVideoType       _captureRawType;
-    char                     _currentDeviceNameUTF8[MAX_NAME_LENGTH];
-    char                     _currentDeviceUniqueIdUTF8[MAX_NAME_LENGTH];
-    char                     _currentDeviceProductUniqueIDUTF8[MAX_NAME_LENGTH];
-    int32_t            _frameCount;
-};
-}  // namespace videocapturemodule
-}  // namespace webrtc
-
-#endif  // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_H_
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation.mm
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation.h"
-#import "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info_objc.h"
-#import "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_objc.h"
-#include "webrtc/modules/video_capture/video_capture_config.h"
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
-#include "webrtc/system_wrappers/include/trace.h"
-
-class nsAutoreleasePool {
-public:
-    nsAutoreleasePool()
-    {
-        mLocalPool = [[NSAutoreleasePool alloc] init];
-    }
-    ~nsAutoreleasePool()
-    {
-        [mLocalPool release];
-    }
-private:
-    NSAutoreleasePool *mLocalPool;
-};
-
-namespace webrtc
-{
-
-namespace videocapturemodule
-{
-
-VideoCaptureMacAVFoundation::VideoCaptureMacAVFoundation(const int32_t id) :
-    _captureDevice(NULL),
-    _captureInfo(NULL),
-    _isCapturing(false),
-    _id(id),
-    _captureWidth(AVFOUNDATION_DEFAULT_WIDTH),
-    _captureHeight(AVFOUNDATION_DEFAULT_HEIGHT),
-    _captureFrameRate(AVFOUNDATION_DEFAULT_FRAME_RATE),
-    _captureRawType(kVideoUnknown),
-    _frameCount(0)
-{
-
-    memset(_currentDeviceNameUTF8, 0, MAX_NAME_LENGTH);
-    memset(_currentDeviceUniqueIdUTF8, 0, MAX_NAME_LENGTH);
-    memset(_currentDeviceProductUniqueIDUTF8, 0, MAX_NAME_LENGTH);
-}
-
-VideoCaptureMacAVFoundation::~VideoCaptureMacAVFoundation()
-{
-
-    nsAutoreleasePool localPool;
-    WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCapture, _id,
-                 "~VideoCaptureMacAVFoundation() called");
-    if(_captureDevice)
-    {
-        [_captureDevice registerOwner:nil];
-        [_captureDevice performSelectorOnMainThread:@selector(stopCapture)
-                        withObject:nil
-                        waitUntilDone:NO];
-        [_captureDevice performSelectorOnMainThread:@selector(release)
-                        withObject:nil
-                        waitUntilDone:NO];
-    }
-
-    if(_captureInfo)
-    {
-        [_captureInfo release];
-    }
-}
-
-int32_t VideoCaptureMacAVFoundation::Init(
-    const int32_t id, const char* iDeviceUniqueIdUTF8)
-{
-    CriticalSectionScoped cs(&_apiCs);
-
-
-    const int32_t nameLength =
-        (int32_t) strlen((char*)iDeviceUniqueIdUTF8);
-    if(nameLength>kVideoCaptureUniqueNameLength)
-        return -1;
-
-    // Store the device name
-    _deviceUniqueId = new char[nameLength+1];
-    memcpy(_deviceUniqueId, iDeviceUniqueIdUTF8,nameLength+1);
-
-    nsAutoreleasePool localPool;
-
-    _captureDevice = [[VideoCaptureMacAVFoundationObjC alloc] init];
-    if(NULL == _captureDevice)
-    {
-        WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, id,
-                     "Failed to create an instance of "
-                     "VideoCaptureMacAVFounationObjC");
-        return -1;
-    }
-
-    [_captureDevice registerOwner:this];
-
-    if(0 == strcmp((char*)iDeviceUniqueIdUTF8, ""))
-    {
-        // the user doesn't want to set a capture device at this time
-        return 0;
-    }
-
-    _captureInfo = [[VideoCaptureMacAVFoundationInfoObjC alloc]init];
-    if(nil == _captureInfo)
-    {
-        WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, id,
-        "Failed to create an instance of VideoCaptureMacAVFoundationInfoObjC");
-        return -1;
-    }
-
-    int captureDeviceCount = [[_captureInfo getCaptureDeviceCount]intValue];
-    if(captureDeviceCount < 0)
-    {
-        WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, id,
-                     "No Capture Devices Present");
-        return -1;
-    }
-
-    const int NAME_LENGTH = 1024;
-    char deviceNameUTF8[1024] = "";
-    char deviceUniqueIdUTF8[1024] = "";
-    char deviceProductUniqueIDUTF8[1024] = "";
-
-    bool captureDeviceFound = false;
-    for(int index = 0; index < captureDeviceCount; index++){
-
-        memset(deviceNameUTF8, 0, NAME_LENGTH);
-        memset(deviceUniqueIdUTF8, 0, NAME_LENGTH);
-        memset(deviceProductUniqueIDUTF8, 0, NAME_LENGTH);
-        if(-1 == [[_captureInfo getDeviceNamesFromIndex:index
-                   DefaultName:deviceNameUTF8 WithLength:NAME_LENGTH
-                   AndUniqueID:deviceUniqueIdUTF8 WithLength:NAME_LENGTH
-                   AndProductID:deviceProductUniqueIDUTF8
-                   WithLength:NAME_LENGTH]intValue])
-        {
-            WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
-                         "GetDeviceName returned -1 for index %d", index);
-            return -1;
-        }
-        if(0 == strcmp((const char*)iDeviceUniqueIdUTF8,
-                       (char*)deviceUniqueIdUTF8))
-        {
-            // we have a match
-            captureDeviceFound = true;
-            break;
-        }
-    }
-
-    if(false == captureDeviceFound)
-    {
-        WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
-                     "Failed to find capture device unique ID %s",
-                     iDeviceUniqueIdUTF8);
-        return -1;
-    }
-
-    // at this point we know that the user has passed in a valid camera. Let's
-    // set it as the current.
-    if(![_captureDevice setCaptureDeviceById:(char*)deviceUniqueIdUTF8])
-    {
-        strcpy((char*)_deviceUniqueId, (char*)deviceUniqueIdUTF8);
-        WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, _id,
-                     "Failed to set capture device %s (unique ID %s) even "
-                     "though it was a valid return from "
-                     "VideoCaptureMacAVFoundationInfo", deviceNameUTF8,
-                     iDeviceUniqueIdUTF8);
-        return -1;
-    }
-
-    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, _id,
-                 "successfully Init VideoCaptureMacAVFoundation" );
-    return 0;
-}
-
-int32_t VideoCaptureMacAVFoundation::StartCapture(
-    const VideoCaptureCapability& capability)
-{
-
-    nsAutoreleasePool localPool;
-    _captureWidth = capability.width;
-    _captureHeight = capability.height;
-    _captureFrameRate = capability.maxFPS;
-    _captureRawType = capability.rawType;
-    _captureDelay = 120;
-
-    [_captureDevice setCaptureHeight:_captureHeight
-                               width:_captureWidth
-                           frameRate:_captureFrameRate
-                             rawType:&_captureRawType];
-
-    [_captureDevice startCapture];
-    _isCapturing = true;
-    return 0;
-}
-
-int32_t VideoCaptureMacAVFoundation::StopCapture()
-{
-    nsAutoreleasePool localPool;
-    [_captureDevice stopCapture];
-    _isCapturing = false;
-    return 0;
-}
-
-bool VideoCaptureMacAVFoundation::CaptureStarted()
-{
-    return _isCapturing;
-}
-
-int32_t VideoCaptureMacAVFoundation::CaptureSettings(VideoCaptureCapability& settings)
-{
-    settings.width = _captureWidth;
-    settings.height = _captureHeight;
-    settings.maxFPS = _captureFrameRate;
-    settings.rawType = _captureRawType;
-    return 0;
-}
-
-
-// ********** begin functions inherited from DeviceInfoImpl **********
-
-struct VideoCaptureCapabilityMacAVFoundation:public VideoCaptureCapability
-{
-    VideoCaptureCapabilityMacAVFoundation()
-    {
-    }
-};
-}  // namespace videocapturemodule
-}  // namespace webrtc
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_INFO_H_
-#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_INFO_H_
-
-#include "webrtc/modules/video_capture/device_info_impl.h"
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_utility.h"
-#include "webrtc/modules/video_capture/video_capture_impl.h"
-
-
-@class VideoCaptureMacAVFoundationInfoObjC;
-
-namespace webrtc
-{
-namespace videocapturemodule
-{
-
-class VideoCaptureMacAVFoundationInfo: public DeviceInfoImpl
-{
-public:
-
-   VideoCaptureMacAVFoundationInfo(const int32_t id);
-    virtual ~VideoCaptureMacAVFoundationInfo();
-
-    int32_t Init();
-
-    virtual uint32_t NumberOfDevices();
-
-    /*
-     * Returns the available capture devices.
-     * deviceNumber   -[in] index of capture device
-     * deviceNameUTF8 - friendly name of the capture device
-     * deviceUniqueIdUTF8 - unique name of the capture device if it exist.
-     *      Otherwise same as deviceNameUTF8
-     * productUniqueIdUTF8 - unique product id if it exist. Null terminated
-     *      otherwise.
-     */
-    virtual int32_t GetDeviceName(
-        uint32_t deviceNumber, char* deviceNameUTF8,
-        uint32_t deviceNameLength, char* deviceUniqueIdUTF8,
-        uint32_t deviceUniqueIdUTF8Length,
-        char* productUniqueIdUTF8 = 0,
-        uint32_t productUniqueIdUTF8Length = 0,
-        pid_t* pid = 0);
-
-    /*
-     *   Returns the number of capabilities for this device
-     */
-    virtual int32_t NumberOfCapabilities(
-        const char* deviceUniqueIdUTF8);
-
-    /*
-     *   Gets the capabilities of the named device
-     */
-    virtual int32_t GetCapability(
-        const char* deviceUniqueIdUTF8,
-        const uint32_t deviceCapabilityNumber,
-        VideoCaptureCapability& capability);
-
-    /*
-     * Display OS /capture device specific settings dialog
-     */
-    virtual int32_t DisplayCaptureSettingsDialogBox(
-        const char* deviceUniqueIdUTF8,
-        const char* dialogTitleUTF8, void* parentWindow,
-        uint32_t positionX, uint32_t positionY);
-
-protected:
-    virtual int32_t CreateCapabilityMap(
-        const char* deviceUniqueIdUTF8);
-
-    VideoCaptureMacAVFoundationInfoObjC*    _captureInfo;
-};
-}  // namespace videocapturemodule
-}  // namespace webrtc
-
-#endif  // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_INFO_H_
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info.mm
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#import "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info_objc.h"
-#include "webrtc/modules/video_capture/video_capture.h"
-#include "webrtc/modules/video_capture/video_capture_config.h"
-#include "webrtc/system_wrappers/include/trace.h"
-#include "nsDebug.h"
-
-namespace webrtc
-{
-namespace videocapturemodule
-{
-
-VideoCaptureMacAVFoundationInfo::VideoCaptureMacAVFoundationInfo(const int32_t id)
-{
-    nsAutoreleasePool localPool;
-    _captureInfo = [[VideoCaptureMacAVFoundationInfoObjC alloc] init];
-    [_captureInfo registerOwner:this];
-}
-
-VideoCaptureMacAVFoundationInfo::~VideoCaptureMacAVFoundationInfo()
-{
-    nsAutoreleasePool localPool;
-    [_captureInfo registerOwner:nil];
-    [_captureInfo release];
-}
-
-int32_t VideoCaptureMacAVFoundationInfo::Init()
-{
-
-    return 0;
-}
-
-uint32_t VideoCaptureMacAVFoundationInfo::NumberOfDevices()
-{
-
-    nsAutoreleasePool localPool;
-    uint32_t captureDeviceCount =
-        [[_captureInfo getCaptureDeviceCount]intValue];
-    return captureDeviceCount;
-
-}
-
-int32_t VideoCaptureMacAVFoundationInfo::GetDeviceName(
-    uint32_t deviceNumber, char* deviceNameUTF8,
-    uint32_t deviceNameLength, char* deviceUniqueIdUTF8,
-    uint32_t deviceUniqueIdUTF8Length, char* productUniqueIdUTF8,
-    uint32_t productUniqueIdUTF8Length,
-    pid_t* pid)
-{
-    nsAutoreleasePool localPool;
-    int errNum = [[_captureInfo getDeviceNamesFromIndex:deviceNumber
-                   DefaultName:deviceNameUTF8 WithLength:deviceNameLength
-                   AndUniqueID:deviceUniqueIdUTF8
-                   WithLength:deviceUniqueIdUTF8Length
-                   AndProductID:productUniqueIdUTF8
-                   WithLength:productUniqueIdUTF8Length]intValue];
-    return errNum;
-}
-
-int32_t VideoCaptureMacAVFoundationInfo::NumberOfCapabilities(
-    const char* deviceUniqueIdUTF8)
-{
-    nsAutoreleasePool localPool;
-    uint32_t captureCapabilityCount =
-        [[_captureInfo getCaptureCapabilityCount:deviceUniqueIdUTF8]intValue];
-    return captureCapabilityCount;
-}
-
-
-int32_t VideoCaptureMacAVFoundationInfo::GetCapability(
-    const char* deviceUniqueIdUTF8,
-    const uint32_t deviceCapabilityNumber,
-    VideoCaptureCapability& capability)
-{
-    nsAutoreleasePool localPool;
-    uint32_t result =
-        [[_captureInfo getCaptureCapability:deviceUniqueIdUTF8
-                               CapabilityId:deviceCapabilityNumber
-                           Capability_width:&capability.width
-                          Capability_height:&capability.height
-                          Capability_maxFPS:&capability.maxFPS
-                          Capability_format:&capability.rawType]intValue];
-
-    return result;
-}
-
-int32_t VideoCaptureMacAVFoundationInfo::DisplayCaptureSettingsDialogBox(
-    const char* deviceUniqueIdUTF8,
-    const char* dialogTitleUTF8, void* parentWindow,
-    uint32_t positionX, uint32_t positionY)
-{
-    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
-                 "API not supported on Mac OS X.");
-    return -1;
-}
-
-int32_t VideoCaptureMacAVFoundationInfo::CreateCapabilityMap(
-    const char* deviceUniqueIdUTF8)
-{
-    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
-                 "API not supported on Mac OS X.");
-    return -1;
-}
-}  // namespace videocapturemodule
-}  // namespace webrtc
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info_objc.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-//
-//  video_capture_avfoundation_info_objc.h
-//
-//
-
-#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_INFO_OBJC_H_
-#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_INFO_OBJC_H_
-
-#import <Foundation/Foundation.h>
-#import <AVFoundation/AVFoundation.h>
-
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info.h"
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_utility.h"
-
-@interface VideoCaptureMacAVFoundationInfoObjC : NSObject{
-    bool                                _OSSupportedInfo;
-    NSArray*                            _captureDevicesInfo;
-    int                                    _captureDeviceCountInfo;
-    NSArray*                            _observers;
-    NSLock*                             _lock;
-    webrtc::videocapturemodule::VideoCaptureMacAVFoundationInfo* _owner;
-    NSMutableDictionary*                _capabilityMaps;
-
-}
-
-/**************************************************************************
- *
- *   The following functions are considered to be private
- *
- ***************************************************************************/
-
-- (NSNumber*)getCaptureDevices;
-- (NSNumber*)initializeVariables;
-- (void)checkOSSupported;
-
-
-/**************************************************************************
- *
- *   The following functions are considered to be public and called by VideoCaptureMacAVFoundationInfo class
- *
- ***************************************************************************/
-
-- (void)registerOwner:(webrtc::videocapturemodule::VideoCaptureMacAVFoundationInfo*)owner;
-
-- (NSNumber*)getCaptureDeviceCount;
-
-- (NSNumber*)getCaptureCapabilityCount:(const char*)uniqueId;
-
-- (NSNumber*)getCaptureCapability:(const char*)uniqueId
-                     CapabilityId:(uint32_t)capabilityId
-                 Capability_width:(int32_t*)width
-                Capability_height:(int32_t*)height
-                Capability_maxFPS:(int32_t*)maxFPS
-                Capability_format:(webrtc::RawVideoType*)rawType;
-
-- (NSNumber*)getDeviceNamesFromIndex:(uint32_t)index
-    DefaultName:(char*)deviceName
-    WithLength:(uint32_t)deviceNameLength
-    AndUniqueID:(char*)deviceUniqueID
-    WithLength:(uint32_t)deviceUniqueIDLength
-    AndProductID:(char*)deviceProductID
-    WithLength:(uint32_t)deviceProductIDLength;
-
-- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:
-        (const char*)deviceUniqueIdUTF8
-    AndTitle:(const char*)dialogTitleUTF8
-    AndParentWindow:(void*) parentWindow AtX:(uint32_t)positionX
-    AndY:(uint32_t) positionY;
-@end
-
-#endif  // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_INFO_OBJC_H_
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info_objc.mm
+++ /dev/null
@@ -1,363 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#pragma mark **** imports/includes
-
-#import "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info_objc.h"
-
-#include "webrtc/system_wrappers/include/trace.h"
-
-using namespace webrtc;
-using namespace videocapturemodule;
-
-#pragma mark **** hidden class interface
-
-@implementation VideoCaptureMacAVFoundationInfoObjC
-
-// ****************** over-written OS methods ***********************
-#pragma mark **** over-written OS methods
-
-/// ***** Objective-C. Similar to C++ constructor, although invoked manually
-/// ***** Potentially returns an instance of self
--(id)init{
-    self = [super init];
-    if(nil != self){
-        [self checkOSSupported];
-        [self initializeVariables];
-    }
-    else
-    {
-        return nil;
-    }
-    return self;
-}
-
-- (void)registerOwner:(VideoCaptureMacAVFoundationInfo*)owner {
-    [_lock lock];
-    _owner = owner;
-    [_lock unlock];
-}
-
-/// ***** Objective-C. Similar to C++ destructor
-/// ***** Returns nothing
-- (void)dealloc {
-
-    [_captureDevicesInfo release];
-
-    // Remove Observers
-    NSNotificationCenter* notificationCenter = [NSNotificationCenter defaultCenter];
-    for (id observer in _observers)
-        [notificationCenter removeObserver:observer];
-    [_observers release];
-    [_lock release];
-
-    for (NSMutableArray* capabilityMap in _capabilityMaps) {
-        [capabilityMap removeAllObjects];
-        [capabilityMap release];
-    }
-
-    [_capabilityMaps removeAllObjects];
-    [_capabilityMaps release];
-
-    [super dealloc];
-}
-
-// ****************** public methods ******************
-#pragma mark **** public method implementations
-
-/// ***** Creates a message box with Cocoa framework
-/// ***** Returns 0 on success, -1 otherwise.
-- (NSNumber*)displayCaptureSettingsDialogBoxWithDevice:(const char*)deviceUniqueIdUTF8
-                    AndTitle:(const char*)dialogTitleUTF8
-                    AndParentWindow:(void*) parentWindow
-                    AtX:(uint32_t)positionX
-                    AndY:(uint32_t) positionY
-{
-    NSString* strTitle = [NSString stringWithFormat:@"%s", dialogTitleUTF8];
-    NSString* strButton = @"Alright";
-    NSAlert* alert = [NSAlert alertWithMessageText:strTitle
-                      defaultButton:strButton
-                      alternateButton:nil otherButton:nil
-                      informativeTextWithFormat:@"Device %s is capturing", deviceUniqueIdUTF8];
-    [alert setAlertStyle:NSInformationalAlertStyle];
-    [alert runModal];
-    return [NSNumber numberWithInt:0];
-}
-
-- (NSNumber*)getCaptureDeviceCount{
-    [self getCaptureDevices];
-    return [NSNumber numberWithInt:_captureDeviceCountInfo];
-}
-
-- (NSNumber*)getCaptureCapabilityCount:(const char*)uniqueId {
-
-    AVCaptureDevice* captureDevice = nil;
-    if (uniqueId == nil || !strcmp("", uniqueId)) {
-        WEBRTC_TRACE(kTraceInfo, kTraceVideoCapture, 0,
-            "Incorrect capture id argument");
-        return [NSNumber numberWithInt:-1];
-    }
-
-    int deviceIndex;
-
-    for (deviceIndex = 0; deviceIndex < _captureDeviceCountInfo; deviceIndex++) {
-        captureDevice = (AVCaptureDevice*)[_captureDevicesInfo objectAtIndex:deviceIndex];
-        char captureDeviceId[1024] = "";
-        [[captureDevice uniqueID] getCString:captureDeviceId
-                                   maxLength:1024
-                                    encoding:NSUTF8StringEncoding];
-        if (strcmp(uniqueId, captureDeviceId) == 0) {
-            WEBRTC_TRACE(kTraceInfo, kTraceVideoCapture, 0,
-                "%s:%d Found capture device id %s as index %d",
-                __FUNCTION__, __LINE__, captureDeviceId, deviceIndex);
-            break;
-        }
-        captureDevice = nil;
-    }
-
-    if (!captureDevice)
-        return [NSNumber numberWithInt:-1];
-
-    NSMutableArray* capabilityMap = (NSMutableArray*)[_capabilityMaps objectForKey:[NSNumber numberWithInt:deviceIndex]];
-
-    if (capabilityMap != nil) {
-        [capabilityMap removeAllObjects];
-    } else {
-        capabilityMap = [[NSMutableArray alloc] init];
-        [_capabilityMaps setObject:capabilityMap forKey:[NSNumber numberWithInt:deviceIndex]];
-    }
-
-    int count = 0;
-
-    for (int formatIndex = 0; formatIndex < (int)[captureDevice formats].count; formatIndex++) {
-        AVCaptureDeviceFormat* format =
-            (AVCaptureDeviceFormat*) [[captureDevice formats] objectAtIndex:formatIndex];
-
-        count += format.videoSupportedFrameRateRanges.count;
-        for (int frameRateIndex = 0;
-                frameRateIndex < (int) format.videoSupportedFrameRateRanges.count;
-                frameRateIndex++) {
-            [capabilityMap addObject: [NSNumber numberWithInt:((formatIndex << 16) + (frameRateIndex & 0xffff))]];
-        }
-    }
-
-    return [NSNumber numberWithInt:count];
-}
-
-- (NSNumber*)getCaptureCapability:(const char*)uniqueId
-                     CapabilityId:(uint32_t)capabilityId
-                 Capability_width:(int32_t*)width
-                Capability_height:(int32_t*)height
-                Capability_maxFPS:(int32_t*)maxFPS
-                Capability_format:(webrtc::RawVideoType*)rawType
-{
-    AVCaptureDevice* captureDevice = nil;
-    if (uniqueId == nil || !strcmp("", uniqueId)) {
-        WEBRTC_TRACE(kTraceInfo, kTraceVideoCapture, 0,
-            "Incorrect capture id argument");
-        return [NSNumber numberWithInt:-1];
-    }
-
-    int deviceIndex;
-
-    for (deviceIndex = 0; deviceIndex < _captureDeviceCountInfo; deviceIndex++) {
-        captureDevice = (AVCaptureDevice*)[_captureDevicesInfo objectAtIndex:deviceIndex];
-        char captureDeviceId[1024] = "";
-        [[captureDevice uniqueID] getCString:captureDeviceId
-                                   maxLength:1024
-                                    encoding:NSUTF8StringEncoding];
-        if (strcmp(uniqueId, captureDeviceId) == 0) {
-            WEBRTC_TRACE(kTraceInfo, kTraceVideoCapture, 0,
-                "%s:%d Found capture device id %s as index %d",
-                __FUNCTION__, __LINE__, captureDeviceId, deviceIndex);
-            break;
-        }
-        captureDevice = nil;
-    }
-
-    if (!captureDevice)
-        return [NSNumber numberWithInt:-1];
-
-    NSMutableArray* capabilityMap = [_capabilityMaps objectForKey:[NSNumber numberWithInt:deviceIndex]];
-    NSNumber* indexNumber = [capabilityMap objectAtIndex:capabilityId];
-
-    // protection for illegal capabilityId
-    if (!indexNumber)
-        return [NSNumber numberWithInt:-1];
-
-    int indexInt = static_cast<int>([indexNumber integerValue]);
-    int formatIndex = indexInt >> 16;
-    int frameRateIndex = indexInt & 0xffff;
-
-    AVCaptureDeviceFormat* format = (AVCaptureDeviceFormat*)[[captureDevice formats]objectAtIndex:formatIndex];
-    CMVideoDimensions videoDimensions = CMVideoFormatDescriptionGetDimensions(format.formatDescription);
-    AVFrameRateRange* frameRateRange = [format.videoSupportedFrameRateRanges objectAtIndex:frameRateIndex];
-
-    *width = videoDimensions.width;
-    *height = videoDimensions.height;
-
-    // This is to fix setCaptureHeight() which fails for some webcams supporting non-integer framerates.
-    // In setCaptureHeight(), we match the best framerate range by searching a range whose max framerate
-    // is most close to (but smaller than or equal to) the target. Since maxFPS of capability is integer,
-    // we fill in the capability maxFPS with the floor value (e.g., 29) of the real supported fps
-    // (e.g., 29.97). If the target is set to 29, we failed to match the best format with max framerate
-    // 29.97 since it is over the target. Therefore, we need to return a ceiling value as the maxFPS here.
-    *maxFPS = static_cast<int32_t>(ceil(frameRateRange.maxFrameRate));
-    *rawType = [VideoCaptureMacAVFoundationUtility fourCCToRawVideoType:CMFormatDescriptionGetMediaSubType(format.formatDescription)];
-
-    return [NSNumber numberWithInt:0];
-}
-
-- (NSNumber*)getDeviceNamesFromIndex:(uint32_t)index
-    DefaultName:(char*)deviceName
-    WithLength:(uint32_t)deviceNameLength
-    AndUniqueID:(char*)deviceUniqueID
-    WithLength:(uint32_t)deviceUniqueIDLength
-    AndProductID:(char*)deviceProductID
-    WithLength:(uint32_t)deviceProductIDLength
-{
-    if(NO == _OSSupportedInfo)
-    {
-        return [NSNumber numberWithInt:0];
-    }
-
-    if(index >= (uint32_t)_captureDeviceCountInfo)
-    {
-        return [NSNumber numberWithInt:-1];
-    }
-
-    if ([_captureDevicesInfo count] <= index)
-    {
-      return [NSNumber numberWithInt:-1];
-    }
-
-    AVCaptureDevice* tempCaptureDevice = (AVCaptureDevice*)[_captureDevicesInfo objectAtIndex:index];
-    if(!tempCaptureDevice)
-    {
-      return [NSNumber numberWithInt:-1];
-    }
-
-    memset(deviceName, 0, deviceNameLength);
-    memset(deviceUniqueID, 0, deviceUniqueIDLength);
-
-    bool successful = NO;
-
-    NSString* tempString = [tempCaptureDevice localizedName];
-    successful = [tempString getCString:(char*)deviceName
-                  maxLength:deviceNameLength encoding:NSUTF8StringEncoding];
-    if(NO == successful)
-    {
-        memset(deviceName, 0, deviceNameLength);
-        return [NSNumber numberWithInt:-1];
-    }
-
-    tempString = [tempCaptureDevice uniqueID];
-    successful = [tempString getCString:(char*)deviceUniqueID
-                  maxLength:deviceUniqueIDLength encoding:NSUTF8StringEncoding];
-    if(NO == successful)
-    {
-        memset(deviceUniqueID, 0, deviceNameLength);
-        return [NSNumber numberWithInt:-1];
-    }
-
-    return [NSNumber numberWithInt:0];
-
-}
-
-// ****************** "private" category functions below here  ******************
-#pragma mark **** "private" method implementations
-
-- (NSNumber*)initializeVariables
-{
-    if(NO == _OSSupportedInfo)
-    {
-        return [NSNumber numberWithInt:0];
-    }
-
-    _captureDeviceCountInfo = 0;
-    [self getCaptureDevices];
-
-    _lock = [[NSLock alloc] init];
-
-    //register device connected / disconnected event
-    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
-
-    id deviceWasConnectedObserver = [notificationCenter addObserverForName:AVCaptureDeviceWasConnectedNotification
-        object:nil
-        queue:[NSOperationQueue mainQueue]
-        usingBlock:^(NSNotification *note) {
-            [_lock lock];
-            if(_owner)
-                _owner->DeviceChange();
-            [_lock unlock];
-        }];
-
-    id deviceWasDisconnectedObserver = [notificationCenter addObserverForName:AVCaptureDeviceWasDisconnectedNotification
-        object:nil
-        queue:[NSOperationQueue mainQueue]
-        usingBlock:^(NSNotification *note) {
-            [_lock lock];
-            if(_owner)
-                _owner->DeviceChange();
-            [_lock unlock];
-        }];
-
-    _observers = [[NSArray alloc] initWithObjects:deviceWasConnectedObserver, deviceWasDisconnectedObserver, nil];
-
-    _capabilityMaps = [[NSMutableDictionary alloc] init];
-
-    return [NSNumber numberWithInt:0];
-}
-
-// ***** Checks to see if the AVCaptureSession framework is available in the OS
-// ***** If it is not, isOSSupprted = NO
-// ***** Throughout the rest of the class isOSSupprted is checked and functions
-// ***** are/aren't called depending
-// ***** The user can use weak linking to the AVFoundation framework and run on older
-// ***** versions of the OS
-// ***** I.E. Backwards compaitibility
-// ***** Returns nothing. Sets member variable
-- (void)checkOSSupported
-{
-    Class osSupportedTest = NSClassFromString(@"AVCaptureSession");
-    if(nil == osSupportedTest)
-    {
-      _OSSupportedInfo = NO;
-    }
-    else
-    {
-      _OSSupportedInfo = YES;
-    }
-}
-
-/// ***** Retrieves the number of capture devices currently available
-/// ***** Stores them in an NSArray instance
-/// ***** Returns 0 on success, -1 otherwise.
-- (NSNumber*)getCaptureDevices
-{
-    if(NO == _OSSupportedInfo)
-    {
-        return [NSNumber numberWithInt:0];
-    }
-
-    if(_captureDevicesInfo)
-    {
-        [_captureDevicesInfo release];
-    }
-    _captureDevicesInfo = [[NSArray alloc]
-                            initWithArray:[AVCaptureDevice
-                                           devicesWithMediaType:AVMediaTypeVideo]];
-
-    _captureDeviceCountInfo = _captureDevicesInfo.count;
-
-    return [NSNumber numberWithInt:0];
-}
-
-@end
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_objc.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-//
-//  video_capture_avfoundation_objc.h
-//
-//
-
-#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_OBJC_H_
-#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_OBJC_H_
-
-#import <AppKit/AppKit.h>
-#import <CoreData/CoreData.h>
-#import <CoreFoundation/CoreFoundation.h>
-#import <CoreVideo/CoreVideo.h>
-#import <Foundation/Foundation.h>
-
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation.h"
-
-@interface VideoCaptureMacAVFoundationObjC : NSObject <AVCaptureVideoDataOutputSampleBufferDelegate> {
-  bool _capturing;
-  int _frameRate;
-  int _frameWidth;
-  int _frameHeight;
-  webrtc::RawVideoType _rawType;
-  int _framesDelivered;
-  int _framesRendered;
-  bool _captureInitialized;
-
-  webrtc::videocapturemodule::VideoCaptureMacAVFoundation* _owner;
-  NSLock* _lock;
-
-  AVCaptureDevice* _captureDevice;
-  AVCaptureSession* _captureSession;
-  AVCaptureVideoDataOutput* _captureVideoDataOutput;
-  dispatch_queue_t _videoDataOutputQueue;
-  NSArray* _captureDevices;
-  int _captureDeviceCount;
-  char _captureDeviceNameUTF8[1024];
-  char _captureDeviceNameUniqueID[1024];
-}
-
-- (void)getCaptureDevices;
-- (BOOL)initializeVideoCapture;
-- (BOOL)initializeVariables;
-
-- (void)registerOwner:(webrtc::videocapturemodule::VideoCaptureMacAVFoundation*)owner;
-- (BOOL)setCaptureDeviceById:(char*)uniqueId;
-- (void)setCaptureHeight:(int)height width:(int)width frameRate:(int)frameRate rawType:(webrtc::RawVideoType*)rawType;
-- (void)startCapture;
-- (void)stopCapture;
-
-@end
-
-#endif  // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_OBJC_H_
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_objc.mm
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#define DEFAULT_CAPTURE_DEVICE_INDEX    1
-#define DEFAULT_FRAME_RATE              30
-#define DEFAULT_FRAME_WIDTH             352
-#define DEFAULT_FRAME_HEIGHT            288
-#define ROTATE_CAPTURED_FRAME           1
-#define LOW_QUALITY                     1
-
-#import "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_objc.h"
-
-#include "webrtc/system_wrappers/include/trace.h"
-
-using namespace webrtc;
-using namespace videocapturemodule;
-
-@implementation VideoCaptureMacAVFoundationObjC
-
--(id)init {
-  self = [super init];
-  if (self) {
-    [self initializeVariables];
-  }
-  return self;
-}
-
-- (void)dealloc {
-  if (_captureSession)
-    [_captureSession stopRunning];
-
-  [_captureVideoDataOutput release];
-
-  if (_videoDataOutputQueue)
-    dispatch_release(_videoDataOutputQueue);
-
-  [_captureSession release];
-  [_captureDevices release];
-  [_lock release];
-
-  [super dealloc];
-}
-
-#pragma mark Public methods
-
-- (void)registerOwner:(VideoCaptureMacAVFoundation*)owner {
-  [_lock lock];
-  _owner = owner;
-  [_lock unlock];
-}
-
-- (BOOL)setCaptureDeviceById:(char*)uniqueId {
-  if (uniqueId == nil || !strcmp("", uniqueId)) {
-    WEBRTC_TRACE(kTraceInfo, kTraceVideoCapture, 0,
-                 "Incorrect capture id argument");
-    return NO;
-  }
-
-  if (!strcmp(uniqueId, _captureDeviceNameUniqueID))
-    return YES;
-
-  for(int index = 0; index < _captureDeviceCount; index++) {
-    _captureDevice = (AVCaptureDevice*)[_captureDevices objectAtIndex:index];
-    char captureDeviceId[1024] = "";
-    [[_captureDevice uniqueID] getCString:captureDeviceId
-                               maxLength:1024
-                                encoding:NSUTF8StringEncoding];
-    if (strcmp(uniqueId, captureDeviceId) == 0) {
-      WEBRTC_TRACE(kTraceInfo, kTraceVideoCapture, 0,
-                   "%s:%d Found capture device id %s as index %d",
-                   __FUNCTION__, __LINE__, captureDeviceId, index);
-      [[_captureDevice localizedName] getCString:_captureDeviceNameUTF8
-                                             maxLength:1024
-                                              encoding:NSUTF8StringEncoding];
-      [[_captureDevice uniqueID] getCString:_captureDeviceNameUniqueID
-                                 maxLength:1024
-                                  encoding:NSUTF8StringEncoding];
-      break;
-    }
-    _captureDevice = nil;
-  }
-
-  if (!_captureDevice)
-    return NO;
-
-  NSError* error;
-  AVCaptureDeviceInput *deviceInput =
-    [AVCaptureDeviceInput deviceInputWithDevice:_captureDevice error:&error];
-
-  if (deviceInput &&
-    [_captureSession canAddInput:deviceInput]) {
-    [_captureSession addInput:deviceInput];
-  } else {
-    WEBRTC_TRACE(kTraceError, kTraceVideoCapture, 0,
-                 "Failed to add input from %s to the capture session",
-                 _captureDeviceNameUTF8);
-    return NO;
-  }
-
-  WEBRTC_TRACE(kTraceInfo, kTraceVideoCapture, 0,
-               "%s:%d successfully added capture device: %s", __FUNCTION__,
-               __LINE__, _captureDeviceNameUTF8);
-  return YES;
-}
-
-- (void)setCaptureHeight:(int)height width:(int)width frameRate:(int)frameRate rawType:(webrtc::RawVideoType*)rawType {
-  _frameWidth = width;
-  _frameHeight = height;
-  _frameRate = frameRate;
-  _rawType = *rawType;
-
-  AVCaptureDeviceFormat *bestFormat = nil;
-  AVFrameRateRange *bestFrameRateRange = nil;
-
-  for (AVCaptureDeviceFormat* format in [_captureDevice formats]) {
-    CMVideoDimensions videoDimensions = CMVideoFormatDescriptionGetDimensions(format.formatDescription);
-    if (videoDimensions.width == _frameWidth &&
-        videoDimensions.height == _frameHeight &&
-        [VideoCaptureMacAVFoundationUtility fourCCToRawVideoType:CMFormatDescriptionGetMediaSubType(format.formatDescription)] == _rawType)
-    {
-      bestFormat = format;
-      for (AVFrameRateRange* range in format.videoSupportedFrameRateRanges) {
-        if ( range.maxFrameRate <= _frameRate && range.maxFrameRate > bestFrameRateRange.maxFrameRate) {
-          bestFrameRateRange = range;
-        }
-      }
-      break;
-    }
-  }
-
-  if (bestFormat && bestFrameRateRange) {
-    NSDictionary* newSettings = [NSDictionary dictionaryWithObjectsAndKeys:
-      [NSNumber numberWithDouble:_frameWidth], (id)kCVPixelBufferWidthKey,
-      [NSNumber numberWithDouble:_frameHeight], (id)kCVPixelBufferHeightKey,
-      [NSNumber numberWithUnsignedInt:CMFormatDescriptionGetMediaSubType(bestFormat.formatDescription)], (id)kCVPixelBufferPixelFormatTypeKey,
-      nil];
-
-    _captureVideoDataOutput.videoSettings = newSettings;
-
-    AVCaptureConnection* captureConnection =
-      [_captureVideoDataOutput connectionWithMediaType:AVMediaTypeVideo];
-
-    if ([captureConnection isVideoMinFrameDurationSupported]) {
-      [captureConnection setVideoMinFrameDuration:bestFrameRateRange.minFrameDuration];
-    }
-
-    if ([captureConnection isVideoMaxFrameDurationSupported]) {
-      [captureConnection setVideoMaxFrameDuration:bestFrameRateRange.minFrameDuration];
-    }
-  }
-}
-
-- (void)startCapture {
-  if (_capturing)
-    return;
-
-  [_captureSession startRunning];
-  _capturing = YES;
-}
-
-- (void)stopCapture {
-  if (!_capturing)
-    return;
-
-  [_captureSession performSelectorOnMainThread:@selector(stopRunning)
-                   withObject:nil
-                   waitUntilDone:NO];
-  _capturing = NO;
-}
-
-#pragma mark Private methods
-
-- (BOOL)initializeVariables {
-  if (NSClassFromString(@"AVCaptureSession") == nil)
-    return NO;
-
-  memset(_captureDeviceNameUTF8, 0, 1024);
-  _framesDelivered = 0;
-  _framesRendered = 0;
-  _captureDeviceCount = 0;
-  _capturing = NO;
-  _captureInitialized = NO;
-  _frameRate = DEFAULT_FRAME_RATE;
-  _frameWidth = DEFAULT_FRAME_WIDTH;
-  _frameHeight = DEFAULT_FRAME_HEIGHT;
-  _lock = [[NSLock alloc] init];
-  _captureSession = [[AVCaptureSession alloc] init];
-
-  _captureVideoDataOutput = [AVCaptureVideoDataOutput new];
-
-  [_captureVideoDataOutput setAlwaysDiscardsLateVideoFrames:YES];
-
-  _videoDataOutputQueue = dispatch_queue_create("VideoDataOutputQueue", DISPATCH_QUEUE_SERIAL);
-  [_captureVideoDataOutput setSampleBufferDelegate:self queue:_videoDataOutputQueue];
-
-  [self getCaptureDevices];
-  if (![self initializeVideoCapture])
-    return NO;
-
-  return NO;
-}
-
-- (void)getCaptureDevices {
-  if (_captureDevices)
-    [_captureDevices release];
-
-  _captureDevices = [[NSArray alloc] initWithArray:
-      [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]];
-
-  _captureDeviceCount = _captureDevices.count;
-}
-
-- (BOOL)initializeVideoCapture{
-
-  if ([_captureSession canAddOutput:_captureVideoDataOutput]) {
-    [_captureSession addOutput:_captureVideoDataOutput];
-    return YES;
-  } else {
-    return NO;
-  }
-}
-
-- (void)captureOutput:(AVCaptureOutput *)captureOutput
-  didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer
-       fromConnection:(AVCaptureConnection *)connection {
-  // TODO(mflodman) Experiment more when this happens.
-}
-
-- (void)captureOutput:(AVCaptureOutput *)captureOutput
-  didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
-         fromConnection:(AVCaptureConnection *)connection {
-
-  [_lock lock];
-  if (!_owner) {
-    [_lock unlock];
-    return;
-  }
-
-  CMFormatDescriptionRef formatDescription =
-      CMSampleBufferGetFormatDescription(sampleBuffer);
-  webrtc::RawVideoType rawType =
-      [VideoCaptureMacAVFoundationUtility fourCCToRawVideoType:CMFormatDescriptionGetMediaSubType(formatDescription)];
-  CMVideoDimensions dimensions =
-      CMVideoFormatDescriptionGetDimensions(formatDescription);
-
-  VideoCaptureCapability tempCaptureCapability;
-  tempCaptureCapability.width = dimensions.width;
-  tempCaptureCapability.height = dimensions.height;
-  tempCaptureCapability.maxFPS = _frameRate;
-  tempCaptureCapability.rawType = rawType;
-
-  CMBlockBufferRef blockBuffer = CMSampleBufferGetDataBuffer(sampleBuffer);
-
-  if (blockBuffer) {
-    char* baseAddress;
-    size_t frameSize;
-    size_t lengthAtOffset;
-    CMBlockBufferGetDataPointer(blockBuffer, 0, &lengthAtOffset, &frameSize, &baseAddress);
-
-    NSAssert(lengthAtOffset == frameSize, @"lengthAtOffset != frameSize)");
-
-    _owner->IncomingFrame((unsigned char*)baseAddress, frameSize,
-                            tempCaptureCapability, 0);
-  } else {
-    // Get a CMSampleBuffer's Core Video image buffer for the media data
-    CVImageBufferRef videoFrame = CMSampleBufferGetImageBuffer(sampleBuffer);
-
-    if (CVPixelBufferLockBaseAddress(videoFrame, kCVPixelBufferLock_ReadOnly) == kCVReturnSuccess) {
-      void* baseAddress = CVPixelBufferGetBaseAddress(videoFrame);
-      size_t bytesPerRow = CVPixelBufferGetBytesPerRow(videoFrame);
-      size_t frameHeight = CVPixelBufferGetHeight(videoFrame);
-      size_t frameSize = bytesPerRow * frameHeight;
-
-      _owner->IncomingFrame((unsigned char*)baseAddress, frameSize,
-                            tempCaptureCapability, 0);
-      CVPixelBufferUnlockBaseAddress(videoFrame, kCVPixelBufferLock_ReadOnly);
-    }
-  }
-  [_lock unlock];
-  _framesDelivered++;
-  _framesRendered++;
-}
-
-@end
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_utility.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-/*
- *  video_capture_avfoundation_utility.h
- *
- */
-
-
-#ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_UTILITY_H_
-#define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_UTILITY_H_
-
-#define MAX_NAME_LENGTH                1024
-
-#define AVFOUNDATION_MIN_WIDTH                0
-#define AVFOUNDATION_MAX_WIDTH                2560
-#define AVFOUNDATION_DEFAULT_WIDTH            352
-
-#define AVFOUNDATION_MIN_HEIGHT            0
-#define AVFOUNDATION_MAX_HEIGHT            1440
-#define AVFOUNDATION_DEFAULT_HEIGHT        288
-
-#define AVFOUNDATION_MIN_FRAME_RATE        1
-#define AVFOUNDATION_MAX_FRAME_RATE        60
-#define AVFOUNDATION_DEFAULT_FRAME_RATE    30
-
-#define RELEASE_AND_CLEAR(p)        if (p) { (p) -> Release () ; (p) = NULL ; }
-
-@interface VideoCaptureMacAVFoundationUtility : NSObject {}
-+ (webrtc::RawVideoType)fourCCToRawVideoType:(FourCharCode)fourcc;
-@end
-
-@implementation VideoCaptureMacAVFoundationUtility
-+ (webrtc::RawVideoType)fourCCToRawVideoType:(FourCharCode)fourcc {
-    switch (fourcc) {
-        case kCMPixelFormat_32ARGB:
-            return webrtc::kVideoBGRA;
-        case kCMPixelFormat_32BGRA:
-            return webrtc::kVideoARGB;
-        case kCMPixelFormat_24RGB:
-            return webrtc::kVideoRGB24;
-        case kCMPixelFormat_16LE565:
-            return webrtc::kVideoRGB565;
-        case kCMPixelFormat_16LE5551:
-            return webrtc::kVideoARGB1555;
-        case kCMPixelFormat_422YpCbCr8:
-            return webrtc::kVideoUYVY;
-        case kCMPixelFormat_422YpCbCr8_yuvs:
-            return webrtc::kVideoYUY2;
-        case kCMVideoCodecType_JPEG_OpenDML:
-            return webrtc::kVideoMJPEG;
-        case kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange:
-        case kCVPixelFormatType_420YpCbCr8BiPlanarFullRange:
-            return webrtc::kVideoNV12;
-        case kCVPixelFormatType_420YpCbCr8Planar:
-        case kCVPixelFormatType_420YpCbCr8PlanarFullRange:
-            return webrtc::kVideoI420;
-        default:
-            return webrtc::kVideoUnknown;
-    }
-}
-@end
-
-#endif  // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_AVFOUNDATION_VIDEO_CAPTURE_AVFOUNDATION_UTILITY_H_
deleted file mode 100644
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/video_capture_mac.mm
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-/*
- *  video_capture_mac.cc
- *
- */
-
-#include "webrtc/modules/video_capture/device_info_impl.h"
-#include "webrtc/modules/video_capture/video_capture_config.h"
-#include "webrtc/modules/video_capture/video_capture_impl.h"
-#include "webrtc/system_wrappers/include/trace.h"
-
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation.h"
-#include "webrtc/modules/video_capture/mac/avfoundation/video_capture_avfoundation_info.h"
-
-namespace webrtc
-{
-namespace videocapturemodule
-{
-
-// static
-bool CheckOSVersion()
-{
-    // Check OSX version is at least 10.7 (min for AVFoundation)
-    int major = 0;
-    int minor = 0;
-
-    NSString* versionString = [[NSDictionary dictionaryWithContentsOfFile:
-                                @"/System/Library/CoreServices/SystemVersion.plist"] objectForKey:@"ProductVersion"];
-    NSArray* versions = [versionString componentsSeparatedByString:@"."];
-    NSUInteger count = [versions count];
-    if (count > 0) {
-        major = [(NSString *)[versions objectAtIndex:0] integerValue];
-        if (count > 1) {
-            minor = [(NSString *)[versions objectAtIndex:1] integerValue];
-        }
-    }
-
-    if (major < 10)
-    {
-      return false;
-    }
-    if ((major == 10) && (minor < 7)) {
-      return false;
-    }
-
-    return true;
-}
-
-/**************************************************************************
- *
- *    Create/Destroy a VideoCaptureModule
- *
- ***************************************************************************/
-
-/*
- *   Returns version of the module and its components
- *
- *   version                 - buffer to which the version will be written
- *   remainingBufferInBytes  - remaining number of int8_t in the version
- *                             buffer
- *   position                - position of the next empty int8_t in the
- *                             version buffer
- */
-
-rtc::scoped_refptr<VideoCaptureModule> VideoCaptureImpl::Create(
-    const char* deviceUniqueIdUTF8)
-{
-
-    if (webrtc::videocapturemodule::CheckOSVersion() == false)
-    {
-        WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
-                     "OS version is too old. Could not create video capture "
-                     "module. Returning NULL");
-        return NULL;
-    }
-
-    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
-                 "Using AVFoundation framework to capture video", 0);
-
-    rtc::scoped_refptr<videocapturemodule::VideoCaptureMacAVFoundation> newCaptureModule(
-        new rtc::RefCountedObject<videocapturemodule::VideoCaptureMacAVFoundation>(0));
-
-    if(!newCaptureModule)
-    {
-        WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCapture, 0,
-                     "could not Create for unique device %s, !newCaptureModule",
-                     deviceUniqueIdUTF8);
-        return NULL;
-    }
-    if(newCaptureModule->Init(0, deviceUniqueIdUTF8) != 0)
-    {
-        WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCapture, 0,
-                     "could not Create for unique device %s, "
-                     "newCaptureModule->Init()!=0", deviceUniqueIdUTF8);
-        return NULL;
-    }
-
-    // Successfully created VideoCaptureMacQuicktime. Return it
-    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
-                 "Module created for unique device %s, will use AVFoundation "
-                 "framework",deviceUniqueIdUTF8);
-    return newCaptureModule;
-}
-
-/**************************************************************************
- *
- *    Create/Destroy a DeviceInfo
- *
- ***************************************************************************/
-
-VideoCaptureModule::DeviceInfo*
-VideoCaptureImpl::CreateDeviceInfo()
-{
-
-
-    if (webrtc::videocapturemodule::CheckOSVersion() == false)
-    {
-        WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceVideoCapture, 0,
-                     "OS version is too old. Could not create video capture "
-                     "module. Returning NULL");
-        return NULL;
-    }
-
-    webrtc::videocapturemodule::VideoCaptureMacAVFoundationInfo* newCaptureInfoModule =
-        new webrtc::videocapturemodule::VideoCaptureMacAVFoundationInfo(0);
-
-    if(!newCaptureInfoModule || newCaptureInfoModule->Init() != 0)
-    {
-        //Destroy(newCaptureInfoModule);
-        delete newCaptureInfoModule;
-        newCaptureInfoModule = NULL;
-        WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
-                     "Failed to Init newCaptureInfoModule created with id %d "
-                     "and device \"\" ", 0);
-        return NULL;
-    }
-    WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
-                 "VideoCaptureModule created for id", 0);
-    return newCaptureInfoModule;
-
-}
-
-/**************************************************************************
- *
- *    End Create/Destroy VideoCaptureModule
- *
- ***************************************************************************/
-}  // namespace videocapturemodule
-}  // namespace webrtc