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

Side by Side Diff: media/base/video_capture_types.h

Issue 1439533004: Remove dead code paths around PIXEL_STORAGE_TEXTURE in capture pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mcasas's second round comments REBASE Created 5 years, 1 month 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 #ifndef MEDIA_BASE_VIDEO_CAPTURE_TYPES_H_ 5 #ifndef MEDIA_BASE_VIDEO_CAPTURE_TYPES_H_
6 #define MEDIA_BASE_VIDEO_CAPTURE_TYPES_H_ 6 #define MEDIA_BASE_VIDEO_CAPTURE_TYPES_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "media/base/media_export.h" 11 #include "media/base/media_export.h"
12 #include "media/base/video_types.h" 12 #include "media/base/video_types.h"
13 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
14 14
15 namespace media { 15 namespace media {
16 16
17 // TODO(wjia): this type should be defined in a common place and 17 // TODO(wjia): this type should be defined in a common place and
18 // shared with device manager. 18 // shared with device manager.
19 typedef int VideoCaptureSessionId; 19 typedef int VideoCaptureSessionId;
20 20
21 // Storage type for the pixels. In principle, all combinations of Storage and 21 // Storage type for the pixels. In principle, all combinations of Storage and
22 // Format are possible, though some are very typical, such as texture + ARGB, 22 // Format are possible, though some are very typical, such as texture + ARGB,
23 // and others are only available if the platform allows it e.g. GpuMemoryBuffer. 23 // and others are only available if the platform allows it e.g. GpuMemoryBuffer.
24 // TODO(mcasas): http://crbug.com/504160 Consider making this an enum class. 24 // TODO(mcasas): http://crbug.com/504160 Consider making this an enum class.
25 enum VideoPixelStorage { 25 enum VideoPixelStorage {
26 PIXEL_STORAGE_CPU, 26 PIXEL_STORAGE_CPU,
27 PIXEL_STORAGE_TEXTURE,
28 PIXEL_STORAGE_GPUMEMORYBUFFER, 27 PIXEL_STORAGE_GPUMEMORYBUFFER,
29 PIXEL_STORAGE_MAX = PIXEL_STORAGE_GPUMEMORYBUFFER, 28 PIXEL_STORAGE_MAX = PIXEL_STORAGE_GPUMEMORYBUFFER,
30 }; 29 };
31 30
32 // Policies for capture devices that have source content that varies in size. 31 // Policies for capture devices that have source content that varies in size.
33 // It is up to the implementation how the captured content will be transformed 32 // It is up to the implementation how the captured content will be transformed
34 // (e.g., scaling and/or letterboxing) in order to produce video frames that 33 // (e.g., scaling and/or letterboxing) in order to produce video frames that
35 // strictly adheree to one of these policies. 34 // strictly adheree to one of these policies.
36 enum ResolutionChangePolicy { 35 enum ResolutionChangePolicy {
37 // Capture device outputs a fixed resolution all the time. The resolution of 36 // Capture device outputs a fixed resolution all the time. The resolution of
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 118
120 typedef std::vector<VideoCaptureFormat> VideoCaptureFormats; 119 typedef std::vector<VideoCaptureFormat> VideoCaptureFormats;
121 120
122 // Parameters for starting video capture. 121 // Parameters for starting video capture.
123 // This class is used by the client of a video capture device to specify the 122 // This class is used by the client of a video capture device to specify the
124 // format of frames in which the client would like to have captured frames 123 // format of frames in which the client would like to have captured frames
125 // returned. 124 // returned.
126 struct MEDIA_EXPORT VideoCaptureParams { 125 struct MEDIA_EXPORT VideoCaptureParams {
127 VideoCaptureParams(); 126 VideoCaptureParams();
128 127
128 // Returns true if requested_format.IsValid() and all other values are within
129 // their expected ranges.
130 bool IsValid() const;
131
129 bool operator==(const VideoCaptureParams& other) const { 132 bool operator==(const VideoCaptureParams& other) const {
130 return requested_format == other.requested_format && 133 return requested_format == other.requested_format &&
131 resolution_change_policy == other.resolution_change_policy && 134 resolution_change_policy == other.resolution_change_policy &&
132 power_line_frequency == other.power_line_frequency; 135 power_line_frequency == other.power_line_frequency;
133 } 136 }
134 137
135 // Requests a resolution and format at which the capture will occur. 138 // Requests a resolution and format at which the capture will occur.
136 VideoCaptureFormat requested_format; 139 VideoCaptureFormat requested_format;
137 140
138 // Policy for resolution change. 141 // Policy for resolution change.
139 ResolutionChangePolicy resolution_change_policy; 142 ResolutionChangePolicy resolution_change_policy;
140 143
141 // User-specified power line frequency. 144 // User-specified power line frequency.
142 PowerLineFrequency power_line_frequency; 145 PowerLineFrequency power_line_frequency;
143 }; 146 };
144 147
145 } // namespace media 148 } // namespace media
146 149
147 #endif // MEDIA_BASE_VIDEO_CAPTURE_TYPES_H_ 150 #endif // MEDIA_BASE_VIDEO_CAPTURE_TYPES_H_
OLDNEW
« no previous file with comments | « content/renderer/media/video_capture_message_filter_unittest.cc ('k') | media/base/video_capture_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698