Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: media/capture/video/mac/video_capture_device_avfoundation_mac.h

Issue 2143903003: [WIP] Move media/capture to device/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/capture/video/mac/DEPS ('k') | media/capture/video/mac/video_capture_device_avfoundation_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/mac/video_capture_device_avfoundation_mac.h
diff --git a/media/capture/video/mac/video_capture_device_avfoundation_mac.h b/media/capture/video/mac/video_capture_device_avfoundation_mac.h
deleted file mode 100644
index 69082e7aac0d7f9af2d3a4b8963313e1f241c73c..0000000000000000000000000000000000000000
--- a/media/capture/video/mac/video_capture_device_avfoundation_mac.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_
-#define MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_
-
-#import <Foundation/Foundation.h>
-
-#import "base/mac/scoped_nsobject.h"
-#include "base/synchronization/lock.h"
-#include "base/threading/thread_checker.h"
-#import "media/base/mac/avfoundation_glue.h"
-#include "media/base/video_capture_types.h"
-#include "media/capture/video/video_capture_device.h"
-
-namespace media {
-class VideoCaptureDeviceMac;
-}
-
-@class CrAVCaptureDevice;
-@class CrAVCaptureSession;
-@class CrAVCaptureVideoDataOutput;
-@class CrAVCaptureStillImageOutput;
-
-// Class used by VideoCaptureDeviceMac (VCDM) for video and image capture using
-// AVFoundation API. This class lives inside the thread created by its owner
-// VCDM.
-//
-// * Clients (VCDM) should call +deviceNames to fetch the list of devices
-// available in the system; this method returns the list of device names that
-// have to be used with -setCaptureDevice:.
-// * Previous to any use, clients (VCDM) must call -initWithFrameReceiver: to
-// initialise an object of this class and register a |frameReceiver_|.
-// * Frame receiver registration or removal can also happen via explicit call
-// to -setFrameReceiver:. Re-registrations are safe and allowed, even during
-// capture using this method.
-// * Method -setCaptureDevice: must be called at least once with a device
-// identifier from +deviceNames. Creates all the necessary AVFoundation
-// objects on first call; it connects them ready for capture every time.
-// This method should not be called during capture (i.e. between
-// -startCapture and -stopCapture).
-// * -setCaptureWidth:height:frameRate: is called if a resolution or frame rate
-// different than the by default one set by -setCaptureDevice: is needed.
-// This method should not be called during capture. This method must be
-// called after -setCaptureDevice:.
-// * -startCapture registers the notification listeners and starts the
-// capture. The capture can be stop using -stopCapture. The capture can be
-// restarted and restoped multiple times, reconfiguring or not the device in
-// between.
-// * -setCaptureDevice can be called with a |nil| value, case in which it stops
-// the capture and disconnects the library objects. This step is not
-// necessary.
-// * Deallocation of the library objects happens gracefully on destruction of
-// the VideoCaptureDeviceAVFoundation object.
-//
-//
-@interface VideoCaptureDeviceAVFoundation
- : NSObject<CrAVCaptureVideoDataOutputSampleBufferDelegate> {
- @private
- // The following attributes are set via -setCaptureHeight:width:frameRate:.
- int frameWidth_;
- int frameHeight_;
- float frameRate_;
-
- base::Lock lock_; // Protects concurrent setting and using |frameReceiver_|.
- media::VideoCaptureDeviceMac* frameReceiver_; // weak.
-
- base::scoped_nsobject<CrAVCaptureSession> captureSession_;
-
- // |captureDevice_| is an object coming from AVFoundation, used only to be
- // plugged in |captureDeviceInput_| and to query for session preset support.
- CrAVCaptureDevice* captureDevice_;
- // |captureDeviceInput_| is owned by |captureSession_|.
- CrAVCaptureDeviceInput* captureDeviceInput_;
- base::scoped_nsobject<CrAVCaptureVideoDataOutput> captureVideoDataOutput_;
-
- // An AVDataOutput specialized for taking pictures out of |captureSession_|.
- base::scoped_nsobject<CrAVCaptureStillImageOutput> stillImageOutput_;
-
- base::ThreadChecker main_thread_checker_;
-}
-
-// Returns a dictionary of capture devices with friendly name and unique id.
-+ (NSDictionary*)deviceNames;
-
-// Retrieve the capture supported formats for a given device |name|.
-+ (void)getDevice:(const media::VideoCaptureDevice::Name&)name
- supportedFormats:(media::VideoCaptureFormats*)formats;
-
-// Initializes the instance and the underlying capture session and registers the
-// frame receiver.
-- (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver;
-
-// Sets the frame receiver.
-- (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver;
-
-// Sets which capture device to use by name, retrieved via |deviceNames|. Once
-// the deviceId is known, the library objects are created if needed and
-// connected for the capture, and a by default resolution is set. If deviceId is
-// nil, then the eventual capture is stopped and library objects are
-// disconnected. Returns YES on success, NO otherwise. This method should not be
-// called during capture.
-- (BOOL)setCaptureDevice:(NSString*)deviceId;
-
-// Configures the capture properties for the capture session and the video data
-// output; this means it MUST be called after setCaptureDevice:. Return YES on
-// success, else NO.
-- (BOOL)setCaptureHeight:(int)height
- width:(int)width
- frameRate:(float)frameRate;
-
-// Starts video capturing and register the notification listeners. Must be
-// called after setCaptureDevice:, and, eventually, also after
-// setCaptureHeight:width:frameRate:. Returns YES on success, NO otherwise.
-- (BOOL)startCapture;
-
-// Stops video capturing and stops listening to notifications.
-- (void)stopCapture;
-
-// Takes a photo. This method should only be called between -startCapture and
-// -stopCapture.
-- (void)takePhoto;
-
-@end
-
-#endif // MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_AVFOUNDATION_MAC_H_
« no previous file with comments | « media/capture/video/mac/DEPS ('k') | media/capture/video/mac/video_capture_device_avfoundation_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698