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

Side by Side Diff: media/video/capture/video_capture_device.h

Issue 558623002: Video capture: Refactor GetBestMatchedFormat from Win to OS independent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sort pixel formats in order of preference Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // VideoCaptureDevice is the abstract base class for realizing video capture 5 // VideoCaptureDevice is the abstract base class for realizing video capture
6 // device support in Chromium. It provides the interface for OS dependent 6 // device support in Chromium. It provides the interface for OS dependent
7 // implementations. 7 // implementations.
8 // The class is created and functions are invoked on a thread owned by 8 // The class is created and functions are invoked on a thread owned by
9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS
10 // specific implementation. 10 // specific implementation.
11 11
12 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ 12 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_
13 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ 13 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_
14 14
15 #include <stdint.h>
15 #include <list> 16 #include <list>
16 #include <string> 17 #include <string>
17 18
18 #include "base/logging.h" 19 #include "base/logging.h"
19 #include "base/memory/ref_counted.h" 20 #include "base/memory/ref_counted.h"
20 #include "base/memory/scoped_ptr.h" 21 #include "base/memory/scoped_ptr.h"
21 #include "base/single_thread_task_runner.h" 22 #include "base/single_thread_task_runner.h"
22 #include "base/time/time.h" 23 #include "base/time/time.h"
23 #include "media/base/media_export.h" 24 #include "media/base/media_export.h"
24 #include "media/base/video_frame.h" 25 #include "media/base/video_frame.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 // 318 //
318 // This function must be called between InitializeImageCapture() and 319 // This function must be called between InitializeImageCapture() and
319 // ReleaseImageCapture(). 320 // ReleaseImageCapture().
320 virtual void CaptureImage() {} 321 virtual void CaptureImage() {}
321 322
322 protected: 323 protected:
323 static const int kPowerLine50Hz = 50; 324 static const int kPowerLine50Hz = 50;
324 static const int kPowerLine60Hz = 60; 325 static const int kPowerLine60Hz = 60;
325 }; 326 };
326 327
328 // Helper function to compare video capture formats when finding the most
329 // closely matched video format given a requested video format.
330 // Smaller difference means more closely matched formats.
331 // Prioritizes according to this list:
332 // 1. Closest matching height.
333 // 2. Closest matching width.
334 // 3. Closest matching frame rate.
335 // 4. Best color format.
336 // Nr 4. is not commutative, i.e. the order of the inputs to this
337 // function matters.
338 uint64_t DiffVideoCaptureFormat(const VideoCaptureFormat& requested,
mcasas 2014/10/13 08:18:45 Why is this in video_capture_device.{h,cc} and not
339 const VideoCaptureFormat& supported);
340
327 } // namespace media 341 } // namespace media
328 342
329 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ 343 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698